fwk: Constructor feature for single-instance UIControllerFactories.
Change-Id: I0867404f7e4aa7b9caafe4f0568bd2c20190867f
This commit is contained in:
parent
af1c0ef8d3
commit
43b84c9662
@ -1,101 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
||||||
/*
|
|
||||||
* This file is part of the LibreOffice project.
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*
|
|
||||||
* This file incorporates work covered by the following license notice:
|
|
||||||
*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
||||||
* contributor license agreements. See the NOTICE file distributed
|
|
||||||
* with this work for additional information regarding copyright
|
|
||||||
* ownership. The ASF licenses this file to you under the Apache
|
|
||||||
* License, Version 2.0 (the "License"); you may not use this file
|
|
||||||
* except in compliance with the License. You may obtain a copy of
|
|
||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef INCLUDED_FRAMEWORK_INC_UIFACTORY_UICONTROLLERFACTORY_HXX
|
|
||||||
#define INCLUDED_FRAMEWORK_INC_UIFACTORY_UICONTROLLERFACTORY_HXX
|
|
||||||
|
|
||||||
#include <threadhelp/threadhelpbase.hxx>
|
|
||||||
#include <macros/generic.hxx>
|
|
||||||
#include <macros/xinterface.hxx>
|
|
||||||
#include <macros/xtypeprovider.hxx>
|
|
||||||
#include <macros/xserviceinfo.hxx>
|
|
||||||
#include <stdtypes.h>
|
|
||||||
|
|
||||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
||||||
#include <com/sun/star/lang/XTypeProvider.hpp>
|
|
||||||
#include <com/sun/star/frame/XUIControllerFactory.hpp>
|
|
||||||
|
|
||||||
#include <cppuhelper/implbase2.hxx>
|
|
||||||
|
|
||||||
namespace framework
|
|
||||||
{
|
|
||||||
|
|
||||||
class ConfigurationAccess_ControllerFactory;
|
|
||||||
class UIControllerFactory : protected ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
|
|
||||||
public ::cppu::WeakImplHelper2<
|
|
||||||
com::sun::star::lang::XServiceInfo,
|
|
||||||
com::sun::star::frame::XUIControllerFactory >
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~UIControllerFactory();
|
|
||||||
|
|
||||||
// XServiceInfo
|
|
||||||
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) = 0;
|
|
||||||
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException) = 0;
|
|
||||||
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) = 0;
|
|
||||||
|
|
||||||
// XMultiComponentFactory
|
|
||||||
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithContext( const OUString& aServiceSpecifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
|
||||||
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
|
|
||||||
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
|
|
||||||
// XUIControllerRegistration
|
|
||||||
virtual sal_Bool SAL_CALL hasController( const OUString& aCommandURL, const OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
virtual void SAL_CALL registerController( const OUString& aCommandURL, const OUString& aModuleName, const OUString& aControllerImplementationName ) throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
virtual void SAL_CALL deregisterController( const OUString& aCommandURL, const OUString& aModuleName ) throw (::com::sun::star::uno::RuntimeException);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
UIControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, const rtl::OUString &rUINode );
|
|
||||||
sal_Bool m_bConfigRead;
|
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
|
||||||
ConfigurationAccess_ControllerFactory* m_pConfigAccess;
|
|
||||||
};
|
|
||||||
|
|
||||||
class PopupMenuControllerFactory : public UIControllerFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
PopupMenuControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
|
|
||||||
|
|
||||||
// XInterface, XTypeProvider, XServiceInfo
|
|
||||||
DECLARE_XSERVICEINFO
|
|
||||||
};
|
|
||||||
|
|
||||||
class ToolbarControllerFactory : public UIControllerFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ToolbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
|
|
||||||
|
|
||||||
// XInterface, XTypeProvider, XServiceInfo
|
|
||||||
DECLARE_XSERVICEINFO
|
|
||||||
};
|
|
||||||
|
|
||||||
class StatusbarControllerFactory : public UIControllerFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
StatusbarControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
|
|
||||||
|
|
||||||
// XInterface, XTypeProvider, XServiceInfo
|
|
||||||
DECLARE_XSERVICEINFO
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // INCLUDED_FRAMEWORK_INC_UIFACTORY_UICONTROLLERFACTORY_HXX
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
|
@ -35,7 +35,6 @@
|
|||||||
=================================================================================================================*/
|
=================================================================================================================*/
|
||||||
#include <services/desktop.hxx>
|
#include <services/desktop.hxx>
|
||||||
#include <uifactory/uielementfactorymanager.hxx>
|
#include <uifactory/uielementfactorymanager.hxx>
|
||||||
#include <uifactory/uicontrollerfactory.hxx>
|
|
||||||
#include <uiconfiguration/moduleuicfgsupplier.hxx>
|
#include <uiconfiguration/moduleuicfgsupplier.hxx>
|
||||||
#include <uifactory/menubarfactory.hxx>
|
#include <uifactory/menubarfactory.hxx>
|
||||||
#include <uifactory/toolboxfactory.hxx>
|
#include <uifactory/toolboxfactory.hxx>
|
||||||
@ -51,15 +50,12 @@
|
|||||||
COMPONENTGETFACTORY ( fwk,
|
COMPONENTGETFACTORY ( fwk,
|
||||||
IFFACTORY( ::framework::Desktop ) else
|
IFFACTORY( ::framework::Desktop ) else
|
||||||
IFFACTORY( ::framework::UIElementFactoryManager ) else
|
IFFACTORY( ::framework::UIElementFactoryManager ) else
|
||||||
IFFACTORY( ::framework::PopupMenuControllerFactory ) else
|
|
||||||
IFFACTORY( ::framework::ModuleUIConfigurationManagerSupplier ) else
|
IFFACTORY( ::framework::ModuleUIConfigurationManagerSupplier ) else
|
||||||
IFFACTORY( ::framework::MenuBarFactory ) else
|
IFFACTORY( ::framework::MenuBarFactory ) else
|
||||||
IFFACTORY( ::framework::ToolBoxFactory ) else
|
IFFACTORY( ::framework::ToolBoxFactory ) else
|
||||||
IFFACTORY( ::framework::WindowStateConfiguration ) else
|
IFFACTORY( ::framework::WindowStateConfiguration ) else
|
||||||
IFFACTORY( ::framework::ToolbarControllerFactory ) else
|
|
||||||
IFFACTORY( ::framework::StatusBarFactory ) else
|
IFFACTORY( ::framework::StatusBarFactory ) else
|
||||||
IFFACTORY( ::framework::SessionListener ) else
|
IFFACTORY( ::framework::SessionListener ) else
|
||||||
IFFACTORY( ::framework::StatusbarControllerFactory ) else
|
|
||||||
IFFACTORY( ::framework::SessionListener ) else
|
IFFACTORY( ::framework::SessionListener ) else
|
||||||
IFFACTORY( ::framework::TaskCreatorService ) else
|
IFFACTORY( ::framework::TaskCreatorService ) else
|
||||||
IFFACTORY( ::framework::WindowContentFactoryManager ) else
|
IFFACTORY( ::framework::WindowContentFactoryManager ) else
|
||||||
|
@ -17,50 +17,88 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <uifactory/uicontrollerfactory.hxx>
|
|
||||||
#include <uifactory/factoryconfiguration.hxx>
|
#include <uifactory/factoryconfiguration.hxx>
|
||||||
#include <threadhelp/resetableguard.hxx>
|
|
||||||
#include "services.h"
|
|
||||||
|
|
||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
||||||
#include <com/sun/star/container/XNameAccess.hpp>
|
|
||||||
#include <com/sun/star/container/XNameContainer.hpp>
|
|
||||||
#include <com/sun/star/container/XContainer.hpp>
|
#include <com/sun/star/container/XContainer.hpp>
|
||||||
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||||
|
#include <com/sun/star/frame/XUIControllerFactory.hpp>
|
||||||
|
|
||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
#include <cppuhelper/weak.hxx>
|
#include <cppuhelper/compbase2.hxx>
|
||||||
|
#include <cppuhelper/supportsservice.hxx>
|
||||||
|
|
||||||
using namespace com::sun::star::uno;
|
using namespace css::uno;
|
||||||
using namespace com::sun::star::lang;
|
using namespace css::lang;
|
||||||
using namespace com::sun::star::beans;
|
using namespace css::beans;
|
||||||
using namespace com::sun::star::container;
|
using namespace css::container;
|
||||||
using namespace ::com::sun::star::frame;
|
using namespace css::frame;
|
||||||
|
using namespace framework;
|
||||||
|
|
||||||
namespace framework
|
namespace {
|
||||||
|
|
||||||
|
typedef ::cppu::WeakComponentImplHelper2<
|
||||||
|
css::lang::XServiceInfo,
|
||||||
|
css::frame::XUIControllerFactory > UIControllerFactory_BASE;
|
||||||
|
|
||||||
|
class UIControllerFactory : private osl::Mutex,
|
||||||
|
public UIControllerFactory_BASE
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
virtual ~UIControllerFactory();
|
||||||
|
|
||||||
|
// XServiceInfo
|
||||||
|
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) = 0;
|
||||||
|
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (css::uno::RuntimeException) = 0;
|
||||||
|
virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException) = 0;
|
||||||
|
|
||||||
|
// XMultiComponentFactory
|
||||||
|
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithContext( const OUString& aServiceSpecifier, const css::uno::Reference< css::uno::XComponentContext >& Context ) throw (css::uno::Exception, css::uno::RuntimeException);
|
||||||
|
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArgumentsAndContext( const OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments, const css::uno::Reference< css::uno::XComponentContext >& Context ) throw (css::uno::Exception, css::uno::RuntimeException);
|
||||||
|
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() throw (css::uno::RuntimeException);
|
||||||
|
|
||||||
|
// XUIControllerRegistration
|
||||||
|
virtual sal_Bool SAL_CALL hasController( const OUString& aCommandURL, const OUString& aModuleName ) throw (css::uno::RuntimeException);
|
||||||
|
virtual void SAL_CALL registerController( const OUString& aCommandURL, const OUString& aModuleName, const OUString& aControllerImplementationName ) throw (css::uno::RuntimeException);
|
||||||
|
virtual void SAL_CALL deregisterController( const OUString& aCommandURL, const OUString& aModuleName ) throw (css::uno::RuntimeException);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
UIControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, const rtl::OUString &rUINode );
|
||||||
|
sal_Bool m_bConfigRead;
|
||||||
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||||
|
ConfigurationAccess_ControllerFactory* m_pConfigAccess;
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual void SAL_CALL disposing() SAL_OVERRIDE;
|
||||||
|
};
|
||||||
|
|
||||||
UIControllerFactory::UIControllerFactory(
|
UIControllerFactory::UIControllerFactory(
|
||||||
const Reference< XComponentContext >& xContext,
|
const Reference< XComponentContext >& xContext,
|
||||||
const rtl::OUString &rConfigurationNode )
|
const rtl::OUString &rConfigurationNode )
|
||||||
: ThreadHelpBase()
|
: UIControllerFactory_BASE(*static_cast<osl::Mutex *>(this))
|
||||||
, m_bConfigRead( sal_False )
|
, m_bConfigRead( sal_False )
|
||||||
, m_xContext( xContext )
|
, m_xContext( xContext )
|
||||||
, m_pConfigAccess()
|
, m_pConfigAccess()
|
||||||
{
|
{
|
||||||
rtl::OUStringBuffer aBuffer;
|
m_pConfigAccess = new ConfigurationAccess_ControllerFactory(m_xContext,
|
||||||
aBuffer.append( "/org.openoffice.Office.UI.Controller/Registered/" );
|
"/org.openoffice.Office.UI.Controller/Registered/" + rConfigurationNode);
|
||||||
aBuffer.append( rConfigurationNode );
|
|
||||||
m_pConfigAccess = new ConfigurationAccess_ControllerFactory( m_xContext, aBuffer.makeStringAndClear() );
|
|
||||||
m_pConfigAccess->acquire();
|
m_pConfigAccess->acquire();
|
||||||
}
|
}
|
||||||
|
|
||||||
UIControllerFactory::~UIControllerFactory()
|
UIControllerFactory::~UIControllerFactory()
|
||||||
{
|
{
|
||||||
ResetableGuard aLock( m_aLock );
|
disposing();
|
||||||
|
}
|
||||||
|
|
||||||
// reduce reference count
|
void SAL_CALL UIControllerFactory::disposing()
|
||||||
m_pConfigAccess->release();
|
{
|
||||||
|
osl::MutexGuard g(rBHelper.rMutex);
|
||||||
|
if (m_pConfigAccess)
|
||||||
|
{
|
||||||
|
// reduce reference count
|
||||||
|
m_pConfigAccess->release();
|
||||||
|
m_pConfigAccess = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// XMultiComponentFactory
|
// XMultiComponentFactory
|
||||||
@ -70,7 +108,7 @@ Reference< XInterface > SAL_CALL UIControllerFactory::createInstanceWithContext(
|
|||||||
throw (Exception, RuntimeException)
|
throw (Exception, RuntimeException)
|
||||||
{
|
{
|
||||||
// SAFE
|
// SAFE
|
||||||
ResetableGuard aLock( m_aLock );
|
osl::MutexGuard g(rBHelper.rMutex);
|
||||||
|
|
||||||
if ( !m_bConfigRead )
|
if ( !m_bConfigRead )
|
||||||
{
|
{
|
||||||
@ -133,8 +171,9 @@ throw (Exception, RuntimeException)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// SAFE
|
OUString aServiceName;
|
||||||
ResetableGuard aLock( m_aLock );
|
{ // SAFE
|
||||||
|
osl::MutexGuard g(rBHelper.rMutex);
|
||||||
|
|
||||||
if ( !m_bConfigRead )
|
if ( !m_bConfigRead )
|
||||||
{
|
{
|
||||||
@ -142,14 +181,11 @@ throw (Exception, RuntimeException)
|
|||||||
m_pConfigAccess->readConfigurationData();
|
m_pConfigAccess->readConfigurationData();
|
||||||
}
|
}
|
||||||
|
|
||||||
OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( ServiceSpecifier, aPropName );
|
aServiceName = m_pConfigAccess->getServiceFromCommandModule( ServiceSpecifier, aPropName );
|
||||||
Reference< XComponentContext > xContext( m_xContext );
|
} // SAFE
|
||||||
|
|
||||||
aLock.unlock();
|
|
||||||
// SAFE
|
|
||||||
|
|
||||||
if ( !aServiceName.isEmpty() )
|
if ( !aServiceName.isEmpty() )
|
||||||
return xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aServiceName, aNewArgs, xContext );
|
return m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aServiceName, aNewArgs, m_xContext );
|
||||||
else
|
else
|
||||||
return Reference< XInterface >();
|
return Reference< XInterface >();
|
||||||
}
|
}
|
||||||
@ -165,9 +201,9 @@ throw (RuntimeException)
|
|||||||
sal_Bool SAL_CALL UIControllerFactory::hasController(
|
sal_Bool SAL_CALL UIControllerFactory::hasController(
|
||||||
const OUString& aCommandURL,
|
const OUString& aCommandURL,
|
||||||
const OUString& aModuleName )
|
const OUString& aModuleName )
|
||||||
throw (::com::sun::star::uno::RuntimeException)
|
throw (css::uno::RuntimeException)
|
||||||
{
|
{
|
||||||
ResetableGuard aLock( m_aLock );
|
osl::MutexGuard g(rBHelper.rMutex);
|
||||||
|
|
||||||
if ( !m_bConfigRead )
|
if ( !m_bConfigRead )
|
||||||
{
|
{
|
||||||
@ -185,7 +221,7 @@ void SAL_CALL UIControllerFactory::registerController(
|
|||||||
throw (RuntimeException)
|
throw (RuntimeException)
|
||||||
{
|
{
|
||||||
// SAFE
|
// SAFE
|
||||||
ResetableGuard aLock( m_aLock );
|
osl::MutexGuard g(rBHelper.rMutex);
|
||||||
|
|
||||||
if ( !m_bConfigRead )
|
if ( !m_bConfigRead )
|
||||||
{
|
{
|
||||||
@ -203,7 +239,7 @@ void SAL_CALL UIControllerFactory::deregisterController(
|
|||||||
throw (RuntimeException)
|
throw (RuntimeException)
|
||||||
{
|
{
|
||||||
// SAFE
|
// SAFE
|
||||||
ResetableGuard aLock( m_aLock );
|
osl::MutexGuard g(rBHelper.rMutex);
|
||||||
|
|
||||||
if ( !m_bConfigRead )
|
if ( !m_bConfigRead )
|
||||||
{
|
{
|
||||||
@ -215,14 +251,32 @@ throw (RuntimeException)
|
|||||||
// SAFE
|
// SAFE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class PopupMenuControllerFactory : public UIControllerFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PopupMenuControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext );
|
||||||
|
|
||||||
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( PopupMenuControllerFactory ,
|
virtual OUString SAL_CALL getImplementationName()
|
||||||
::cppu::OWeakObject ,
|
throw (css::uno::RuntimeException)
|
||||||
SERVICENAME_POPUPMENUCONTROLLERFACTORY ,
|
{
|
||||||
IMPLEMENTATIONNAME_POPUPMENUCONTROLLERFACTORY
|
return OUString("com.sun.star.comp.framework.PopupMenuControllerFactory");
|
||||||
)
|
}
|
||||||
|
|
||||||
DEFINE_INIT_SERVICE ( PopupMenuControllerFactory, {} )
|
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
return cppu::supportsService(this, ServiceName);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
css::uno::Sequence< OUString > aSeq(1);
|
||||||
|
aSeq[0] = OUString("com.sun.star.frame.PopupMenuControllerFactory");
|
||||||
|
return aSeq;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XComponentContext >& xContext ) :
|
PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XComponentContext >& xContext ) :
|
||||||
UIControllerFactory(
|
UIControllerFactory(
|
||||||
@ -231,13 +285,50 @@ PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XCompon
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( ToolbarControllerFactory ,
|
struct PopupMenuControllerFactoryInstance {
|
||||||
::cppu::OWeakObject ,
|
explicit PopupMenuControllerFactoryInstance(
|
||||||
SERVICENAME_TOOLBARCONTROLLERFACTORY ,
|
css::uno::Reference<css::uno::XComponentContext> const & context):
|
||||||
IMPLEMENTATIONNAME_TOOLBARCONTROLLERFACTORY
|
instance(static_cast<cppu::OWeakObject *>(
|
||||||
)
|
new PopupMenuControllerFactory(context)))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
DEFINE_INIT_SERVICE ( ToolbarControllerFactory, {} )
|
css::uno::Reference<css::uno::XInterface> instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct PopupMenuControllerFactorySingleton:
|
||||||
|
public rtl::StaticWithArg<
|
||||||
|
PopupMenuControllerFactoryInstance,
|
||||||
|
css::uno::Reference<css::uno::XComponentContext>,
|
||||||
|
PopupMenuControllerFactorySingleton>
|
||||||
|
{};
|
||||||
|
|
||||||
|
class ToolbarControllerFactory : public UIControllerFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ToolbarControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext );
|
||||||
|
|
||||||
|
virtual OUString SAL_CALL getImplementationName()
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
return OUString("com.sun.star.comp.framework.ToolBarControllerFactory");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
return cppu::supportsService(this, ServiceName);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
css::uno::Sequence< OUString > aSeq(1);
|
||||||
|
aSeq[0] = OUString("com.sun.star.frame.ToolbarControllerFactory");
|
||||||
|
return aSeq;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XComponentContext >& xContext ) :
|
ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XComponentContext >& xContext ) :
|
||||||
UIControllerFactory(
|
UIControllerFactory(
|
||||||
@ -246,13 +337,50 @@ ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XComponentC
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE_2( StatusbarControllerFactory ,
|
struct ToolbarControllerFactoryInstance {
|
||||||
::cppu::OWeakObject ,
|
explicit ToolbarControllerFactoryInstance(
|
||||||
SERVICENAME_STATUSBARCONTROLLERFACTORY ,
|
css::uno::Reference<css::uno::XComponentContext> const & context):
|
||||||
IMPLEMENTATIONNAME_STATUSBARCONTROLLERFACTORY
|
instance(static_cast<cppu::OWeakObject *>(
|
||||||
)
|
new ToolbarControllerFactory(context)))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
DEFINE_INIT_SERVICE ( StatusbarControllerFactory, {} )
|
css::uno::Reference<css::uno::XInterface> instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ToolbarControllerFactorySingleton:
|
||||||
|
public rtl::StaticWithArg<
|
||||||
|
ToolbarControllerFactoryInstance,
|
||||||
|
css::uno::Reference<css::uno::XComponentContext>,
|
||||||
|
ToolbarControllerFactorySingleton>
|
||||||
|
{};
|
||||||
|
|
||||||
|
class StatusbarControllerFactory : public UIControllerFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
StatusbarControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext );
|
||||||
|
|
||||||
|
virtual OUString SAL_CALL getImplementationName()
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
return OUString("com.sun.star.comp.framework.StatusBarControllerFactory");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
return cppu::supportsService(this, ServiceName);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
|
||||||
|
throw (css::uno::RuntimeException)
|
||||||
|
{
|
||||||
|
css::uno::Sequence< OUString > aSeq(1);
|
||||||
|
aSeq[0] = OUString("com.sun.star.frame.StatusbarControllerFactory");
|
||||||
|
return aSeq;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XComponentContext >& xContext ) :
|
StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XComponentContext >& xContext ) :
|
||||||
UIControllerFactory(
|
UIControllerFactory(
|
||||||
@ -261,6 +389,51 @@ StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XCompon
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace framework
|
struct StatusbarControllerFactoryInstance {
|
||||||
|
explicit StatusbarControllerFactoryInstance(
|
||||||
|
css::uno::Reference<css::uno::XComponentContext> const & context):
|
||||||
|
instance(static_cast<cppu::OWeakObject *>(
|
||||||
|
new StatusbarControllerFactory(context)))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
css::uno::Reference<css::uno::XInterface> instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct StatusbarControllerFactorySingleton:
|
||||||
|
public rtl::StaticWithArg<
|
||||||
|
StatusbarControllerFactoryInstance,
|
||||||
|
css::uno::Reference<css::uno::XComponentContext>,
|
||||||
|
StatusbarControllerFactorySingleton>
|
||||||
|
{};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
|
||||||
|
com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation(
|
||||||
|
css::uno::XComponentContext *context,
|
||||||
|
css::uno::Sequence<css::uno::Any> const &)
|
||||||
|
{
|
||||||
|
return cppu::acquire(static_cast<cppu::OWeakObject *>(
|
||||||
|
PopupMenuControllerFactorySingleton::get(context).instance.get()));
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
|
||||||
|
com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation(
|
||||||
|
css::uno::XComponentContext *context,
|
||||||
|
css::uno::Sequence<css::uno::Any> const &)
|
||||||
|
{
|
||||||
|
return cppu::acquire(static_cast<cppu::OWeakObject *>(
|
||||||
|
ToolbarControllerFactorySingleton::get(context).instance.get()));
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
|
||||||
|
com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation(
|
||||||
|
css::uno::XComponentContext *context,
|
||||||
|
css::uno::Sequence<css::uno::Any> const &)
|
||||||
|
{
|
||||||
|
return cppu::acquire(static_cast<cppu::OWeakObject *>(
|
||||||
|
StatusbarControllerFactorySingleton::get(context).instance.get()));
|
||||||
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@ -99,7 +99,8 @@
|
|||||||
<implementation name="com.sun.star.comp.framework.PathSubstitution">
|
<implementation name="com.sun.star.comp.framework.PathSubstitution">
|
||||||
<service name="com.sun.star.util.PathSubstitution"/>
|
<service name="com.sun.star.util.PathSubstitution"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.framework.PopupMenuControllerFactory">
|
<implementation name="com.sun.star.comp.framework.PopupMenuControllerFactory"
|
||||||
|
constructor="com_sun_star_comp_framework_PopupMenuControllerFactory_get_implementation">
|
||||||
<service name="com.sun.star.frame.PopupMenuControllerFactory"/>
|
<service name="com.sun.star.frame.PopupMenuControllerFactory"/>
|
||||||
<singleton name="com.sun.star.frame.thePopupMenuControllerFactory"/>
|
<singleton name="com.sun.star.frame.thePopupMenuControllerFactory"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
@ -107,7 +108,8 @@
|
|||||||
constructor="com_sun_star_comp_framework_RecentFilesMenuController_get_implementation">
|
constructor="com_sun_star_comp_framework_RecentFilesMenuController_get_implementation">
|
||||||
<service name="com.sun.star.frame.PopupMenuController"/>
|
<service name="com.sun.star.frame.PopupMenuController"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.framework.StatusBarControllerFactory">
|
<implementation name="com.sun.star.comp.framework.StatusBarControllerFactory"
|
||||||
|
constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation">
|
||||||
<service name="com.sun.star.frame.StatusbarControllerFactory"/>
|
<service name="com.sun.star.frame.StatusbarControllerFactory"/>
|
||||||
<singleton name="com.sun.star.frame.theStatusbarControllerFactory"/>
|
<singleton name="com.sun.star.frame.theStatusbarControllerFactory"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
@ -121,7 +123,8 @@
|
|||||||
<implementation name="com.sun.star.comp.framework.TaskCreator">
|
<implementation name="com.sun.star.comp.framework.TaskCreator">
|
||||||
<service name="com.sun.star.frame.TaskCreator"/>
|
<service name="com.sun.star.frame.TaskCreator"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.framework.ToolBarControllerFactory">
|
<implementation name="com.sun.star.comp.framework.ToolBarControllerFactory"
|
||||||
|
constructor="com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation">
|
||||||
<service name="com.sun.star.frame.ToolbarControllerFactory"/>
|
<service name="com.sun.star.frame.ToolbarControllerFactory"/>
|
||||||
<singleton name="com.sun.star.frame.theToolbarControllerFactory"/>
|
<singleton name="com.sun.star.frame.theToolbarControllerFactory"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user