diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-23 17:28:44 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-23 23:39:13 +0100 |
commit | dec6d3e93503d805c74adc04b07758a8a44d74a6 (patch) | |
tree | f4cad18473fa3aab4cc341a5f9a90dea9b0d0af1 /toolkit | |
parent | 6dbff3aae9cb727fab74a3b2d8ebf7cb136ce215 (diff) |
tk: Constructor feature for OGeometryControlModel<UnoControlDialogModel>.
Change-Id: I9afc83610ccc06ea090a10588fb8240159715197
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 43 | ||||
-rw-r--r-- | toolkit/source/helper/registerservices.cxx | 9 | ||||
-rw-r--r-- | toolkit/util/tk.component | 3 |
3 files changed, 41 insertions, 14 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 8f32532dcea9..491ec62592f0 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -23,6 +23,7 @@ #include <vcl/wall.hxx> #include <osl/mutex.hxx> #include <toolkit/controls/dialogcontrol.hxx> +#include <toolkit/controls/geometrycontrolmodel.hxx> #include <toolkit/helper/property.hxx> #include <toolkit/helper/unopropertyarrayhelper.hxx> #include <toolkit/controls/stdtabcontroller.hxx> @@ -142,9 +143,32 @@ public: ////HELPER OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl ); -// ---------------------------------------------------- -// class UnoControlDialogModel -// ---------------------------------------------------- +namespace { + +class UnoControlDialogModel : public ControlModelContainerBase +{ +protected: + css::uno::Reference< css::graphic::XGraphicObject > mxGrfObj; + css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + // ::cppu::OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& rValue ) throw (css::uno::Exception); +public: + UnoControlDialogModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + UnoControlDialogModel( const UnoControlDialogModel& rModel ); + ~UnoControlDialogModel(); + + UnoControlModel* Clone() const; + // css::beans::XMultiPropertySet + css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException); + + // css::io::XPersistObject + OUString SAL_CALL getServiceName() throw(css::uno::RuntimeException); + + // XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, "com.sun.star.awt.UnoControlDialogModel" ) +}; + UnoControlDialogModel::UnoControlDialogModel( const Reference< XComponentContext >& rxContext ) :ControlModelContainerBase( rxContext ) { @@ -214,7 +238,7 @@ UnoControlModel* UnoControlDialogModel::Clone() const OUString UnoControlDialogModel::getServiceName( ) throw(RuntimeException) { - return OUString::createFromAscii( szServiceName_UnoControlDialogModel ); + return OUString("stardiv.vcl.controlmodel.Dialog"); } Any UnoControlDialogModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const @@ -274,6 +298,9 @@ void SAL_CALL UnoControlDialogModel::setFastPropertyValue_NoBroadcast( sal_Int32 OSL_ENSURE( sal_False, "UnoControlDialogModel::setFastPropertyValue_NoBroadcast: caught an exception while setting ImageURL properties!" ); } } + +} + // ============================================================================ // = class UnoDialogControl // ============================================================================ @@ -1202,4 +1229,12 @@ uno::Reference< beans::XPropertySetInfo > UnoFrameModel::getPropertySetInfo( ) return xInfo; } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +stardiv_Toolkit_UnoControlDialogModel_get_implementation( + css::uno::XComponentContext *context, + css::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new OGeometryControlModel<UnoControlDialogModel>(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index 933500d83781..b49c20a261dc 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -89,12 +89,6 @@ namespace toolkit ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \ { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( comphelper::getComponentContext(i_factory) ) ); } -#define IMPL_CREATE_INSTANCE_WITH_GEOMETRY( ImplName ) \ - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \ -{ \ - return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel< ImplName >( comphelper::getComponentContext( i_factory ) ) ); \ -} - #define GET_FACTORY_WITH_IMPL_PREFIX( ClassName, ImplNamePrefix, ServiceName1, ServiceName2 ) \ pRet = tryCreateFactory( sImplementationName, ImplNamePrefix "." #ClassName, \ ServiceName1, ServiceName2, \ @@ -169,8 +163,6 @@ IMPL_CREATEINSTANCE( VCLXPrinterServer ) IMPL_CREATEINSTANCE( UnoRoadmapControl ) IMPL_CREATEINSTANCE_CTX( UnoControlRoadmapModel ) -IMPL_CREATE_INSTANCE_WITH_GEOMETRY( UnoControlDialogModel ) - extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL MutableTreeDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); extern "C" @@ -194,7 +186,6 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImple GET_FACTORY( StdTabController, szServiceName_TabController, szServiceName2_TabController ) GET_FACTORY( StdTabControllerModel, szServiceName_TabControllerModel, szServiceName2_TabControllerModel ) GET_FACTORY( UnoDialogControl, szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog ) - GET_FACTORY( UnoControlDialogModel, szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel ) GET_FACTORY( UnoEditControl, szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit ) GET_FACTORY( UnoControlEditModel, szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel ) GET_FACTORY( UnoDateFieldControl, szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField ) diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component index 588e0f249387..291a1c09e8e5 100644 --- a/toolkit/util/tk.component +++ b/toolkit/util/tk.component @@ -126,7 +126,8 @@ <service name="com.sun.star.awt.UnoControlDateFieldModel"/> <service name="stardiv.vcl.controlmodel.DateField"/> </implementation> - <implementation name="stardiv.Toolkit.UnoControlDialogModel"> + <implementation name="stardiv.Toolkit.UnoControlDialogModel" + constructor="stardiv_Toolkit_UnoControlDialogModel_get_implementation"> <service name="com.sun.star.awt.UnoControlDialogModel"/> <service name="stardiv.vcl.controlmodel.Dialog"/> </implementation> |