diff options
-rw-r--r-- | include/toolkit/controls/tabpagemodel.hxx | 12 | ||||
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/controls/tabpagemodel.cxx | 101 | ||||
-rw-r--r-- | toolkit/source/helper/registerservices.cxx | 5 | ||||
-rw-r--r-- | toolkit/source/helper/servicenames.cxx | 2 | ||||
-rw-r--r-- | toolkit/util/tk.component | 6 |
6 files changed, 77 insertions, 53 deletions
diff --git a/include/toolkit/controls/tabpagemodel.hxx b/include/toolkit/controls/tabpagemodel.hxx index 966b7947854d..92c8d0519e76 100644 --- a/include/toolkit/controls/tabpagemodel.hxx +++ b/include/toolkit/controls/tabpagemodel.hxx @@ -50,8 +50,9 @@ public: throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException); // XServiceInfo - DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageModel, ControlModelContainerBase, szServiceName_UnoControlTabPageModel ) + OUString SAL_CALL getImplementationName() throw(css::uno::RuntimeException); + css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException); }; // ---------------------------------------------------- @@ -81,7 +82,14 @@ public: virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); // ::com::sun::star::lang::XServiceInfo - DECLIMPL_SERVICEINFO( UnoControlTabPage, szServiceName_UnoControlTabPage) + virtual OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException); + + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() + throw (css::uno::RuntimeException); }; #endif // INCLUDED_TOOLKIT_CONTROLS_TABPAGEMODEL_HXX diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 586af4a3cc79..5fc067916021 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -381,7 +381,7 @@ Reference< XInterface > ControlModelContainerBase::createInstance( const OUStrin pNewModel = new OGeometryControlModel< UnoControlTabPageContainerModel >( m_xContext ); else if ( aServiceSpecifier.equalsAscii( szServiceName_UnoMultiPageModel ) ) pNewModel = new OGeometryControlModel< UnoMultiPageModel >( m_xContext ); - else if ( aServiceSpecifier.equalsAscii( szServiceName_UnoControlTabPageModel ) ) + else if ( aServiceSpecifier == "com.sun.star.awt.tab.UnoControlTabPageModel" ) pNewModel = new OGeometryControlModel< UnoControlTabPageModel >( m_xContext ); else if ( aServiceSpecifier.equalsAscii( szServiceName_UnoPageModel ) ) pNewModel = new OGeometryControlModel< UnoPageModel >( m_xContext ); @@ -451,7 +451,7 @@ Sequence< OUString > ControlModelContainerBase::getAvailableServiceNames() throw pNames[20] = OUString::createFromAscii( szServiceName_TreeControlModel ); pNames[21] = OUString::createFromAscii( szServiceName_GridControlModel ); pNames[22] = OUString::createFromAscii( szServiceName_UnoControlTabPageContainerModel ); - pNames[23] = OUString::createFromAscii( szServiceName_UnoControlTabPageModel ); + pNames[23] = OUString( "com.sun.star.awt.tab.UnoControlTabPageModel" ); pNames[24] = OUString::createFromAscii( szServiceName_UnoMultiPageModel ); pNames[25] = OUString::createFromAscii( szServiceName_UnoFrameModel ); } diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index ec12abbc069c..6b925ab9dc3a 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -17,19 +17,18 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <toolkit/controls/tabpagemodel.hxx> #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <vcl/wall.hxx> -#include <toolkit/controls/tabpagemodel.hxx> #include <toolkit/helper/property.hxx> #include <toolkit/helper/unopropertyarrayhelper.hxx> #include <toolkit/controls/stdtabcontroller.hxx> -#include <com/sun/star/awt/PosSize.hpp> -#include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/UnoControlDialogModelProvider.hpp> -#include <com/sun/star/resource/XStringResourceResolver.hpp> -#include <com/sun/star/graphic/XGraphicProvider.hpp> +#include <com/sun/star/awt/tab/XTabPage.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> @@ -41,28 +40,15 @@ #include <vcl/graph.hxx> #include <vcl/image.hxx> #include <toolkit/controls/geometrycontrolmodel.hxx> - -#include <map> -#include <algorithm> -#include <functional> -#include "osl/file.hxx" - -#include <com/sun/star/beans/XPropertySet.hpp> +#include <toolkit/controls/controlmodelcontainerbase.hxx> +#include <toolkit/controls/unocontrolcontainer.hxx> +#include <cppuhelper/basemutex.hxx> +#include <cppuhelper/implbase2.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::util; - -////HELPER -OUString getPhysicalLocation( const ::com::sun::star::uno::Any& rbase, const ::com::sun::star::uno::Any& rUrl ); -// ---------------------------------------------------- -// class UnoControlTabPageModel -// ---------------------------------------------------- UnoControlTabPageModel::UnoControlTabPageModel( Reference< XComponentContext > const & i_factory ) :ControlModelContainerBase( i_factory ) { @@ -72,9 +58,22 @@ UnoControlTabPageModel::UnoControlTabPageModel( Reference< XComponentContext > c ImplRegisterProperty( BASEPROPERTY_HELPURL ); } +OUString SAL_CALL UnoControlTabPageModel::getImplementationName() throw(css::uno::RuntimeException) +{ + return OUString("stardiv.Toolkit.UnoControlTabPageModel"); +} + +css::uno::Sequence< OUString > SAL_CALL UnoControlTabPageModel::getSupportedServiceNames() throw(css::uno::RuntimeException) +{ + css::uno::Sequence< OUString > aNames = ControlModelContainerBase::getSupportedServiceNames( ); + aNames.realloc( aNames.getLength() + 1 ); + aNames[ aNames.getLength() - 1 ] = OUString("com.sun.star.awt.tab.UnoControlTabPageModel"); + return aNames; +} + OUString UnoControlTabPageModel::getServiceName( ) throw(RuntimeException) { - return OUString::createFromAscii( szServiceName_UnoControlTabPageModel ); + return OUString("com.sun.star.awt.tab.UnoControlTabPageModel"); } Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const @@ -84,7 +83,7 @@ Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const switch ( nPropId ) { case BASEPROPERTY_DEFAULTCONTROL: - aAny <<= OUString::createFromAscii( szServiceName_UnoControlTabPage ); + aAny <<= OUString("com.sun.star.awt.tab.UnoControlTabPage"); break; default: aAny = UnoControlModel::ImplGetDefaultValue( nPropId ); @@ -162,21 +161,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument else m_nTabPageId = -1; } -//===== Service =============================================================== -OUString UnoControlTabPageModel_getImplementationName (void) throw(RuntimeException) -{ - return OUString("com.sun.star.awt.tab.UnoControlTabPageModel"); -} -Sequence<OUString> SAL_CALL UnoControlTabPageModel_getSupportedServiceNames (void) - throw (RuntimeException) -{ - const OUString sServiceName("com.sun.star.awt.tab.UnoControlTabPageModel"); - return Sequence<OUString>(&sServiceName, 1); -} -//============================================================================= -// = class UnoControlTabPage -// ============================================================================ UnoControlTabPage::UnoControlTabPage( const uno::Reference< uno::XComponentContext >& rxContext ) :UnoControlTabPage_Base(rxContext) @@ -194,16 +179,36 @@ OUString UnoControlTabPage::GetComponentServiceName() return OUString("TabPageModel"); } +OUString SAL_CALL UnoControlTabPage::getImplementationName() + throw (css::uno::RuntimeException) +{ + return OUString("stardiv.Toolkit.UnoControlTabPage"); +} + +sal_Bool SAL_CALL UnoControlTabPage::supportsService(OUString const & ServiceName) + throw (css::uno::RuntimeException) +{ + return cppu::supportsService(this, ServiceName); +} + +css::uno::Sequence<OUString> SAL_CALL UnoControlTabPage::getSupportedServiceNames() + throw (css::uno::RuntimeException) +{ + css::uno::Sequence< OUString > aSeq(1); + aSeq[0] = OUString("com.sun.star.awt.tab.UnoControlTabPage"); + return aSeq; +} + void UnoControlTabPage::dispose() throw(RuntimeException) { SolarMutexGuard aSolarGuard; - EventObject aEvt; + lang::EventObject aEvt; aEvt.Source = static_cast< ::cppu::OWeakObject* >( this ); ControlContainerBase::dispose(); } -void SAL_CALL UnoControlTabPage::disposing( const EventObject& Source )throw(RuntimeException) +void SAL_CALL UnoControlTabPage::disposing( const lang::EventObject& Source )throw(RuntimeException) { ControlContainerBase::disposing( Source ); } @@ -309,4 +314,20 @@ throw (::com::sun::star::uno::RuntimeException) (void)e; } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +stardiv_Toolkit_UnoControlTabPageModel_get_implementation( + css::uno::XComponentContext *context, + css::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new UnoControlTabPageModel(context)); +} + +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL +stardiv_Toolkit_UnoControlTabPage_get_implementation( + css::uno::XComponentContext *context, + css::uno::Sequence<css::uno::Any> const &) +{ + return cppu::acquire(new UnoControlTabPage(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index 701a7aa114ed..e84f45de3405 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -41,7 +41,6 @@ #include <toolkit/controls/roadmapcontrol.hxx> #include <toolkit/controls/tkscrollbar.hxx> #include "toolkit/controls/tkspinbutton.hxx" -#include <toolkit/controls/tabpagemodel.hxx> #include <toolkit/controls/tabpagecontainer.hxx> #include "toolkit/dllapi.h" #include <com/sun/star/beans/XPropertySet.hpp> @@ -170,8 +169,6 @@ IMPL_CREATEINSTANCE( VCLXPopupMenu ) IMPL_CREATEINSTANCE( VCLXPrinterServer ) IMPL_CREATEINSTANCE( UnoRoadmapControl ) IMPL_CREATEINSTANCE_CTX( UnoControlRoadmapModel ) -IMPL_CREATEINSTANCE_CTX( UnoControlTabPage ) -IMPL_CREATEINSTANCE_CTX( UnoControlTabPageModel ) IMPL_CREATEINSTANCE_CTX( UnoControlTabPageContainer ) IMPL_CREATEINSTANCE_CTX( UnoControlTabPageContainerModel ) @@ -273,8 +270,6 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImple GET_FACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL ); GET_FACTORY_WITH_IMPL_PREFIX( GridColumn, "org.openoffice.comp.toolkit", szServiceName_GridColumn, NULL ); GET_FACTORY_WITH_IMPL_PREFIX( SortableGridDataModel, "org.openoffice.comp.toolkit", szServiceName_SortableGridDataModel, NULL ); - GET_FACTORY( UnoControlTabPageModel, szServiceName_UnoControlTabPageModel, NULL ) - GET_FACTORY( UnoControlTabPage, szServiceName_UnoControlTabPage, NULL ) GET_FACTORY( UnoControlTabPageContainerModel, szServiceName_UnoControlTabPageContainerModel, NULL ) GET_FACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL ) diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx index 50ca170b9816..3610daaf45bf 100644 --- a/toolkit/source/helper/servicenames.cxx +++ b/toolkit/source/helper/servicenames.cxx @@ -94,8 +94,6 @@ const sal_Char szServiceName_GridControlModel[] = "com.sun.star.awt.grid.UnoCont const sal_Char szServiceName_DefaultGridDataModel[] = "com.sun.star.awt.grid.DefaultGridDataModel"; const sal_Char szServiceName_DefaultGridColumnModel[] = "com.sun.star.awt.grid.DefaultGridColumnModel"; const sal_Char szServiceName_GridColumn[] = "com.sun.star.awt.grid.GridColumn"; -const sal_Char szServiceName_UnoControlTabPage[] = "com.sun.star.awt.tab.UnoControlTabPage"; -const sal_Char szServiceName_UnoControlTabPageModel[] = "com.sun.star.awt.tab.UnoControlTabPageModel"; const sal_Char szServiceName_UnoControlTabPageContainerModel[] = "com.sun.star.awt.tab.UnoControlTabPageContainerModel"; const sal_Char szServiceName_UnoControlTabPageContainer[] = "com.sun.star.awt.tab.UnoControlTabPageContainer"; const sal_Char szServiceName_SortableGridDataModel[] = "com.sun.star.awt.grid.SortableGridDataModel"; diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component index c8bdc30b1211..07de282fb56c 100644 --- a/toolkit/util/tk.component +++ b/toolkit/util/tk.component @@ -26,10 +26,12 @@ <service name="com.sun.star.awt.Layout"/> <service name="com.sun.star.comp.awt.Layout"/> </implementation> - <implementation name="stardiv.Toolkit.UnoControlTabPage"> + <implementation name="stardiv.Toolkit.UnoControlTabPage" + constructor="stardiv_Toolkit_UnoControlTabPage_get_implementation"> <service name="com.sun.star.awt.tab.UnoControlTabPage"/> </implementation> - <implementation name="stardiv.Toolkit.UnoControlTabPageModel"> + <implementation name="stardiv.Toolkit.UnoControlTabPageModel" + constructor="stardiv_Toolkit_UnoControlTabPageModel_get_implementation"> <service name="com.sun.star.awt.tab.UnoControlTabPageModel"/> </implementation> <implementation name="stardiv.Toolkit.UnoControlTabPageContainerModel"> |