summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorTino Rachui <tra@openoffice.org>2001-10-09 07:07:04 +0000
committerTino Rachui <tra@openoffice.org>2001-10-09 07:07:04 +0000
commiteeb4978829230ba13eaa861b10773ba8faa61761 (patch)
treef8bec223f3fb23b6ebeed0f10342a2d41956cece /fpicker
parent9f340fc3209228cdeff4682a9ff2392d0f5f703f (diff)
#88924#now supporting com.sun.star.util.XCancellable
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/win32/folderpicker/FolderPicker.cxx15
-rw-r--r--fpicker/source/win32/folderpicker/FolderPicker.hxx23
-rw-r--r--fpicker/source/win32/folderpicker/MtaFop.cxx25
-rw-r--r--fpicker/source/win32/folderpicker/MtaFop.hxx11
4 files changed, 59 insertions, 15 deletions
diff --git a/fpicker/source/win32/folderpicker/FolderPicker.cxx b/fpicker/source/win32/folderpicker/FolderPicker.cxx
index fa4e8b812912..05ea431093b7 100644
--- a/fpicker/source/win32/folderpicker/FolderPicker.cxx
+++ b/fpicker/source/win32/folderpicker/FolderPicker.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FolderPicker.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: tra $ $Date: 2001-06-28 11:15:52 $
+ * last change: $Author: tra $ $Date: 2001-10-09 08:07:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -237,6 +237,17 @@ Sequence< OUString > SAL_CALL CFolderPicker::getSupportedServiceNames( )
return FolderPicker_getSupportedServiceNames();
}
+// -------------------------------------------------
+// XCancellable
+// -------------------------------------------------
+
+void SAL_CALL CFolderPicker::cancel( )
+{
+ OSL_ASSERT( m_pFolderPickerImpl.get( ) );
+ MutexGuard aGuard( m_aMutex );
+ m_pFolderPickerImpl->cancel( );
+}
+
//------------------------------------------------
// overwrite base class method, which is called
// by base class dispose function
diff --git a/fpicker/source/win32/folderpicker/FolderPicker.hxx b/fpicker/source/win32/folderpicker/FolderPicker.hxx
index d63ce8f1675b..2c2a9de6f69a 100644
--- a/fpicker/source/win32/folderpicker/FolderPicker.hxx
+++ b/fpicker/source/win32/folderpicker/FolderPicker.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FolderPicker.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: tra $ $Date: 2001-06-28 11:15:44 $
+ * last change: $Author: tra $ $Date: 2001-10-09 08:07:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
// includes of other projects
//---------------------------------------------------------
-#ifndef _CPPUHELPER_COMPBASE2_HXX_
-#include <cppuhelper/compbase2.hxx>
+#ifndef _CPPUHELPER_IMPLBASE3_HXX_
+#include <cppuhelper/implbase3.hxx>
#endif
#ifndef _OSL_MUTEX_HXX_
@@ -82,6 +82,10 @@
#include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
#endif
+#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_
+#include <com/sun/star/util/XCancellable.hpp>
+#endif
+
#include <memory>
#ifndef _FPIMPLBASE_HXX_
@@ -93,9 +97,10 @@
//----------------------------------------------------------
class CFolderPicker :
- public cppu::WeakImplHelper2<
+ public cppu::WeakImplHelper3<
com::sun::star::ui::dialogs::XFolderPicker,
- com::sun::star::lang::XServiceInfo >
+ com::sun::star::lang::XServiceInfo,
+ com::sun::star::util::XCancellable >
{
public:
@@ -142,6 +147,12 @@ public:
throw(::com::sun::star::uno::RuntimeException);
//------------------------------------------------
+ // XCancellable
+ //------------------------------------------------
+
+ virtual void SAL_CALL cancel( );
+
+ //------------------------------------------------
// overwrite base class method, which is called
// by base class dispose function
//------------------------------------------------
diff --git a/fpicker/source/win32/folderpicker/MtaFop.cxx b/fpicker/source/win32/folderpicker/MtaFop.cxx
index 74b46b9288bc..1766852b085a 100644
--- a/fpicker/source/win32/folderpicker/MtaFop.cxx
+++ b/fpicker/source/win32/folderpicker/MtaFop.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MtaFop.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: tra $ $Date: 2001-07-11 09:18:11 $
+ * last change: $Author: tra $ $Date: 2001-10-09 08:07:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -153,8 +153,7 @@ CMtaFolderPicker::CMtaFolderPicker( sal_uInt32 Flags ) :
m_hStaThread( NULL ),
m_uStaThreadId( 0 ),
m_hEvtThrdReady( NULL ),
- m_hwndStaRequestWnd( NULL ),
- m_hwndFolderPicker( NULL )
+ m_hwndStaRequestWnd( NULL )
{
m_hInstance = GetModuleHandleA( FOLDERPICKER_SRV_DLL_NAME );
OSL_ENSURE( m_hInstance, "The name of the FolderPicker service dll must have changed" );
@@ -401,6 +400,24 @@ OUString SAL_CALL CMtaFolderPicker::getTitle( )
return m_dialogTitle;
}
+//-----------------------------------------------------
+// XCancellable
+//-----------------------------------------------------
+
+void SAL_CALL CMtaFolderPicker::cancel( )
+{
+ if ( IsWindow( m_hwnd ) )
+ {
+ // simulate a mouse click to the
+ // cancel button
+ PostMessageA(
+ m_hwnd,
+ WM_COMMAND,
+ MAKEWPARAM( IDCANCEL, BN_CLICKED ),
+ (LPARAM)GetDlgItem( m_hwnd, IDCANCEL ) );
+ }
+}
+
//--------------------------------------------------------------------
//
//--------------------------------------------------------------------
diff --git a/fpicker/source/win32/folderpicker/MtaFop.hxx b/fpicker/source/win32/folderpicker/MtaFop.hxx
index 0a7051b7584a..dc1562d33122 100644
--- a/fpicker/source/win32/folderpicker/MtaFop.hxx
+++ b/fpicker/source/win32/folderpicker/MtaFop.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MtaFop.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: tra $ $Date: 2001-07-10 14:45:06 $
+ * last change: $Author: tra $ $Date: 2001-10-09 08:07:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -155,6 +155,12 @@ public:
virtual void SAL_CALL setTitle( const rtl::OUString& aTitle );
rtl::OUString SAL_CALL getTitle( );
+ //-----------------------------------------------------
+ // XCancellable
+ //-----------------------------------------------------
+
+ virtual void SAL_CALL cancel( );
+
protected:
void SAL_CALL enableOk( sal_Bool bEnable );
void SAL_CALL setSelection( const rtl::OUString& aDirectory );
@@ -200,7 +206,6 @@ private:
unsigned m_uStaThreadId;
HANDLE m_hEvtThrdReady;
HWND m_hwndStaRequestWnd;
- HWND m_hwndFolderPicker;
rtl::OUString m_dialogTitle;
rtl::OUString m_Description;
rtl::OUString m_displayDir;