xref: /aoo41x/main/fpicker/source/office/iodlg.hxx (revision 10ce8018)
1*10ce8018SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*10ce8018SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*10ce8018SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*10ce8018SAndrew Rist  * distributed with this work for additional information
6*10ce8018SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*10ce8018SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*10ce8018SAndrew Rist  * "License"); you may not use this file except in compliance
9*10ce8018SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*10ce8018SAndrew Rist  *
11*10ce8018SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*10ce8018SAndrew Rist  *
13*10ce8018SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*10ce8018SAndrew Rist  * software distributed under the License is distributed on an
15*10ce8018SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*10ce8018SAndrew Rist  * KIND, either express or implied.  See the License for the
17*10ce8018SAndrew Rist  * specific language governing permissions and limitations
18*10ce8018SAndrew Rist  * under the License.
19*10ce8018SAndrew Rist  *
20*10ce8018SAndrew Rist  *************************************************************/
21*10ce8018SAndrew Rist 
22*10ce8018SAndrew Rist 
23cdf0e10cSrcweir #ifndef _IODLGIMPL_HXX
24cdf0e10cSrcweir #define _IODLGIMPL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _VCL_DIALOG_HXX
27cdf0e10cSrcweir #include <vcl/dialog.hxx>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX
30cdf0e10cSrcweir #include <vcl/button.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #include <vcl/fixed.hxx>
33cdf0e10cSrcweir #include <vcl/edit.hxx>
34cdf0e10cSrcweir #include <vcl/combobox.hxx>
35cdf0e10cSrcweir #include <vcl/lstbox.hxx>
36cdf0e10cSrcweir #include <com/sun/star/beans/StringPair.hpp>
37cdf0e10cSrcweir #include <com/sun/star/uno/Any.hxx>
38cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
39cdf0e10cSrcweir #include <com/sun/star/ucb/IOErrorCode.hpp>
40cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp>
41cdf0e10cSrcweir #include <unotools/confignode.hxx>
42cdf0e10cSrcweir #include "svl/inettype.hxx"
43cdf0e10cSrcweir #include "svl/urlfilter.hxx"
44cdf0e10cSrcweir #include <svl/restrictedpaths.hxx>
45cdf0e10cSrcweir #include "asyncfilepicker.hxx"
46cdf0e10cSrcweir #include "OfficeControlAccess.hxx"
47cdf0e10cSrcweir #include "fpsmartcontent.hxx"
48cdf0e10cSrcweir 
49cdf0e10cSrcweir #include <set>
50cdf0e10cSrcweir 
51cdf0e10cSrcweir // @@@ using namespace com::sun::star::ucb;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir //*****************************************************************************
54cdf0e10cSrcweir 
55cdf0e10cSrcweir class SvTabListBox;
56cdf0e10cSrcweir class SvStringsDtor;
57cdf0e10cSrcweir class SvtFileView;
58cdf0e10cSrcweir struct ControlChain_Impl;
59cdf0e10cSrcweir class SvtFileDialogFilter_Impl;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir //*****************************************************************************
62cdf0e10cSrcweir 
63cdf0e10cSrcweir #define SFXWB_INSERT			( 0x04000000L | WB_OPEN )
64cdf0e10cSrcweir #define SFXWB_PASSWORD			WB_PASSWORD
65cdf0e10cSrcweir #define SFXWB_READONLY			WB_READONLY
66cdf0e10cSrcweir #define SFXWB_PATHDIALOG		WB_PATH
67cdf0e10cSrcweir #define SFXWB_CLASSPATH			( 0x08000000L | SFXWB_PATHDIALOG )
68cdf0e10cSrcweir #define SFXWB_SHOWALLFOLDER		0x10000000L		// alle Ordner auch Mail/News/...
69cdf0e10cSrcweir #define SFXWB_MULTISELECTION	0x20000000L		// Multiselection an
70cdf0e10cSrcweir #define SFXWB_NOREMOTE          0x40000000L
71cdf0e10cSrcweir #define SFXWB_SHOWVERSIONS		0x80000000L  	// Versionsauswahl anzeigen
72cdf0e10cSrcweir 
73cdf0e10cSrcweir #define SFX_EXTRA_AUTOEXTENSION     0x00000001L
74cdf0e10cSrcweir #define SFX_EXTRA_FILTEROPTIONS     0x00000002L
75cdf0e10cSrcweir #define SFX_EXTRA_SHOWVERSIONS      0x00000004L
76cdf0e10cSrcweir #define SFX_EXTRA_INSERTASLINK      0x00000008L
77cdf0e10cSrcweir #define SFX_EXTRA_SHOWPREVIEW       0x00000010L
78cdf0e10cSrcweir #define SFX_EXTRA_TEMPLATES         0x00000020L
79cdf0e10cSrcweir #define SFX_EXTRA_PLAYBUTTON        0x00000040L
80cdf0e10cSrcweir #define SFX_EXTRA_SELECTION         0x00000080L
81cdf0e10cSrcweir #define SFX_EXTRA_IMAGE_TEMPLATE    0x00000100L
82cdf0e10cSrcweir 
83cdf0e10cSrcweir #define RET_MANAGER				100
84cdf0e10cSrcweir 
85cdf0e10cSrcweir #define FILEDIALOG_FILTER_ALL	"*.*"
86cdf0e10cSrcweir 
87cdf0e10cSrcweir //*****************************************************************************
88cdf0e10cSrcweir // SvtFileDialog
89cdf0e10cSrcweir //*****************************************************************************
90cdf0e10cSrcweir 
91cdf0e10cSrcweir class SvtExpFileDlg_Impl;
92cdf0e10cSrcweir class SvtFileDialog : public ModalDialog, public ::svt::IFilePickerController
93cdf0e10cSrcweir {
94cdf0e10cSrcweir private:
95cdf0e10cSrcweir     // originally from VclFileDialog
96cdf0e10cSrcweir 	ControlChain_Impl*			_pUserControls;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	CheckBox*					_pCbReadOnly;
99cdf0e10cSrcweir 	CheckBox*                   _pCbLinkBox;
100cdf0e10cSrcweir 	CheckBox*                   _pCbPreviewBox;
101cdf0e10cSrcweir 	CheckBox*                   _pCbSelection;
102cdf0e10cSrcweir     PushButton*                 _pPbPlay;
103cdf0e10cSrcweir 	Window*                     _pPrevWin;
104cdf0e10cSrcweir 	FixedBitmap*                _pPrevBmp;
105cdf0e10cSrcweir 	SvtFileView*				_pFileView;
106cdf0e10cSrcweir 	::svt::IFilePickerListener*	_pFileNotifier;
107cdf0e10cSrcweir 	SvtExpFileDlg_Impl*			_pImp;
108cdf0e10cSrcweir     WinBits						_nExtraBits;
109cdf0e10cSrcweir     sal_Bool                        _bIsInExecute   :	1;
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 	ImageList					m_aImages;
112cdf0e10cSrcweir     ::svt::SmartContent			m_aContent;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     ::svt::RestrictedPaths      m_aURLFilter;
115cdf0e10cSrcweir     ::std::set< Control* >      m_aDisabledControls;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     ::utl::OConfigurationNode   m_aConfiguration;
118cdf0e10cSrcweir     ::rtl::Reference< ::svt::AsyncPickerAction >
119cdf0e10cSrcweir                                 m_pCurrentAsyncAction;
120cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
121cdf0e10cSrcweir         ::com::sun::star::ui::dialogs::XDialogClosedListener >
122cdf0e10cSrcweir                                 m_xListener;
123cdf0e10cSrcweir     bool                        m_bInExecuteAsync;
124cdf0e10cSrcweir 	bool						m_bHasFilename;
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	DECL_STATIC_LINK( SvtFileDialog, FilterSelectHdl_Impl, ListBox* );
127cdf0e10cSrcweir 	DECL_STATIC_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton* );
128cdf0e10cSrcweir 	DECL_STATIC_LINK( SvtFileDialog, ViewHdl_Impl, ImageButton* );
129cdf0e10cSrcweir 	DECL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void* );
130cdf0e10cSrcweir 	DECL_LINK       (                CancelHdl_Impl, void* );
131cdf0e10cSrcweir 	DECL_STATIC_LINK( SvtFileDialog, FileNameGetFocusHdl_Impl, void* );
132cdf0e10cSrcweir 	DECL_STATIC_LINK( SvtFileDialog, FileNameModifiedHdl_Impl, void* );
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	void						Init_Impl( WinBits nBits );
135cdf0e10cSrcweir 	/** find a filter with the given wildcard
136cdf0e10cSrcweir 	@param _rFilter
137cdf0e10cSrcweir 		the wildcard pattern to look for in the filter list
138cdf0e10cSrcweir 	@param _bMultiExt
139cdf0e10cSrcweir 		allow for filters with more than one extension pattern
140cdf0e10cSrcweir 	@param _rFilterChanged
141cdf0e10cSrcweir 		set to <TRUE/> if the filter changed
142cdf0e10cSrcweir 	@return
143cdf0e10cSrcweir 		the filter which has been found
144cdf0e10cSrcweir 	*/
145cdf0e10cSrcweir 	SvtFileDialogFilter_Impl*	FindFilter_Impl( const String& _rFilter,
146cdf0e10cSrcweir 												 sal_Bool _bMultiExt,
147cdf0e10cSrcweir 												 sal_Bool& _rFilterChanged
148cdf0e10cSrcweir 												 );
149cdf0e10cSrcweir 	void						ExecuteFilter();
150cdf0e10cSrcweir 	void						OpenMultiSelection_Impl();
151cdf0e10cSrcweir     void                        AddControls_Impl( );
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	DECL_LINK( SelectHdl_Impl, SvTabListBox* );
154cdf0e10cSrcweir 	DECL_LINK( DblClickHdl_Impl, SvTabListBox* );
155cdf0e10cSrcweir 	DECL_LINK( EntrySelectHdl_Impl, ComboBox* );
156cdf0e10cSrcweir 	DECL_LINK( OpenDoneHdl_Impl, SvtFileView* );
157cdf0e10cSrcweir 	DECL_LINK( AutoExtensionHdl_Impl, CheckBox* );
158cdf0e10cSrcweir 	DECL_LINK( ClickHdl_Impl, CheckBox* );
159cdf0e10cSrcweir 	DECL_LINK( PlayButtonHdl_Impl, PushButton* );
160cdf0e10cSrcweir 
161cdf0e10cSrcweir     // entfernt einen Filter mit Wildcards aus dem Path und gibt in zurueck
162cdf0e10cSrcweir 	sal_Bool IsolateFilterFromPath_Impl( String& rPath, String& rFilter );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	void	implArrangeControls();
165cdf0e10cSrcweir 	void	implUpdateImages( );
166cdf0e10cSrcweir 
167cdf0e10cSrcweir protected:
168cdf0e10cSrcweir 	virtual long				Notify( NotifyEvent& rNEvt );
169cdf0e10cSrcweir 	void						EnableInternet( sal_Bool bInternet );
170cdf0e10cSrcweir 
171cdf0e10cSrcweir     // originally from VclFileDialog
172cdf0e10cSrcweir 	Link						_aOKHdl;
173cdf0e10cSrcweir 	Link						_aFileSelectHdl;
174cdf0e10cSrcweir 	Link						_aFilterSelectHdl;
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 	String						_aPath;
177cdf0e10cSrcweir 	String						_aDefExt;
178cdf0e10cSrcweir 
179cdf0e10cSrcweir 	void						ReleaseOwnerShip( Window* pUserControl );
180cdf0e10cSrcweir 
181cdf0e10cSrcweir     /** enables or disables the complete UI of the file picker, with only offering a
182cdf0e10cSrcweir         cancel button
183cdf0e10cSrcweir 
184cdf0e10cSrcweir         This method preserves the "enabled" state of its controls in the following sense:
185cdf0e10cSrcweir         If you disable a certain control, then disable the dialog UI, then enable the dialog
186cdf0e10cSrcweir         UI, the control will still be disabled.
187cdf0e10cSrcweir         This is under the assumption that you'll use EnableControl. Direct access to the control
188cdf0e10cSrcweir         (such as pControl->Enable()) will break this.
189cdf0e10cSrcweir     */
190cdf0e10cSrcweir     void                        EnableUI( sal_Bool _bEnable );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir     /** enables or disables a control
193cdf0e10cSrcweir 
194cdf0e10cSrcweir         You are strongly encouraged to prefer this method over pControl->Enable( _bEnable ). See
195cdf0e10cSrcweir         <member>EnableUI</member> for details.
196cdf0e10cSrcweir     */
197cdf0e10cSrcweir     void                        EnableControl( Control* _pControl, sal_Bool _bEnable );
198cdf0e10cSrcweir     short                       PrepareExecute();
199cdf0e10cSrcweir 
200cdf0e10cSrcweir public:
201cdf0e10cSrcweir 								SvtFileDialog( Window* _pParent, WinBits nBits, WinBits nExtraBits );
202cdf0e10cSrcweir 								SvtFileDialog( Window* _pParent, WinBits nBits );
203cdf0e10cSrcweir 								~SvtFileDialog();
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 	virtual long				OK();
206cdf0e10cSrcweir 	virtual short				Execute();
207cdf0e10cSrcweir     virtual void                StartExecuteModal( const Link& rEndDialogHdl );
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 			void				FileSelect();
210cdf0e10cSrcweir 			void				FilterSelect();
211cdf0e10cSrcweir 
212cdf0e10cSrcweir 	void						SetBlackList( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList );
213cdf0e10cSrcweir 	const ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetBlackList() const;
214cdf0e10cSrcweir 	void						SetStandardDir( const String& rStdDir );
215cdf0e10cSrcweir 	const String&				GetStandardDir() const;
216cdf0e10cSrcweir 	SvStringsDtor*				GetPathList() const;		// bei MultiSelektion
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 			void				AddFilter( const String& rFilter,
219cdf0e10cSrcweir 										   const String& rType );
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 			void				AddFilterGroup(
222cdf0e10cSrcweir 				const String& _rFilter,
223cdf0e10cSrcweir 				const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters );
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 			void				SetCurFilter( const String& rFilter );
226cdf0e10cSrcweir 			String				GetCurFilter() const;
227cdf0e10cSrcweir 			sal_uInt16				GetFilterCount() const;
228cdf0e10cSrcweir 			const String&		GetFilterName( sal_uInt16 nPos ) const;
229cdf0e10cSrcweir 
230cdf0e10cSrcweir 	virtual	void				Resize();
231cdf0e10cSrcweir     virtual void				DataChanged( const DataChangedEvent& _rDCEvt );
232cdf0e10cSrcweir 
233cdf0e10cSrcweir 	void						PrevLevel_Impl();
234cdf0e10cSrcweir 	void						OpenURL_Impl( const String& rURL );
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	inline SvtFileView*			GetView() const;
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 	void						DisableSaveLastDirectory();
239cdf0e10cSrcweir 	void                        InitSize();
240cdf0e10cSrcweir 	void						UpdateControls( const String& rURL );
241cdf0e10cSrcweir     void                        EnableAutocompletion( sal_Bool _bEnable = sal_True );
242cdf0e10cSrcweir 
SetFileCallback(::svt::IFilePickerListener * pNotifier)243cdf0e10cSrcweir 	void						SetFileCallback( ::svt::IFilePickerListener *pNotifier ) { _pFileNotifier = pNotifier; }
244cdf0e10cSrcweir 
245cdf0e10cSrcweir     sal_Int32                   getTargetColorDepth();
246cdf0e10cSrcweir     sal_Int32                   getAvailableWidth();
247cdf0e10cSrcweir     sal_Int32                   getAvailableHeight();
248cdf0e10cSrcweir     void                        setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& rImage );
249cdf0e10cSrcweir     sal_Bool                    setShowState( sal_Bool bShowState );
250cdf0e10cSrcweir     sal_Bool                    getShowState();
251cdf0e10cSrcweir 	sal_Bool					isAutoExtensionEnabled();
252cdf0e10cSrcweir 
253cdf0e10cSrcweir 	String						getCurrentFileText( ) const;
254cdf0e10cSrcweir 	void						setCurrentFileText( const String& _rText, bool _bSelectAll = false );
255cdf0e10cSrcweir 
256cdf0e10cSrcweir     void                        onAsyncOperationStarted();
257cdf0e10cSrcweir     void                        onAsyncOperationFinished();
258cdf0e10cSrcweir 
259cdf0e10cSrcweir     void                        displayIOException( const String& _rURL, ::com::sun::star::ucb::IOErrorCode _eCode );
simulateAccessDenied(const String & _rURL)260cdf0e10cSrcweir     void                        simulateAccessDenied( const String& _rURL )
261cdf0e10cSrcweir     {
262cdf0e10cSrcweir         displayIOException( _rURL, ::com::sun::star::ucb::IOErrorCode_ACCESS_DENIED );
263cdf0e10cSrcweir     }
264cdf0e10cSrcweir 
265cdf0e10cSrcweir     // originally from VclFileDialog
266cdf0e10cSrcweir 	virtual sal_Bool				AddControl( Window* pControl, sal_Bool bNewLine = sal_False );
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 	// inline
269cdf0e10cSrcweir 	inline void					SetPath( const String& rNewURL );
270cdf0e10cSrcweir 	inline void                 SetHasFilename( bool bHasFilename );
271cdf0e10cSrcweir 	inline const String&		GetPath() const;
272cdf0e10cSrcweir 	inline void					SetDefaultExt( const String& rExt );
273cdf0e10cSrcweir 	inline void					EraseDefaultExt( xub_StrLen _nIndex = 0 );
274cdf0e10cSrcweir 	inline const String&		GetDefaultExt() const;
275cdf0e10cSrcweir 	inline void					SetOKHdl( const Link& rLink );
276cdf0e10cSrcweir 	inline const Link&			GetOKHdl() const;
277cdf0e10cSrcweir 	inline void					SetFileSelectHdl( const Link& rLink );
278cdf0e10cSrcweir 	inline const Link&			GetFileSelectHdl() const;
279cdf0e10cSrcweir 	inline void					SetFilterSelectHdl( const Link& rLink );
280cdf0e10cSrcweir 	inline const Link&			GetFilterSelectHdl() const;
281cdf0e10cSrcweir 
GetButtonImage(sal_uInt16 _nButtonId) const282cdf0e10cSrcweir 	inline Image				GetButtonImage( sal_uInt16 _nButtonId ) const { return m_aImages.GetImage( _nButtonId ); }
283cdf0e10cSrcweir 
ContentIsFolder(const rtl::OUString & rURL)284cdf0e10cSrcweir 	sal_Bool					ContentIsFolder( const rtl::OUString& rURL ) { return m_aContent.isFolder( rURL ) && m_aContent.isValid(); }
285cdf0e10cSrcweir 	sal_Bool					ContentHasParentFolder( const rtl::OUString& rURL );
286cdf0e10cSrcweir 	sal_Bool					ContentCanMakeFolder( const rtl::OUString& rURL );
287cdf0e10cSrcweir 	sal_Bool					ContentGetTitle( const rtl::OUString& rURL, String& rTitle );
288cdf0e10cSrcweir 
289cdf0e10cSrcweir     /** updates the sizes of the listboxes in the bottom area of the dialog, and of their labels,
290cdf0e10cSrcweir         according to the space occupied by the current label texts
291cdf0e10cSrcweir 
292cdf0e10cSrcweir         @since #i42824#
293cdf0e10cSrcweir     */
294cdf0e10cSrcweir     void                        updateListboxLabelSizes();
295cdf0e10cSrcweir 
296cdf0e10cSrcweir     /** checks URL access permissions
297cdf0e10cSrcweir 
298cdf0e10cSrcweir         <p>with the "restriction" feature we have in the file dialog, it's possible that
299cdf0e10cSrcweir         only certain URLs can be browsed. This method checks whether a given URL belongs
300cdf0e10cSrcweir         to this set of permitted URLs.</p>
301cdf0e10cSrcweir 
302cdf0e10cSrcweir         <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p>
303cdf0e10cSrcweir     */
isUrlAllowed(const String & _rURL) const304cdf0e10cSrcweir     inline bool isUrlAllowed( const String& _rURL ) const { return m_aURLFilter.isUrlAllowed( _rURL ); }
305cdf0e10cSrcweir 
306cdf0e10cSrcweir private:
307cdf0e10cSrcweir 	SvtFileDialogFilter_Impl*	implAddFilter( const String& _rFilter, const String& _rType );
308cdf0e10cSrcweir 
309cdf0e10cSrcweir 	/** updates _pUserFilter with a new filter
310cdf0e10cSrcweir 		<p>No checks for necessity are made.</p>
311cdf0e10cSrcweir 		@param _bAllowUserDefExt
312cdf0e10cSrcweir 			set to <TRUE/> if a filter like "*.txt" should reset the DefaultExtension to doc.
313cdf0e10cSrcweir 			<p>
314cdf0e10cSrcweir 			In a file-save-dialog this would have the following effect:<br/>
315cdf0e10cSrcweir 			Say that auto-extension is checked, and the user enters *.txt, while a non-txt filter is selected.<br/>
316cdf0e10cSrcweir 			If _bAllowUserDefExt is set to <TRUE/>, then a user input of "foo" would save a foo.txt, but in a format
317cdf0e10cSrcweir 			which is determined by the filter selected (which is no txt file as said above).<br/>
318cdf0e10cSrcweir 			If _bAllowUserDefExt is set to <FALSE/>, the default extension will be the one of the selected filter, means
319cdf0e10cSrcweir 			in the above scenario a file "foo.<ext>" will be saved where ext is the extension of the selected filter.
320cdf0e10cSrcweir 			</p>
321cdf0e10cSrcweir 		@return <TRUE/> if the new filter is "*.*"
322cdf0e10cSrcweir 	*/
323cdf0e10cSrcweir 	sal_Bool					createNewUserFilter( const String& _rNewFilter, sal_Bool _bAllowUserDefExt );
324cdf0e10cSrcweir 
325cdf0e10cSrcweir 	sal_uInt16					adjustFilter( const String& _rFilter );
326cdf0e10cSrcweir 
327cdf0e10cSrcweir 	// IFilePickerController, needed by OControlAccess
328cdf0e10cSrcweir     virtual Control*            getControl( sal_Int16 _nControlId, sal_Bool _bLabelControl = sal_False ) const;
329cdf0e10cSrcweir     virtual void                enableControl( sal_Int16 _nControlId, sal_Bool _bEnable );
330cdf0e10cSrcweir     virtual String              getCurFilter( ) const;
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 	String						implGetInitialURL( const String& _rPath, const String& _rFallback );
333cdf0e10cSrcweir 
334cdf0e10cSrcweir     /// initializes the special URL lists, such as our favourites and our restricted paths
335cdf0e10cSrcweir     void                        implInitializeSpecialURLLists( );
336cdf0e10cSrcweir 
337cdf0e10cSrcweir     /// executes a certain FileView action asynchronously
338cdf0e10cSrcweir     void                        executeAsync(
339cdf0e10cSrcweir                                     ::svt::AsyncPickerAction::Action _eAction,
340cdf0e10cSrcweir                                     const String& _rURL,
341cdf0e10cSrcweir                                     const String& _rFilter
342cdf0e10cSrcweir                                 );
343cdf0e10cSrcweir 
344cdf0e10cSrcweir     /** helper function to check and append the default filter extension if
345cdf0e10cSrcweir         necessary.
346cdf0e10cSrcweir         The function checks if the specified filename already contains one of
347cdf0e10cSrcweir         the valid extensions of the specified filter. If not the filter default
348cdf0e10cSrcweir         extension is appended to the filename.
349cdf0e10cSrcweir 
350cdf0e10cSrcweir 		@param _rFileName the filename which is checked and extended if necessary.
351cdf0e10cSrcweir 		@param _rFilterDefaultExtension the default extension of the used filter.
352cdf0e10cSrcweir 		@param _rFilterExtensions a list of one or more valid filter extensions
353cdf0e10cSrcweir                of the used filter.
354cdf0e10cSrcweir 
355cdf0e10cSrcweir      */
356cdf0e10cSrcweir     static void                 appendDefaultExtension(
357cdf0e10cSrcweir                                         String& _rFileName,
358cdf0e10cSrcweir                                         const String& _rFilterDefaultExtension,
359cdf0e10cSrcweir                                         const String& _rFilterExtensions);
360cdf0e10cSrcweir };
361cdf0e10cSrcweir 
362cdf0e10cSrcweir //***************************************************************************
363cdf0e10cSrcweir 
SetPath(const String & rNewURL)364cdf0e10cSrcweir inline void SvtFileDialog::SetPath( const String& rNewURL )
365cdf0e10cSrcweir {
366cdf0e10cSrcweir 	_aPath = rNewURL;
367cdf0e10cSrcweir }
368cdf0e10cSrcweir 
369cdf0e10cSrcweir //***************************************************************************
370cdf0e10cSrcweir 
SetHasFilename(bool bHasFilename)371cdf0e10cSrcweir inline void SvtFileDialog::SetHasFilename( bool bHasFilename )
372cdf0e10cSrcweir {
373cdf0e10cSrcweir 	m_bHasFilename = bHasFilename;
374cdf0e10cSrcweir }
375cdf0e10cSrcweir 
376cdf0e10cSrcweir //***************************************************************************
377cdf0e10cSrcweir 
GetPath() const378cdf0e10cSrcweir inline const String& SvtFileDialog::GetPath() const
379cdf0e10cSrcweir {
380cdf0e10cSrcweir 	return _aPath;
381cdf0e10cSrcweir }
382cdf0e10cSrcweir 
383cdf0e10cSrcweir //***************************************************************************
384cdf0e10cSrcweir 
SetDefaultExt(const String & rExt)385cdf0e10cSrcweir inline void SvtFileDialog::SetDefaultExt( const String& rExt )
386cdf0e10cSrcweir {
387cdf0e10cSrcweir 	_aDefExt = rExt;
388cdf0e10cSrcweir }
389cdf0e10cSrcweir 
EraseDefaultExt(xub_StrLen _nIndex)390cdf0e10cSrcweir inline void SvtFileDialog::EraseDefaultExt( xub_StrLen _nIndex )
391cdf0e10cSrcweir {
392cdf0e10cSrcweir 	_aDefExt.Erase( _nIndex );
393cdf0e10cSrcweir }
394cdf0e10cSrcweir 
GetDefaultExt() const395cdf0e10cSrcweir inline const String& SvtFileDialog::GetDefaultExt() const
396cdf0e10cSrcweir {
397cdf0e10cSrcweir 	return _aDefExt;
398cdf0e10cSrcweir }
399cdf0e10cSrcweir 
400cdf0e10cSrcweir //*****************************************************************************
401cdf0e10cSrcweir 
SetOKHdl(const Link & rLink)402cdf0e10cSrcweir inline void SvtFileDialog::SetOKHdl
403cdf0e10cSrcweir (
404cdf0e10cSrcweir 	const Link& rLink
405cdf0e10cSrcweir )
406cdf0e10cSrcweir {
407cdf0e10cSrcweir 	_aOKHdl = rLink;
408cdf0e10cSrcweir }
409cdf0e10cSrcweir 
410cdf0e10cSrcweir //*****************************************************************************
411cdf0e10cSrcweir 
GetOKHdl() const412cdf0e10cSrcweir inline const Link& SvtFileDialog::GetOKHdl() const
413cdf0e10cSrcweir {
414cdf0e10cSrcweir 	return _aOKHdl;
415cdf0e10cSrcweir }
416cdf0e10cSrcweir 
417cdf0e10cSrcweir //*****************************************************************************
418cdf0e10cSrcweir 
SetFileSelectHdl(const Link & rLink)419cdf0e10cSrcweir inline void SvtFileDialog::SetFileSelectHdl
420cdf0e10cSrcweir (
421cdf0e10cSrcweir 	const Link& rLink
422cdf0e10cSrcweir )
423cdf0e10cSrcweir {
424cdf0e10cSrcweir 	_aFileSelectHdl = rLink;
425cdf0e10cSrcweir }
426cdf0e10cSrcweir 
427cdf0e10cSrcweir //*****************************************************************************
428cdf0e10cSrcweir 
GetFileSelectHdl() const429cdf0e10cSrcweir inline const Link& SvtFileDialog::GetFileSelectHdl() const
430cdf0e10cSrcweir {
431cdf0e10cSrcweir 	return _aFileSelectHdl;
432cdf0e10cSrcweir }
433cdf0e10cSrcweir 
434cdf0e10cSrcweir //*****************************************************************************
435cdf0e10cSrcweir 
SetFilterSelectHdl(const Link & rLink)436cdf0e10cSrcweir inline void SvtFileDialog::SetFilterSelectHdl
437cdf0e10cSrcweir (
438cdf0e10cSrcweir 	const Link& rLink
439cdf0e10cSrcweir )
440cdf0e10cSrcweir {
441cdf0e10cSrcweir 	_aFilterSelectHdl = rLink;
442cdf0e10cSrcweir }
443cdf0e10cSrcweir 
444cdf0e10cSrcweir //*****************************************************************************
445cdf0e10cSrcweir 
GetFilterSelectHdl() const446cdf0e10cSrcweir inline const Link& SvtFileDialog::GetFilterSelectHdl() const
447cdf0e10cSrcweir {
448cdf0e10cSrcweir 	return _aFilterSelectHdl;
449cdf0e10cSrcweir }
450cdf0e10cSrcweir 
451cdf0e10cSrcweir //*****************************************************************************
452cdf0e10cSrcweir 
GetView() const453cdf0e10cSrcweir inline SvtFileView* SvtFileDialog::GetView() const
454cdf0e10cSrcweir {
455cdf0e10cSrcweir 	return _pFileView;
456cdf0e10cSrcweir }
457cdf0e10cSrcweir 
458cdf0e10cSrcweir //*****************************************************************************
459cdf0e10cSrcweir //*****************************************************************************
460cdf0e10cSrcweir //*****************************************************************************
461cdf0e10cSrcweir 
462cdf0e10cSrcweir class SvtFilePicker;
463cdf0e10cSrcweir 
464cdf0e10cSrcweir #define FILE_SELECTION_CHANGED	1
465cdf0e10cSrcweir #define DIRECTORY_CHANGED		2
466cdf0e10cSrcweir #define HELP_REQUESTED			3
467cdf0e10cSrcweir #define CTRL_STATE_CHANGED		4
468cdf0e10cSrcweir #define DIALOG_SIZE_CHANGED		5
469cdf0e10cSrcweir 
470cdf0e10cSrcweir 
471cdf0e10cSrcweir #endif // #ifndef _IODLG_HXX
472