xref: /AOO41X/main/offapi/com/sun/star/ui/dialogs/XFilePicker.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_ui_dialogs_XFilePicker_idl__
28*cdf0e10cSrcweir#define __com_sun_star_ui_dialogs_XFilePicker_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
31*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
35*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_ui_dialogs_XExecutableDialog_idl__
39*cdf0e10cSrcweir#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir//=============================================================================
43*cdf0e10cSrcweir
44*cdf0e10cSrcweirmodule com { module sun { module star { module ui { module dialogs {
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir//=============================================================================
47*cdf0e10cSrcweir/** Specifies an interface for a FilePicker
48*cdf0e10cSrcweir*/
49*cdf0e10cSrcweir
50*cdf0e10cSrcweirpublished interface XFilePicker: com::sun::star::ui::dialogs::XExecutableDialog
51*cdf0e10cSrcweir{
52*cdf0e10cSrcweir
53*cdf0e10cSrcweir	//-------------------------------------------------------------------------
54*cdf0e10cSrcweir	/**	Enable/disable multiselection mode
55*cdf0e10cSrcweir
56*cdf0e10cSrcweir		<p>If the multiselection mode is enabled, multiple files
57*cdf0e10cSrcweir		may be selected by the user else only one file selection at a time is possible</p>
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir		@param bMode
60*cdf0e10cSrcweir		<p>A value of <TRUE/> enables the multiselection mode.</p>
61*cdf0e10cSrcweir		<p>A value of <FALSE/> disables the multiselection mode, this is the default.</p>
62*cdf0e10cSrcweir	*/
63*cdf0e10cSrcweir	void setMultiSelectionMode( [in] boolean bMode );
64*cdf0e10cSrcweir
65*cdf0e10cSrcweir	//-------------------------------------------------------------------------
66*cdf0e10cSrcweir	/**	Sets the default string that appears in the file name box of a FilePicker.
67*cdf0e10cSrcweir
68*cdf0e10cSrcweir		@param aName
69*cdf0e10cSrcweir		<p>	Specifies the default file name, displayed when the FilePicker
70*cdf0e10cSrcweir			is shown. The implementation may accept any string, and does not
71*cdf0e10cSrcweir			have to check for a valid file name or if the file really exists.
72*cdf0e10cSrcweir		</p>
73*cdf0e10cSrcweir	*/
74*cdf0e10cSrcweir	void setDefaultName( [in] string aName );
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir	//-------------------------------------------------------------------------
77*cdf0e10cSrcweir	/**	Sets the directory that the file dialog initially displays.
78*cdf0e10cSrcweir
79*cdf0e10cSrcweir		@param aDirectory
80*cdf0e10cSrcweir		Specifies the initial directory in URL format. The given URL must be
81*cdf0e10cSrcweir		conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>).
82*cdf0e10cSrcweir
83*cdf0e10cSrcweir		@throws com::sun::star::lang::IllegalArgumentException
84*cdf0e10cSrcweir		if the URL is invalid (doesn't conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>).
85*cdf0e10cSrcweir	*/
86*cdf0e10cSrcweir	void setDisplayDirectory( [in] string aDirectory )
87*cdf0e10cSrcweir		raises( ::com::sun::star::lang::IllegalArgumentException );
88*cdf0e10cSrcweir
89*cdf0e10cSrcweir	//-------------------------------------------------------------------------
90*cdf0e10cSrcweir	/**	Returns the directory that the file dialog is currently showing or
91*cdf0e10cSrcweir		was last showing before closing the dialog with Ok. If the user
92*cdf0e10cSrcweir		did cancel the dialog, the returned value is undefined.
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir		@returns
95*cdf0e10cSrcweir		The directory in URL format, must be conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>.
96*cdf0e10cSrcweir	 */
97*cdf0e10cSrcweir	string getDisplayDirectory();
98*cdf0e10cSrcweir
99*cdf0e10cSrcweir	//-------------------------------------------------------------------------
100*cdf0e10cSrcweir	/**	Returns a sequence of the selected files including path information in
101*cdf0e10cSrcweir		URL format, conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>.
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir		<p>If the user closed the dialog with cancel an empty sequence will be
104*cdf0e10cSrcweir		returned.</p>
105*cdf0e10cSrcweir		<br/>
106*cdf0e10cSrcweir		<p>If the dialog is in execution mode and a single file is selected
107*cdf0e10cSrcweir		the complete URL of this file will be returned.</p>
108*cdf0e10cSrcweir		<p>If the dialog is in execution mode and multiple files are selected
109*cdf0e10cSrcweir		an empty sequence will be returned.</p>
110*cdf0e10cSrcweir		<p>If the dialog is in execution mode and the selected file name is false
111*cdf0e10cSrcweir		or any other error occurs an empty sequence will be returned.</p>
112*cdf0e10cSrcweir
113*cdf0e10cSrcweir		@returns
114*cdf0e10cSrcweir		<p>	The complete path of the file or directory currently selected
115*cdf0e10cSrcweir			in URL format. There are two different cases:
116*cdf0e10cSrcweir			<ol>
117*cdf0e10cSrcweir				<li>Multiselection is disabled:
118*cdf0e10cSrcweir				The first and only entry of the sequence contains the complete
119*cdf0e10cSrcweir				path/filename in URL format.</li>
120*cdf0e10cSrcweir
121*cdf0e10cSrcweir				<li>Multiselection is enabled:
122*cdf0e10cSrcweir				If only one file is selected, the first entry
123*cdf0e10cSrcweir				of the sequence contains the complete path/filename in URL format.
124*cdf0e10cSrcweir				If multiple files are selected, the first entry of the sequence contains
125*cdf0e10cSrcweir				the path in URL format, and the other entries contains the names of the selected
126*cdf0e10cSrcweir				files without path information.</li>
127*cdf0e10cSrcweir			</ol>
128*cdf0e10cSrcweir
129*cdf0e10cSrcweir			<br/>
130*cdf0e10cSrcweir
131*cdf0e10cSrcweir			<p><strong>Notes for the implementation of a FileSave dialog:</strong>If there exists
132*cdf0e10cSrcweir			a checkbox "Automatic File Extension" which is checked and a valid filter is currently selected
133*cdf0e10cSrcweir			the dialog may automatically add an extension to the selected file name.</p>
134*cdf0e10cSrcweir		</p>
135*cdf0e10cSrcweir	*/
136*cdf0e10cSrcweir	sequence< string > getFiles();
137*cdf0e10cSrcweir};
138*cdf0e10cSrcweir
139*cdf0e10cSrcweir//=============================================================================
140*cdf0e10cSrcweir
141*cdf0e10cSrcweir}; }; }; }; };
142*cdf0e10cSrcweir
143*cdf0e10cSrcweir
144*cdf0e10cSrcweir#endif
145*cdf0e10cSrcweir
146