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

fwk: Constructor feature for single-instance TaskCreatorService.

Change-Id: I9e994ebb4822458039709690aa5dd0a7f75735ac
üst 6c15ca4d
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XFrameActionListener.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp>
#include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <unotools/moduleoptions.hxx> #include <unotools/moduleoptions.hxx>
#include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase2.hxx>
......
...@@ -17,29 +17,8 @@ ...@@ -17,29 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#ifndef INCLUDED_FRAMEWORK_INC_SERVICES_TASKCREATORSRV_HXX #ifndef INCLUDED_FRAMEWORK_INC_TASKCREATORDEFS_HXX
#define INCLUDED_FRAMEWORK_INC_SERVICES_TASKCREATORSRV_HXX #define INCLUDED_FRAMEWORK_INC_TASKCREATORDEFS_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
#include <general.h>
#include <stdtypes.h>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/frame/XFrame2.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <cppuhelper/implbase2.hxx>
#include <comphelper/sequenceashashmap.hxx>
//_______________________________________________
// definition
/// [XFrame] if it's set, it will be used as parent frame for the new created frame. /// [XFrame] if it's set, it will be used as parent frame for the new created frame.
const char ARGUMENT_PARENTFRAME[] = "ParentFrame"; // XFrame const char ARGUMENT_PARENTFRAME[] = "ParentFrame"; // XFrame
...@@ -74,75 +53,6 @@ const char ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE[] = "SupportPersistentWindowSta ...@@ -74,75 +53,6 @@ const char ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE[] = "SupportPersistentWindowSta
*/ */
const char ARGUMENT_ENABLE_TITLEBARUPDATE[] = "EnableTitleBarUpdate"; // sal_Bool const char ARGUMENT_ENABLE_TITLEBARUPDATE[] = "EnableTitleBarUpdate"; // sal_Bool
#endif // INCLUDED_FRAMEWORK_INC_TASKCREATORDEFS_HXX
namespace framework
{
//_______________________________________________
/**
* TODO document me
*/
class TaskCreatorService : // attention! Must be the first base class to guarentee right initialize lock ...
private ThreadHelpBase,
public ::cppu::WeakImplHelper2<
css::lang::XServiceInfo,
css::lang::XSingleServiceFactory>
{
//___________________________________________
// member
private:
//---------------------------------------
/** @short the global uno service manager.
@descr Must be used to create own needed services.
*/
css::uno::Reference< css::uno::XComponentContext > m_xContext;
//___________________________________________
// interface
public:
TaskCreatorService(const css::uno::Reference< css::uno::XComponentContext >& xContext);
virtual ~TaskCreatorService( );
// XInterface, XTypeProvider, XServiceInfo
DECLARE_XSERVICEINFO
// XSingleServiceFactory
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance()
throw(css::uno::Exception ,
css::uno::RuntimeException);
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const css::uno::Sequence< css::uno::Any >& lArguments)
throw(css::uno::Exception ,
css::uno::RuntimeException);
//___________________________________________
// helper
private:
css::uno::Reference< css::awt::XWindow > implts_createContainerWindow( const css::uno::Reference< css::awt::XWindow >& xParentWindow ,
const css::awt::Rectangle& aPosSize ,
sal_Bool bTopWindow );
void implts_applyDocStyleToWindow(const css::uno::Reference< css::awt::XWindow >& xWindow) const;
css::uno::Reference< css::frame::XFrame2 > implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame ,
const css::uno::Reference< css::awt::XWindow >& xContainerWindow ,
const OUString& sName );
void implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame );
void implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame2 >& xFrame );
void implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame );
OUString impl_filterNames( const OUString& sName );
};
} // namespace framework
#endif // INCLUDED_FRAMEWORK_INC_SERVICES_TASKCREATORSRV_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
*/ */
#include <classes/taskcreator.hxx> #include <classes/taskcreator.hxx>
#include "services/taskcreatorsrv.hxx"
#include <threadhelp/readguard.hxx> #include <threadhelp/readguard.hxx>
#include <loadenv/targethelper.hxx> #include <loadenv/targethelper.hxx>
#include <services.h> #include <services.h>
#include <taskcreatordefs.hxx>
#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/TaskCreator.hpp> #include <com/sun/star/frame/TaskCreator.hpp>
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include "uiconfiguration/windowstateconfiguration.hxx" #include "uiconfiguration/windowstateconfiguration.hxx"
#include <uifactory/statusbarfactory.hxx> #include <uifactory/statusbarfactory.hxx>
#include <services/sessionlistener.hxx> #include <services/sessionlistener.hxx>
#include <services/taskcreatorsrv.hxx>
#include <services/ContextChangeEventMultiplexer.hxx> #include <services/ContextChangeEventMultiplexer.hxx>
...@@ -53,7 +52,6 @@ COMPONENTGETFACTORY ( fwk, ...@@ -53,7 +52,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::StatusBarFactory ) else IFFACTORY( ::framework::StatusBarFactory ) else
IFFACTORY( ::framework::SessionListener ) else IFFACTORY( ::framework::SessionListener ) else
IFFACTORY( ::framework::SessionListener ) else IFFACTORY( ::framework::SessionListener ) else
IFFACTORY( ::framework::TaskCreatorService ) else
IFFACTORY( ::framework::ContextChangeEventMultiplexer ) IFFACTORY( ::framework::ContextChangeEventMultiplexer )
) )
......
...@@ -121,7 +121,8 @@ ...@@ -121,7 +121,8 @@
constructor="com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation"> constructor="com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation">
<service name="com.sun.star.task.StatusIndicatorFactory"/> <service name="com.sun.star.task.StatusIndicatorFactory"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.framework.TaskCreator"> <implementation name="com.sun.star.comp.framework.TaskCreator"
constructor="com_sun_star_comp_framework_TaskCreator_get_implementation">
<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"
......
...@@ -59,6 +59,7 @@ core_constructor_list = [ ...@@ -59,6 +59,7 @@ core_constructor_list = [
"com_sun_star_comp_framework_PathSettings_get_implementation", "com_sun_star_comp_framework_PathSettings_get_implementation",
"com_sun_star_comp_framework_PathSubstitution_get_implementation", "com_sun_star_comp_framework_PathSubstitution_get_implementation",
"com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation", "com_sun_star_comp_framework_StatusIndicatorFactory_get_implementation",
"com_sun_star_comp_framework_TaskCreator_get_implementation",
"com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation", "com_sun_star_comp_framework_ToolBarControllerFactory_get_implementation",
"com_sun_star_comp_framework_UIConfigurationManager_get_implementation", "com_sun_star_comp_framework_UIConfigurationManager_get_implementation",
"com_sun_star_comp_framework_UIElementFactoryManager_get_implementation", "com_sun_star_comp_framework_UIElementFactoryManager_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