Kaydet (Commit) 2d46ef6d authored tarafından Matúš Kukan's avatar Matúš Kukan

fwk: Constructor feature for single-instance framework::Desktop.

Change-Id: Id582e672c0b41a35d25361f7dfe970a767880b2a
üst ce02519c
......@@ -20,16 +20,11 @@
#ifndef INCLUDED_FRAMEWORK_INC_SERVICES_DESKTOP_HXX
#define INCLUDED_FRAMEWORK_INC_SERVICES_DESKTOP_HXX
#include <sal/config.h>
#include <classes/framecontainer.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <helper/oframes.hxx>
#include <macros/generic.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
#include <com/sun/star/frame/XUntitledNumbers.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XDesktop2.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
......@@ -38,7 +33,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/frame/XFrames.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
......@@ -53,11 +48,10 @@
#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <unotools/cmdoptions.hxx>
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/implbase6.hxx>
#include <comphelper/numberedcollection.hxx>
#include <cppuhelper/compbase6.hxx>
#include <cppuhelper/propshlp.hxx>
#include <unotools/cmdoptions.hxx>
namespace framework{
......@@ -91,15 +85,10 @@ enum ELoadState
XEventListener
XInteractionHandler
@base ThreadHelpBase
TransactionBase
OBroadcastHelper
OPropertySetHelper
@devstatus ready to use
@threadsafe yes
*//*-*************************************************************************************************************/
typedef ::cppu::WeakImplHelper6<
typedef cppu::WeakComponentImplHelper6<
css::lang::XServiceInfo ,
css::frame::XDesktop2 ,
css::frame::XTasksSupplier ,
......@@ -107,14 +96,11 @@ typedef ::cppu::WeakImplHelper6<
css::task::XInteractionHandler ,
css::frame::XUntitledNumbers > Desktop_BASE;
class Desktop : // base classes
// Order is necessary for right initialization!
private ThreadHelpBase ,
private TransactionBase ,
public ::cppu::OBroadcastHelper ,
public ::cppu::OPropertySetHelper ,
// interfaces
public Desktop_BASE
class Desktop : private osl::Mutex,
private ThreadHelpBase,
private TransactionBase,
public Desktop_BASE,
public cppu::OPropertySetHelper
{
// internal used types, const etcpp.
private:
......@@ -130,8 +116,17 @@ class Desktop : // base classes
Desktop( const css::uno::Reference< css::uno::XComponentContext >& xContext );
virtual ~Desktop( );
void constructorInit();
// XServiceInfo
DECLARE_XSERVICEINFO
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);
// XInterface
virtual void SAL_CALL acquire() throw ()
......@@ -274,8 +269,7 @@ class Desktop : // base classes
virtual void SAL_CALL removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException );
// XComponent
using cppu::OPropertySetHelper::disposing;
virtual void SAL_CALL dispose ( ) throw( css::uno::RuntimeException );
virtual void SAL_CALL disposing() throw( css::uno::RuntimeException );
virtual void SAL_CALL addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
virtual void SAL_CALL removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
......@@ -407,7 +401,6 @@ class Desktop : // base classes
//-------------------------------------------------------------------------------------------------------------
private:
static sal_Bool implcp_ctor ( const css::uno::Reference< css::uno::XComponentContext >& xFactory );
static sal_Bool implcp_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
static sal_Bool implcp_removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
......
......@@ -33,10 +33,8 @@
IFFACTORIE( Service2 )
)
=================================================================================================================*/
#include <services/desktop.hxx>
COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::Desktop )
)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -36,7 +36,8 @@
constructor="com_sun_star_comp_framework_ControlMenuController_get_implementation">
<service name="com.sun.star.frame.PopupMenuController"/>
</implementation>
<implementation name="com.sun.star.comp.framework.Desktop">
<implementation name="com.sun.star.comp.framework.Desktop"
constructor="com_sun_star_comp_framework_Desktop_get_implementation">
<service name="com.sun.star.frame.Desktop"/>
<singleton name="com.sun.star.frame.theDesktop"/>
</implementation>
......
......@@ -48,6 +48,7 @@ core_factory_list = [
core_constructor_list = [
# framework/util/fwk.component
"com_sun_star_comp_framework_AutoRecovery_get_implementation",
"com_sun_star_comp_framework_Desktop_get_implementation",
"com_sun_star_comp_framework_Frame_get_implementation",
"com_sun_star_comp_framework_JobExecutor_get_implementation",
"com_sun_star_comp_framework_LayoutManager_get_implementation",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment