xref: /AOO41X/main/fpicker/source/win32/folderpicker/FolderPicker.hxx (revision 10ce801889b00990ebdbcb412f4f91e2a9e6f21d)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _FOLDERPICKER_HXX_
25 #define _FOLDERPICKER_HXX_
26 
27 //---------------------------------------------------------
28 //  includes of other projects
29 //---------------------------------------------------------
30 
31 #include <cppuhelper/implbase3.hxx>
32 #include <osl/mutex.hxx>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 
35 #ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
36 #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
37 #endif
38 #include <com/sun/star/util/XCancellable.hpp>
39 
40 #include <memory>
41 
42 #ifndef _FPIMPLBASE_HXX_
43 #include "WinFOPImpl.hxx"
44 #endif
45 
46 //----------------------------------------------------------
47 // class declaration
48 //----------------------------------------------------------
49 
50 class CFolderPicker :
51     public  cppu::WeakImplHelper3<
52                 com::sun::star::ui::dialogs::XFolderPicker,
53                 com::sun::star::lang::XServiceInfo,
54                 com::sun::star::util::XCancellable >
55 {
56 public:
57 
58     // ctor/dtor
59     CFolderPicker( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
60 
61     //------------------------------------------------------------------------------------
62     // XExecutableDialog
63     //------------------------------------------------------------------------------------
64 
65     virtual void SAL_CALL setTitle( const rtl::OUString& aTitle )
66         throw( com::sun::star::uno::RuntimeException );
67 
68     virtual sal_Int16 SAL_CALL execute(  )
69         throw( com::sun::star::uno::RuntimeException );
70 
71     //------------------------------------------------------------------------------------
72     // XFolderPicker functions
73     //------------------------------------------------------------------------------------
74 
75     virtual void SAL_CALL setDisplayDirectory( const rtl::OUString& aDirectory )
76         throw( com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException );
77 
78     virtual rtl::OUString SAL_CALL getDisplayDirectory(  )
79         throw( com::sun::star::uno::RuntimeException );
80 
81     virtual rtl::OUString SAL_CALL getDirectory( )
82         throw( com::sun::star::uno::RuntimeException );
83 
84     virtual void SAL_CALL setDescription( const rtl::OUString& aDescription )
85         throw( com::sun::star::uno::RuntimeException );
86 
87     //------------------------------------------------
88     // XServiceInfo
89     //------------------------------------------------
90 
91     virtual ::rtl::OUString SAL_CALL getImplementationName(  )
92         throw(::com::sun::star::uno::RuntimeException);
93 
94     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
95         throw(::com::sun::star::uno::RuntimeException);
96 
97     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  )
98         throw(::com::sun::star::uno::RuntimeException);
99 
100     //------------------------------------------------
101     // XCancellable
102     //------------------------------------------------
103 
104     virtual void SAL_CALL cancel( )
105         throw(::com::sun::star::uno::RuntimeException);
106 
107     //------------------------------------------------
108     // overwrite base class method, which is called
109     // by base class dispose function
110     //------------------------------------------------
111 
112     virtual void SAL_CALL disposing();
113 
114 private:
115     com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr;
116     std::auto_ptr< CWinFolderPickerImpl >   m_pFolderPickerImpl;
117     osl::Mutex  m_aMutex;
118 
119 // prevent copy and assignment
120 private:
121     CFolderPicker( const CFolderPicker& );
122     CFolderPicker& operator=( const CFolderPicker&  );
123 };
124 
125 #endif
126