1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _FOLDERPICKER_HXX_ 29 #define _FOLDERPICKER_HXX_ 30 31 //--------------------------------------------------------- 32 // includes of other projects 33 //--------------------------------------------------------- 34 35 #include <cppuhelper/implbase3.hxx> 36 #include <osl/mutex.hxx> 37 #include <com/sun/star/lang/XServiceInfo.hpp> 38 39 #ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_ 40 #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> 41 #endif 42 #include <com/sun/star/util/XCancellable.hpp> 43 44 #include <memory> 45 46 #ifndef _FPIMPLBASE_HXX_ 47 #include "WinFOPImpl.hxx" 48 #endif 49 50 //---------------------------------------------------------- 51 // class declaration 52 //---------------------------------------------------------- 53 54 class CFolderPicker : 55 public cppu::WeakImplHelper3< 56 com::sun::star::ui::dialogs::XFolderPicker, 57 com::sun::star::lang::XServiceInfo, 58 com::sun::star::util::XCancellable > 59 { 60 public: 61 62 // ctor/dtor 63 CFolderPicker( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& xServiceMgr ); 64 65 //------------------------------------------------------------------------------------ 66 // XExecutableDialog 67 //------------------------------------------------------------------------------------ 68 69 virtual void SAL_CALL setTitle( const rtl::OUString& aTitle ) 70 throw( com::sun::star::uno::RuntimeException ); 71 72 virtual sal_Int16 SAL_CALL execute( ) 73 throw( com::sun::star::uno::RuntimeException ); 74 75 //------------------------------------------------------------------------------------ 76 // XFolderPicker functions 77 //------------------------------------------------------------------------------------ 78 79 virtual void SAL_CALL setDisplayDirectory( const rtl::OUString& aDirectory ) 80 throw( com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException ); 81 82 virtual rtl::OUString SAL_CALL getDisplayDirectory( ) 83 throw( com::sun::star::uno::RuntimeException ); 84 85 virtual rtl::OUString SAL_CALL getDirectory( ) 86 throw( com::sun::star::uno::RuntimeException ); 87 88 virtual void SAL_CALL setDescription( const rtl::OUString& aDescription ) 89 throw( com::sun::star::uno::RuntimeException ); 90 91 //------------------------------------------------ 92 // XServiceInfo 93 //------------------------------------------------ 94 95 virtual ::rtl::OUString SAL_CALL getImplementationName( ) 96 throw(::com::sun::star::uno::RuntimeException); 97 98 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 99 throw(::com::sun::star::uno::RuntimeException); 100 101 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) 102 throw(::com::sun::star::uno::RuntimeException); 103 104 //------------------------------------------------ 105 // XCancellable 106 //------------------------------------------------ 107 108 virtual void SAL_CALL cancel( ) 109 throw(::com::sun::star::uno::RuntimeException); 110 111 //------------------------------------------------ 112 // overwrite base class method, which is called 113 // by base class dispose function 114 //------------------------------------------------ 115 116 virtual void SAL_CALL disposing(); 117 118 private: 119 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr; 120 std::auto_ptr< CWinFolderPickerImpl > m_pFolderPickerImpl; 121 osl::Mutex m_aMutex; 122 123 // prevent copy and assignment 124 private: 125 CFolderPicker( const CFolderPicker& ); 126 CFolderPicker& operator=( const CFolderPicker& ); 127 }; 128 129 #endif 130