From badc48eb755e2cd9eaa96c228987948a68de8a63 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Thu, 23 Jan 2014 13:50:23 +0100 Subject: tk: Constructor feature for UnoControlTabPage(Model). Change-Id: I7e6955c2d09e1860885f8e2eaa347332421c1c69 --- .../source/controls/controlmodelcontainerbase.cxx | 4 +- toolkit/source/controls/tabpagemodel.cxx | 101 +++++++++++++-------- toolkit/source/helper/registerservices.cxx | 5 - toolkit/source/helper/servicenames.cxx | 2 - toolkit/util/tk.component | 6 +- 5 files changed, 67 insertions(+), 51 deletions(-) (limited to 'toolkit') 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 #include #include #include -#include #include #include #include -#include -#include #include -#include -#include +#include +#include +#include #include #include #include @@ -41,28 +40,15 @@ #include #include #include - -#include -#include -#include -#include "osl/file.hxx" - -#include +#include +#include +#include +#include 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& rArgument else m_nTabPageId = -1; } -//===== Service =============================================================== -OUString UnoControlTabPageModel_getImplementationName (void) throw(RuntimeException) -{ - return OUString("com.sun.star.awt.tab.UnoControlTabPageModel"); -} -Sequence SAL_CALL UnoControlTabPageModel_getSupportedServiceNames (void) - throw (RuntimeException) -{ - const OUString sServiceName("com.sun.star.awt.tab.UnoControlTabPageModel"); - return Sequence(&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 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 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 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 #include #include "toolkit/controls/tkspinbutton.hxx" -#include #include #include "toolkit/dllapi.h" #include @@ -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 @@ - + - + -- cgit