Update ooo320-m1
[ooovba.git] / fpicker / source / office / OfficeFolderPicker.hxx
bloba92736098caec8f2269edca2a552401800f022da
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: OfficeFolderPicker.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef INCLUDED_SVT_FOLDERPICKER_HXX
31 #define INCLUDED_SVT_FOLDERPICKER_HXX
33 #include <cppuhelper/implbase3.hxx>
34 #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
35 #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
38 #include <com/sun/star/lang/DisposedException.hpp>
39 #include <com/sun/star/uno/XComponentContext.hpp>
40 #include "commonpicker.hxx"
42 class Dialog;
44 // class SvtFolderPicker ---------------------------------------------------
46 typedef ::cppu::ImplHelper3 < ::com::sun::star::ui::dialogs::XFolderPicker
47 , ::com::sun::star::ui::dialogs::XAsynchronousExecutableDialog
48 , ::com::sun::star::lang::XServiceInfo
49 > SvtFolderPicker_Base;
51 class SvtFolderPicker :public SvtFolderPicker_Base
52 ,public ::svt::OCommonPicker
54 private:
55 ::rtl::OUString m_aDescription;
57 ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XDialogClosedListener >
58 m_xListener;
60 void prepareExecute( );
61 DECL_LINK( DialogClosedHdl, Dialog* );
63 public:
64 SvtFolderPicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
65 virtual ~SvtFolderPicker();
67 //------------------------------------------------------------------------------------
68 // disambiguate XInterface
69 //------------------------------------------------------------------------------------
70 DECLARE_XINTERFACE( )
72 //------------------------------------------------------------------------------------
73 // disambiguate XTypeProvider
74 //------------------------------------------------------------------------------------
75 DECLARE_XTYPEPROVIDER( )
77 //------------------------------------------------------------------------------------
78 // XFolderPicker functions
79 //------------------------------------------------------------------------------------
81 virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
82 virtual ::rtl::OUString SAL_CALL getDisplayDirectory() throw( ::com::sun::star::uno::RuntimeException );
83 virtual ::rtl::OUString SAL_CALL getDirectory() throw( ::com::sun::star::uno::RuntimeException );
84 virtual void SAL_CALL setDescription( const ::rtl::OUString& aDescription ) throw ( ::com::sun::star::uno::RuntimeException );
86 //------------------------------------------------------------------------------------
87 // XExecutableDialog functions
88 //------------------------------------------------------------------------------------
89 virtual void SAL_CALL setTitle( const ::rtl::OUString& _rTitle ) throw (::com::sun::star::uno::RuntimeException);
90 virtual sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException);
92 //------------------------------------------------------------------------------------
93 // XAsynchronousExecutableDialog functions
94 //------------------------------------------------------------------------------------
95 virtual void SAL_CALL setDialogTitle( const ::rtl::OUString& _rTitle ) throw (::com::sun::star::uno::RuntimeException);
96 virtual void SAL_CALL startExecuteModal( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XDialogClosedListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
98 //------------------------------------------------------------------------------------
99 // XServiceInfo functions
100 //------------------------------------------------------------------------------------
102 /* XServiceInfo */
103 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
104 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& sServiceName ) throw( ::com::sun::star::uno::RuntimeException );
105 virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
106 getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
108 /* Helper for XServiceInfo */
109 static com::sun::star::uno::Sequence< ::rtl::OUString > impl_getStaticSupportedServiceNames();
110 static ::rtl::OUString impl_getStaticImplementationName();
112 /* Helper for registry */
113 static ::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL impl_createInstance (
114 const ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext )
115 throw( com::sun::star::uno::Exception );
117 protected:
118 //------------------------------------------------------------------------------------
119 // OCommonPicker overridables
120 //------------------------------------------------------------------------------------
121 virtual SvtFileDialog* implCreateDialog( Window* _pParent );
122 virtual sal_Int16 implExecutePicker( );
125 #endif // INCLUDED_SVT_FOLDERPICKER_HXX