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

fwk: Constructor feature for single-instance WindowStateConfiguration.

Change-Id: I0537d7a30b6c6807bf746a52dbd2c7fc66607ae2
üst 4ff873bd
......@@ -29,7 +29,6 @@
#include <properties.h>
#include <stdtypes.h>
#include <uielement/menubarmanager.hxx>
#include <uiconfiguration/windowstateconfiguration.hxx>
#include <framework/addonsoptions.hxx>
#include <uielement/uielement.hxx>
#include <helper/ilayoutnotifications.hxx>
......
......@@ -17,33 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_FRAMEWORK_INC_UICONFIGURATION_WINDOWSTATECONFIGURATION_HXX
#define INCLUDED_FRAMEWORK_INC_UICONFIGURATION_WINDOWSTATECONFIGURATION_HXX
/** Attention: stl headers must(!) be included at first. Otherwise it can make trouble
with solaris headers ...
*/
#include <vector>
#include <list>
#include <boost/unordered_map.hpp>
#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/container/XNameAccess.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/ustring.hxx>
namespace framework
{
#ifndef INCLUDED_FRAMEWORK_INC_UICONFIGURATION_WINDOWSTATEPROPERTIES_HXX
#define INCLUDED_FRAMEWORK_INC_UICONFIGURATION_WINDOWSTATEPROPERTIES_HXX
#define WINDOWSTATE_PROPERTY_LOCKED "Locked"
#define WINDOWSTATE_PROPERTY_DOCKED "Docked"
......@@ -62,51 +37,6 @@ namespace framework
#define WINDOWSTATE_PROPERTY_SOFTCLOSE "SoftClose"
#define WINDOWSTATE_PROPERTY_CONTEXTACTIVE "ContextActive"
class WindowStateConfiguration : private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
public ::cppu::WeakImplHelper2< css::container::XNameAccess, css::lang::XServiceInfo>
{
public:
WindowStateConfiguration( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~WindowStateConfiguration();
// XInterface, XTypeProvider, XServiceInfo
DECLARE_XSERVICEINFO
// XNameAccess
virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
throw (::com::sun::star::uno::RuntimeException);
// XElementAccess
virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements()
throw (::com::sun::star::uno::RuntimeException);
typedef ::boost::unordered_map< OUString,
OUString,
OUStringHash,
::std::equal_to< OUString > > ModuleToWindowStateFileMap;
typedef ::boost::unordered_map< OUString,
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >,
OUStringHash,
::std::equal_to< OUString > > ModuleToWindowStateConfigHashMap;
private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext;
ModuleToWindowStateFileMap m_aModuleToFileHashMap;
ModuleToWindowStateConfigHashMap m_aModuleToWindowStateHashMap;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleManager;
};
} // namespace framework
#endif // __FRAMEWORK_UIELEMENT_WINDOWSTATECONFIGURATION_HXX_
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -24,12 +24,12 @@
#include <framework/sfxhelperfunctions.hxx>
#include <uielement/menubarwrapper.hxx>
#include <framework/addonsoptions.hxx>
#include <uiconfiguration/windowstateconfiguration.hxx>
#include <classes/fwkresid.hxx>
#include <classes/resource.hrc>
#include <toolkit/helper/convert.hxx>
#include <uielement/progressbarwrapper.hxx>
#include <uiconfiguration/globalsettings.hxx>
#include <uiconfiguration/windowstateproperties.hxx>
#include <toolbarlayoutmanager.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
......
......@@ -18,13 +18,13 @@
*/
#include <toolbarlayoutmanager.hxx>
#include <uiconfiguration/windowstateproperties.hxx>
#include <uielement/addonstoolbarwrapper.hxx>
#include <helpers.hxx>
#include <services.h>
#include <services/layoutmanager.hxx>
#include <classes/resource.hrc>
#include <classes/fwkresid.hxx>
#include <uiconfiguration/windowstateconfiguration.hxx>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/Toolkit.hpp>
......
......@@ -36,7 +36,6 @@
#include <stdtypes.h>
#include <properties.h>
#include <uiconfiguration/globalsettings.hxx>
#include <uiconfiguration/windowstateconfiguration.hxx>
#include <framework/addonsoptions.hxx>
#include <uielement/uielement.hxx>
#include <helper/ilayoutnotifications.hxx>
......
......@@ -34,14 +34,12 @@
)
=================================================================================================================*/
#include <services/desktop.hxx>
#include "uiconfiguration/windowstateconfiguration.hxx"
#include <services/sessionlistener.hxx>
#include <services/ContextChangeEventMultiplexer.hxx>
COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::Desktop ) else
IFFACTORY( ::framework::WindowStateConfiguration ) else
IFFACTORY( ::framework::SessionListener ) else
IFFACTORY( ::framework::SessionListener ) else
IFFACTORY( ::framework::ContextChangeEventMultiplexer )
......
......@@ -25,9 +25,9 @@
#include "services.h"
#include <classes/resource.hrc>
#include <classes/fwkresid.hxx>
#include <uiconfiguration/windowstateconfiguration.hxx>
#include <framework/imageproducer.hxx>
#include <framework/sfxhelperfunctions.hxx>
#include <uiconfiguration/windowstateproperties.hxx>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
......
......@@ -167,7 +167,8 @@
<service name="com.sun.star.ui.WindowContentFactoryManager"/>
<singleton name="com.sun.star.ui.theWindowContentFactoryManager"/>
</implementation>
<implementation name="com.sun.star.comp.framework.WindowStateConfiguration">
<implementation name="com.sun.star.comp.framework.WindowStateConfiguration"
constructor="com_sun_star_comp_framework_WindowStateConfiguration_get_implementation">
<service name="com.sun.star.ui.WindowStateConfiguration"/>
<singleton name="com.sun.star.ui.theWindowStateConfiguration"/>
</implementation>
......
......@@ -64,6 +64,7 @@ core_constructor_list = [
"com_sun_star_comp_framework_UIConfigurationManager_get_implementation",
"com_sun_star_comp_framework_UIElementFactoryManager_get_implementation",
"com_sun_star_comp_framework_URLTransformer_get_implementation",
"com_sun_star_comp_framework_WindowStateConfiguration_get_implementation",
# i18npool/util/i18npool.component
"com_sun_star_i18n_BreakIterator_get_implementation",
"com_sun_star_i18n_BreakIterator_Unicode_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