diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-16 14:13:36 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 08:23:58 +0200 |
commit | 6c61b20a8d4a6dcac28801cde82a211fb7e30654 (patch) | |
tree | d82328eaa120b8bc822f028fa1e62bc7814c9e1b /include/toolkit/controls | |
parent | 6c53dff36ebdac7b6a6cf514ab469b2202d6aa48 (diff) |
fdo#46808, Convert awt::UnoControlDialogModel to new style
Change-Id: I4b912034ef3f4855b87d6d6f18ff13bd1ecc8f72
Diffstat (limited to 'include/toolkit/controls')
-rw-r--r-- | include/toolkit/controls/dialogcontrol.hxx | 157 |
1 files changed, 156 insertions, 1 deletions
diff --git a/include/toolkit/controls/dialogcontrol.hxx b/include/toolkit/controls/dialogcontrol.hxx index e8b95647c80f..73d1c62a520e 100644 --- a/include/toolkit/controls/dialogcontrol.hxx +++ b/include/toolkit/controls/dialogcontrol.hxx @@ -21,6 +21,7 @@ #define TOOLKIT_DIALOG_CONTROL_HXX #include <toolkit/controls/controlmodelcontainerbase.hxx> +#include <com/sun/star/awt/XUnoControlDialogModel.hpp> #include <com/sun/star/awt/XTopWindow.hpp> #include <com/sun/star/awt/XDialog2.hpp> #include <com/sun/star/awt/XSimpleTabController.hpp> @@ -30,6 +31,7 @@ #include "toolkit/helper/macros.hxx" #include <toolkit/controls/unocontrolcontainer.hxx> #include <cppuhelper/basemutex.hxx> +#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase3.hxx> #include <list> @@ -37,7 +39,10 @@ // class UnoControlDialogModel // ---------------------------------------------------- -class UnoControlDialogModel : public ControlModelContainerBase +typedef ::cppu::AggImplInheritanceHelper1 < ControlModelContainerBase + , ::com::sun::star::awt::XUnoControlDialogModel + > UnoControlDialogModel_Base; +class UnoControlDialogModel : public UnoControlDialogModel_Base { protected: ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj; @@ -45,6 +50,19 @@ protected: ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); // ::cppu::OPropertySetHelper void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + + OUString getPropertyString(const OUString& p1) throw(::com::sun::star::uno::RuntimeException); + sal_Bool getPropertyBool(const OUString& p1) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 getPropertyInt16(const OUString& p1) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 getPropertyInt32(const OUString& p1) throw(::com::sun::star::uno::RuntimeException); + void setPropertyString(const OUString& p1, const OUString& p2) throw(::com::sun::star::uno::RuntimeException) + { setPropertyValue( p1, css::uno::Any(p2) ); } + void setPropertyBool(const OUString& p1, sal_Bool p2) throw(::com::sun::star::uno::RuntimeException) + { setPropertyValue( p1, css::uno::Any(p2) ); } + void setPropertyInt16(const OUString& p1, sal_Int16 p2) throw(::com::sun::star::uno::RuntimeException) + { setPropertyValue( p1, css::uno::Any(p2) ); } + void setPropertyInt32(const OUString& p1, sal_Int32 p2) throw(::com::sun::star::uno::RuntimeException) + { setPropertyValue( p1, css::uno::Any(p2) ); } public: UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); UnoControlDialogModel( const UnoControlDialogModel& rModel ); @@ -60,6 +78,143 @@ public: // XServiceInfo DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel ) + + // XUnoControlDialogModel attributes + virtual rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyString("Name"); } + virtual void SAL_CALL setName(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyString("Name", p1); } + virtual sal_Bool SAL_CALL getDecoration() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyBool("Decoration"); } + virtual void SAL_CALL setDecoration(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyBool("Decoration", p1); } + virtual sal_Int32 SAL_CALL getPositionX() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt32("PositionX"); } + virtual void SAL_CALL setPositionX(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt32("PositionX", p1); } + virtual sal_Int32 SAL_CALL getPositionY() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt32("PositionY"); } + virtual void SAL_CALL setPositionY(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt32("PositionY", p1); } + virtual sal_Int32 SAL_CALL getWidth() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt32("Width"); } + virtual void SAL_CALL setWidth(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt32("Width", p1); } + virtual sal_Int32 SAL_CALL getHeight() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt32("Height"); } + virtual void SAL_CALL setHeight(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt32("Height", p1); } + virtual rtl::OUString SAL_CALL getDialogSourceURL() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyString("DialogSourceURL"); } + virtual void SAL_CALL setDialogSourceURL(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyString("DialogSourceURL", p1); } + virtual rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyString("Title"); } + virtual void SAL_CALL setTitle(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyString("Title", p1); } + virtual sal_Bool SAL_CALL getCloseable() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyBool("Closeable"); } + virtual void SAL_CALL setCloseable(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyBool("Closeable", p1); } + virtual sal_Bool SAL_CALL getEnabled() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyBool("Enabled"); } + virtual void SAL_CALL setEnabled(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyBool("Enabled", p1); } + virtual sal_Bool SAL_CALL getMoveable() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyBool("Moveable"); } + virtual void SAL_CALL setMoveable(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyBool("Moveable", p1); } + virtual sal_Bool SAL_CALL getSizeable() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyBool("Sizeable"); } + virtual void SAL_CALL setSizeable(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyBool("Sizeable", p1); } + virtual sal_Bool SAL_CALL getDesktopAsParent() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyBool("DesktopAsParent"); } + virtual void SAL_CALL setDesktopAsParent(sal_Bool p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyBool("DesktopAsParent", p1); } + virtual rtl::OUString SAL_CALL getHelpURL() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyString("HelpURL"); } + virtual void SAL_CALL setHelpURL(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyString("HelpURL", p1); } + virtual sal_Int32 SAL_CALL getBackgroundColor() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt32("BackgroundColor"); } + virtual void SAL_CALL setBackgroundColor(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt32("BackgroundColor", p1); } + virtual sal_Int16 SAL_CALL getFontEmphasisMark() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt16("FontEmphasisMark"); } + virtual void SAL_CALL setFontEmphasisMark(sal_Int16 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt16("FontEmphasisMark", p1); } + virtual sal_Int16 SAL_CALL getFontRelief() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt16("FontRelief"); } + virtual void SAL_CALL setFontRelief(sal_Int16 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt16("FontRelief", p1); } + virtual rtl::OUString SAL_CALL getHelpText() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyString("HelpText"); } + virtual void SAL_CALL setHelpText(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyString("HelpText", p1); } + virtual sal_Int32 SAL_CALL getTextColor() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt32("TextColor"); } + virtual void SAL_CALL setTextColor(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt32("TextColor", p1); } + virtual sal_Int32 SAL_CALL getTextLineColor() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyInt32("TextLineColor"); } + virtual void SAL_CALL setTextLineColor(sal_Int32 p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyInt32("TextLineColor", p1); } + virtual rtl::OUString SAL_CALL getImageURL() throw(::com::sun::star::uno::RuntimeException) + { return getPropertyString("ImageURL"); } + virtual void SAL_CALL setImageURL(const rtl::OUString& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyString("ImageURL", p1); } + virtual com::sun::star::uno::Reference<com::sun::star::resource::XStringResourceManager> SAL_CALL getResourceResolver() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setResourceResolver(const com::sun::star::uno::Reference<com::sun::star::resource::XStringResourceManager>& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyValue( "ResourceResolver", css::uno::Any(p1) ); } + virtual com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFontDescriptor(const com::sun::star::awt::FontDescriptor& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyValue( "FontDescriptor", css::uno::Any(p1) ); } + virtual com::sun::star::uno::Reference<com::sun::star::graphic::XGraphic> SAL_CALL getGraphic() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGraphic(const com::sun::star::uno::Reference<com::sun::star::graphic::XGraphic>& p1) throw(::com::sun::star::uno::RuntimeException) + { setPropertyValue( "Graphic", css::uno::Any(p1) ); } + + + // overrides to resolve ambiguity + virtual com::sun::star::uno::Any SAL_CALL getPropertyValue(const rtl::OUString& p1) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::getPropertyValue(p1); } + virtual void SAL_CALL setPropertyValue(const OUString& p1, const com::sun::star::uno::Any& p2) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::setPropertyValue(p1, p2); } + virtual void SAL_CALL addPropertyChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener>& p2) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::addPropertyChangeListener(p1, p2); } + virtual void SAL_CALL removePropertyChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener>& p2) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::removePropertyChangeListener(p1, p2); } + virtual void SAL_CALL addVetoableChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XVetoableChangeListener>& p2) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::addVetoableChangeListener(p1, p2); } + virtual void SAL_CALL removeVetoableChangeListener(const OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XVetoableChangeListener>& p2) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::removeVetoableChangeListener(p1, p2); } + virtual com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createInstance(const OUString& p1) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::createInstance(p1); } + virtual com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createInstanceWithArguments(const OUString& p1, const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& p2) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::createInstanceWithArguments(p1, p2); } + virtual com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::getAvailableServiceNames(); } + + + virtual com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::getElementType(); } + virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::hasElements(); } + virtual com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& p1) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::getByName(p1); } + virtual com::sun::star::uno::Sequence<rtl::OUString> SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::getElementNames(); } + virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& p1) throw (::com::sun::star::uno::RuntimeException) + { return UnoControlDialogModel_Base::ControlModelContainerBase::hasByName(p1); } + virtual void SAL_CALL replaceByName(const rtl::OUString& p1, const com::sun::star::uno::Any& p2) throw (::com::sun::star::uno::RuntimeException) + { UnoControlDialogModel_Base::ControlModelContainerBase::replaceByName(p1, p2); } + virtual void SAL_CALL insertByName(const rtl::OUString& p1, const com::sun::star::uno::Any& p2) throw (::com::sun::star::uno::RuntimeException) + { UnoControlDialogModel_Base::ControlModelContainerBase::insertByName(p1, p2); } + virtual void SAL_CALL removeByName(const rtl::OUString& p1) throw (::com::sun::star::uno::RuntimeException) + { UnoControlDialogModel_Base::ControlModelContainerBase::removeByName(p1); } + + + }; typedef ::cppu::AggImplInheritanceHelper3 < ControlContainerBase |