1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_ui_dialogs_XFilePicker_idl__
24cdf0e10cSrcweir#define __com_sun_star_ui_dialogs_XFilePicker_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
27cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir
30cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32cdf0e10cSrcweir#endif
33cdf0e10cSrcweir
34cdf0e10cSrcweir#ifndef __com_sun_star_ui_dialogs_XExecutableDialog_idl__
35cdf0e10cSrcweir#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
36cdf0e10cSrcweir#endif
37cdf0e10cSrcweir
38cdf0e10cSrcweir//=============================================================================
39cdf0e10cSrcweir
40cdf0e10cSrcweirmodule com { module sun { module star { module ui { module dialogs {
41cdf0e10cSrcweir
42cdf0e10cSrcweir//=============================================================================
43cdf0e10cSrcweir/** Specifies an interface for a FilePicker
44cdf0e10cSrcweir*/
45cdf0e10cSrcweir
46cdf0e10cSrcweirpublished interface XFilePicker: com::sun::star::ui::dialogs::XExecutableDialog
47cdf0e10cSrcweir{
48cdf0e10cSrcweir
49cdf0e10cSrcweir	//-------------------------------------------------------------------------
50cdf0e10cSrcweir	/**	Enable/disable multiselection mode
51cdf0e10cSrcweir
52cdf0e10cSrcweir		<p>If the multiselection mode is enabled, multiple files
53cdf0e10cSrcweir		may be selected by the user else only one file selection at a time is possible</p>
54cdf0e10cSrcweir
55cdf0e10cSrcweir		@param bMode
56cdf0e10cSrcweir		<p>A value of <TRUE/> enables the multiselection mode.</p>
57cdf0e10cSrcweir		<p>A value of <FALSE/> disables the multiselection mode, this is the default.</p>
58cdf0e10cSrcweir	*/
59cdf0e10cSrcweir	void setMultiSelectionMode( [in] boolean bMode );
60cdf0e10cSrcweir
61cdf0e10cSrcweir	//-------------------------------------------------------------------------
62cdf0e10cSrcweir	/**	Sets the default string that appears in the file name box of a FilePicker.
63cdf0e10cSrcweir
64cdf0e10cSrcweir		@param aName
65cdf0e10cSrcweir		<p>	Specifies the default file name, displayed when the FilePicker
66cdf0e10cSrcweir			is shown. The implementation may accept any string, and does not
67cdf0e10cSrcweir			have to check for a valid file name or if the file really exists.
68cdf0e10cSrcweir		</p>
69cdf0e10cSrcweir	*/
70cdf0e10cSrcweir	void setDefaultName( [in] string aName );
71cdf0e10cSrcweir
72cdf0e10cSrcweir	//-------------------------------------------------------------------------
73cdf0e10cSrcweir	/**	Sets the directory that the file dialog initially displays.
74cdf0e10cSrcweir
75cdf0e10cSrcweir		@param aDirectory
76cdf0e10cSrcweir		Specifies the initial directory in URL format. The given URL must be
77cdf0e10cSrcweir		conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>).
78cdf0e10cSrcweir
79cdf0e10cSrcweir		@throws com::sun::star::lang::IllegalArgumentException
80cdf0e10cSrcweir		if the URL is invalid (doesn't conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>).
81cdf0e10cSrcweir	*/
82cdf0e10cSrcweir	void setDisplayDirectory( [in] string aDirectory )
83cdf0e10cSrcweir		raises( ::com::sun::star::lang::IllegalArgumentException );
84cdf0e10cSrcweir
85cdf0e10cSrcweir	//-------------------------------------------------------------------------
86cdf0e10cSrcweir	/**	Returns the directory that the file dialog is currently showing or
87cdf0e10cSrcweir		was last showing before closing the dialog with Ok. If the user
88cdf0e10cSrcweir		did cancel the dialog, the returned value is undefined.
89cdf0e10cSrcweir
90cdf0e10cSrcweir		@returns
91cdf0e10cSrcweir		The directory in URL format, must be conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>.
92cdf0e10cSrcweir	 */
93cdf0e10cSrcweir	string getDisplayDirectory();
94cdf0e10cSrcweir
95cdf0e10cSrcweir	//-------------------------------------------------------------------------
96cdf0e10cSrcweir	/**	Returns a sequence of the selected files including path information in
97cdf0e10cSrcweir		URL format, conform to <a href="http://www.w3.org/Addressing/rfc1738.txt">Rfc1738</a>.
98cdf0e10cSrcweir
99cdf0e10cSrcweir		<p>If the user closed the dialog with cancel an empty sequence will be
100cdf0e10cSrcweir		returned.</p>
101cdf0e10cSrcweir		<br/>
102cdf0e10cSrcweir		<p>If the dialog is in execution mode and a single file is selected
103cdf0e10cSrcweir		the complete URL of this file will be returned.</p>
104cdf0e10cSrcweir		<p>If the dialog is in execution mode and multiple files are selected
105cdf0e10cSrcweir		an empty sequence will be returned.</p>
106cdf0e10cSrcweir		<p>If the dialog is in execution mode and the selected file name is false
107cdf0e10cSrcweir		or any other error occurs an empty sequence will be returned.</p>
108cdf0e10cSrcweir
109cdf0e10cSrcweir		@returns
110cdf0e10cSrcweir		<p>	The complete path of the file or directory currently selected
111cdf0e10cSrcweir			in URL format. There are two different cases:
112cdf0e10cSrcweir			<ol>
113cdf0e10cSrcweir				<li>Multiselection is disabled:
114cdf0e10cSrcweir				The first and only entry of the sequence contains the complete
115cdf0e10cSrcweir				path/filename in URL format.</li>
116cdf0e10cSrcweir
117cdf0e10cSrcweir				<li>Multiselection is enabled:
118cdf0e10cSrcweir				If only one file is selected, the first entry
119cdf0e10cSrcweir				of the sequence contains the complete path/filename in URL format.
120cdf0e10cSrcweir				If multiple files are selected, the first entry of the sequence contains
121cdf0e10cSrcweir				the path in URL format, and the other entries contains the names of the selected
122cdf0e10cSrcweir				files without path information.</li>
123cdf0e10cSrcweir			</ol>
124cdf0e10cSrcweir
125cdf0e10cSrcweir			<br/>
126cdf0e10cSrcweir
127cdf0e10cSrcweir			<p><strong>Notes for the implementation of a FileSave dialog:</strong>If there exists
128cdf0e10cSrcweir			a checkbox "Automatic File Extension" which is checked and a valid filter is currently selected
129cdf0e10cSrcweir			the dialog may automatically add an extension to the selected file name.</p>
130cdf0e10cSrcweir		</p>
131cdf0e10cSrcweir	*/
132cdf0e10cSrcweir	sequence< string > getFiles();
133cdf0e10cSrcweir};
134cdf0e10cSrcweir
135cdf0e10cSrcweir//=============================================================================
136cdf0e10cSrcweir
137cdf0e10cSrcweir}; }; }; }; };
138cdf0e10cSrcweir
139cdf0e10cSrcweir
140cdf0e10cSrcweir#endif
141cdf0e10cSrcweir
142