diff options
author | Tino Rachui <tra@openoffice.org> | 2001-10-09 05:57:38 +0000 |
---|---|---|
committer | Tino Rachui <tra@openoffice.org> | 2001-10-09 05:57:38 +0000 |
commit | fa853deebf9ed73052aae9fa91f35f54c5025633 (patch) | |
tree | 0d43da64fe74c2b64a8572cad40312f698707173 /fpicker | |
parent | 4fdfca2e8c3b788eae8c40ed8485f53a55d147dc (diff) |
#88924#service now implements the interface com.sun.star.util.XCancellable
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/win32/filepicker/FilePicker.cxx | 22 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/FilePicker.hxx | 21 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/WinFileOpenImpl.cxx | 22 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/WinFileOpenImpl.hxx | 10 |
4 files changed, 62 insertions, 13 deletions
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 2318e3e2c5dc..6e425e2540bb 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -2,9 +2,9 @@ * * $RCSfile: FilePicker.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: tra $ $Date: 2001-10-04 11:11:48 $ + * last change: $Author: tra $ $Date: 2001-10-09 06:57:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -97,6 +97,7 @@ using ::com::sun::star::lang::XServiceInfo; using ::com::sun::star::lang::DisposedException; using ::com::sun::star::lang::XInitialization; using ::com::sun::star::lang::EventObject; +using ::com::sun::star::util::XCancellable; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Exception; @@ -108,7 +109,7 @@ using ::com::sun::star::uno::Sequence; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::ui::dialogs::TemplateDescription; -using ::cppu::WeakComponentImplHelper7; +using ::cppu::WeakComponentImplHelper8; using ::rtl::OUString; using ::osl::MutexGuard; @@ -138,12 +139,13 @@ namespace //----------------------------------------------------------------------------------------- CFilePicker::CFilePicker( const Reference< XMultiServiceFactory >& xServiceMgr ) : - WeakComponentImplHelper7< + WeakComponentImplHelper8< XFilterManager, XFilePickerControlAccess, XFilePickerNotifier, XFilePreview, XInitialization, + XCancellable, XEventListener, XServiceInfo >( m_rbHelperMtx ) { @@ -747,6 +749,18 @@ void SAL_CALL CFilePicker::initialize( const Sequence< Any >& aArguments ) hInstance ) ); } +//------------------------------------------------------------------------------------ +// +//------------------------------------------------------------------------------------ + +void SAL_CALL CFilePicker::cancel( ) +{ + OSL_ASSERT( m_pImpl.get( ) ); + + MutexGuard aGuard( m_aMutex ); + m_pImpl->cancel( ); +} + // ------------------------------------------------- // XServiceInfo // ------------------------------------------------- diff --git a/fpicker/source/win32/filepicker/FilePicker.hxx b/fpicker/source/win32/filepicker/FilePicker.hxx index 6bd9ce6e05e2..f03161f9dfdd 100644 --- a/fpicker/source/win32/filepicker/FilePicker.hxx +++ b/fpicker/source/win32/filepicker/FilePicker.hxx @@ -2,9 +2,9 @@ * * $RCSfile: FilePicker.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tra $ $Date: 2001-07-02 08:09:14 $ + * last change: $Author: tra $ $Date: 2001-10-09 06:57:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,8 +67,8 @@ //_______________________________________________________________________________________________________________________ -#ifndef _CPPUHELPER_COMPBASE7_HXX_ -#include <cppuhelper/compbase7.hxx> +#ifndef _CPPUHELPER_COMPBASE8_HXX_ +#include <cppuhelper/compbase8.hxx> #endif #ifndef _OSL_MUTEX_HXX_ @@ -99,6 +99,10 @@ #include <com/sun/star/ui/dialogs/XFilePreview.hpp> #endif +#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_ +#include <com/sun/star/util/XCancellable.hpp> +#endif + #ifndef _WINFILEOPENIMPL_HXX_ #include "WinFileOpenImpl.hxx" #endif @@ -129,12 +133,13 @@ protected: class CFilePicker : public CFilePickerDummy, - public cppu::WeakComponentImplHelper7< + public cppu::WeakComponentImplHelper8< ::com::sun::star::ui::dialogs::XFilterManager, ::com::sun::star::ui::dialogs::XFilePickerControlAccess, ::com::sun::star::ui::dialogs::XFilePickerNotifier, ::com::sun::star::ui::dialogs::XFilePreview, ::com::sun::star::lang::XInitialization, + ::com::sun::star::util::XCancellable, ::com::sun::star::lang::XEventListener, ::com::sun::star::lang::XServiceInfo > { @@ -239,6 +244,12 @@ public: throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); //------------------------------------------------ + // XCancellable + //------------------------------------------------ + + virtual void SAL_CALL cancel( ); + + //------------------------------------------------ // XEventListener //------------------------------------------------ diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx index 589b1a45fc91..16672fa4c25c 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: WinFileOpenImpl.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: tra $ $Date: 2001-08-16 06:05:21 $ + * last change: $Author: tra $ $Date: 2001-10-09 06:57:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -534,6 +534,24 @@ sal_Bool SAL_CALL CWinFileOpenImpl::getShowState( ) } //----------------------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------------------- + +void SAL_CALL CWinFileOpenImpl::cancel( ) +{ + if ( IsWindow( m_hwndFileOpenDlg ) ) + { + // simulate a mouse click to the + // cancel button + PostMessageA( + m_hwndFileOpenDlg, + WM_COMMAND, + MAKEWPARAM( IDCANCEL, BN_CLICKED ), + (LPARAM)GetDlgItem( m_hwndFileOpenDlg, IDCANCEL ) ); + } +} + +//----------------------------------------------------------------------------------------- // returns the id of a custom template element //----------------------------------------------------------------------------------------- diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx index 0a17e64ad8f0..e00c76a7438d 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: WinFileOpenImpl.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: tra $ $Date: 2001-08-10 12:24:27 $ + * last change: $Author: tra $ $Date: 2001-10-09 06:57:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,6 +95,10 @@ #include <memory> #include <vector> +#ifndef _OSL_CONDITN_HXX_ +#include <osl/conditn.hxx> +#endif + //------------------------------------------------------------------------ // deklarations //------------------------------------------------------------------------ @@ -195,6 +199,8 @@ public: virtual sal_Bool SAL_CALL getShowState( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL cancel( ); + protected: sal_Int16 SAL_CALL getFocused( ); |