diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-06-11 13:01:41 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-06-11 13:01:41 +0200 |
commit | b69a01a9b4c47f12bb31015a5080d5285a5c0cba (patch) | |
tree | c9379c2a89c27e7ce579699bcff8ecd823792c6b /toolkit | |
parent | 3a29a9cb361f803fd5f22732570729cca7c7743c (diff) |
unoawt: support XDialog2 for UNO dialogs
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/inc/toolkit/awt/vclxwindows.hxx | 8 | ||||
-rw-r--r-- | toolkit/inc/toolkit/controls/dialogcontrol.hxx | 8 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 26 | ||||
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 14 |
4 files changed, 47 insertions, 9 deletions
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx index 8efe01b526ba..ca3267bffb5e 100644 --- a/toolkit/inc/toolkit/awt/vclxwindows.hxx +++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx @@ -75,7 +75,7 @@ #include <com/sun/star/awt/XFixedHyperlink.hpp> #include <com/sun/star/awt/XFixedText.hpp> #include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/awt/XDialog.hpp> +#include <com/sun/star/awt/XDialog2.hpp> #include <com/sun/star/awt/XRadioButton.hpp> #include <com/sun/star/awt/XCurrencyField.hpp> #include <com/sun/star/awt/XPatternField.hpp> @@ -390,7 +390,7 @@ public: // ---------------------------------------------------- // class VCLXDialog // ---------------------------------------------------- -class VCLXDialog : public ::com::sun::star::awt::XDialog, +class VCLXDialog : public ::com::sun::star::awt::XDialog2, public VCLXTopWindow { public: @@ -406,6 +406,10 @@ public: ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog2 + virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException); ::rtl::OUString SAL_CALL getTitle( ) throw(::com::sun::star::uno::RuntimeException); diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx index b6a0e66b2430..0c5731d3f923 100644 --- a/toolkit/inc/toolkit/controls/dialogcontrol.hxx +++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx @@ -36,7 +36,7 @@ #include <com/sun/star/util/XChangesListener.hpp> #include <com/sun/star/util/XModifyListener.hpp> #include <com/sun/star/beans/XPropertyChangeListener.hpp> -#include <com/sun/star/awt/XDialog.hpp> +#include <com/sun/star/awt/XDialog2.hpp> #include <com/sun/star/resource/XStringResourceResolver.hpp> #include <cppuhelper/implbase6.hxx> #include <cppuhelper/implbase5.hxx> @@ -186,7 +186,7 @@ protected: // ---------------------------------------------------- typedef ::cppu::ImplHelper6 < ::com::sun::star::container::XContainerListener , ::com::sun::star::awt::XTopWindow - , ::com::sun::star::awt::XDialog + , ::com::sun::star::awt::XDialog2 , ::com::sun::star::util::XChangesListener , ::com::sun::star::util::XModifyListener , ::com::sun::star::awt::XWindowListener @@ -272,6 +272,10 @@ public: void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog2 + virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpId( ::sal_Int32 Id ) throw (::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XDialog void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException); ::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException); diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 5649ed4248dd..bff8dde75b0c 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2323,16 +2323,36 @@ VCLXDialog::~VCLXDialog() ::com::sun::star::uno::Any VCLXDialog::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, + SAL_STATIC_CAST( ::com::sun::star::awt::XDialog2*, this ), SAL_STATIC_CAST( ::com::sun::star::awt::XDialog*, this ) ); return (aRet.hasValue() ? aRet : VCLXTopWindow::queryInterface( rType )); } // ::com::sun::star::lang::XTypeProvider IMPL_XTYPEPROVIDER_START( VCLXDialog ) + getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDialog2>* ) NULL ), getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDialog>* ) NULL ), VCLXTopWindow::getTypes() IMPL_XTYPEPROVIDER_END +void SAL_CALL VCLXDialog::endDialog( ::sal_Int32 i_result ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + Dialog* pDialog = dynamic_cast< Dialog* >( GetWindow() ); + if ( pDialog ) + pDialog->EndDialog( i_result ); +} + +void SAL_CALL VCLXDialog::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException) +{ + ::vos::OGuard aGuard( GetMutex() ); + + Window* pWindow = GetWindow(); + if ( pWindow ) + pWindow->SetHelpId( i_id ); +} + void VCLXDialog::setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); @@ -2379,11 +2399,7 @@ sal_Int16 VCLXDialog::execute() throw(::com::sun::star::uno::RuntimeException) void VCLXDialog::endExecute() throw(::com::sun::star::uno::RuntimeException) { - ::vos::OGuard aGuard( GetMutex() ); - - Dialog* pDlg = (Dialog*) GetWindow(); - if ( pDlg ) - pDlg->EndDialog( 0 ); + endDialog(0); } void SAL_CALL VCLXDialog::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException) diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index cf1bff991430..7d845096321a 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -1975,6 +1975,20 @@ void UnoDialogControl::ImplUpdateResourceResolver() } } +void SAL_CALL UnoDialogControl::endDialog( ::sal_Int32 i_result ) throw (RuntimeException) +{ + Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); + if ( xPeerDialog.is() ) + xPeerDialog->endDialog( i_result ); +} + +void SAL_CALL UnoDialogControl::setHelpId( ::sal_Int32 i_id ) throw (RuntimeException) +{ + Reference< XDialog2 > xPeerDialog( getPeer(), UNO_QUERY ); + if ( xPeerDialog.is() ) + xPeerDialog->setHelpId( i_id ); +} + void UnoDialogControl::setTitle( const ::rtl::OUString& Title ) throw(RuntimeException) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); |