1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_UICONFIGURATION_WINDOWSTATECONFIGURATION_HXX_
21 #define __FRAMEWORK_UICONFIGURATION_WINDOWSTATECONFIGURATION_HXX_
23 /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
24 with solaris headers ...
28 #include <boost/unordered_map.hpp>
30 #include <threadhelp/threadhelpbase.hxx>
31 #include <macros/generic.hxx>
32 #include <macros/xinterface.hxx>
33 #include <macros/xtypeprovider.hxx>
34 #include <macros/xserviceinfo.hxx>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/lang/XTypeProvider.hpp>
39 #include <com/sun/star/container/XNameAccess.hpp>
40 #include <com/sun/star/frame/XModuleManager2.hpp>
42 #include <cppuhelper/implbase2.hxx>
43 #include <rtl/ustring.hxx>
48 #define WINDOWSTATE_PROPERTY_LOCKED "Locked"
49 #define WINDOWSTATE_PROPERTY_DOCKED "Docked"
50 #define WINDOWSTATE_PROPERTY_VISIBLE "Visible"
51 #define WINDOWSTATE_PROPERTY_DOCKINGAREA "DockingArea"
52 #define WINDOWSTATE_PROPERTY_DOCKPOS "DockPos"
53 #define WINDOWSTATE_PROPERTY_DOCKSIZE "DockSize"
54 #define WINDOWSTATE_PROPERTY_POS "Pos"
55 #define WINDOWSTATE_PROPERTY_SIZE "Size"
56 #define WINDOWSTATE_PROPERTY_UINAME "UIName"
57 #define WINDOWSTATE_PROPERTY_INTERNALSTATE "InternalState"
58 #define WINDOWSTATE_PROPERTY_STYLE "Style"
59 #define WINDOWSTATE_PROPERTY_CONTEXT "ContextSensitive"
60 #define WINDOWSTATE_PROPERTY_HIDEFROMENU "HideFromToolbarMenu"
61 #define WINDOWSTATE_PROPERTY_NOCLOSE "NoClose"
62 #define WINDOWSTATE_PROPERTY_SOFTCLOSE "SoftClose"
63 #define WINDOWSTATE_PROPERTY_CONTEXTACTIVE "ContextActive"
65 class WindowStateConfiguration
: private ThreadHelpBase
, // Struct for right initalization of mutex member! Must be first of baseclasses.
66 public ::cppu::WeakImplHelper2
< ::com::sun::star::container::XNameAccess
, css::lang::XServiceInfo
>
69 WindowStateConfiguration( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& rxContext
);
70 virtual ~WindowStateConfiguration();
72 // XInterface, XTypeProvider, XServiceInfo
73 FWK_DECLARE_XINTERFACE
74 FWK_DECLARE_XTYPEPROVIDER
78 virtual ::com::sun::star::uno::Any SAL_CALL
getByName( const OUString
& aName
)
79 throw ( ::com::sun::star::container::NoSuchElementException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
81 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getElementNames()
82 throw (::com::sun::star::uno::RuntimeException
);
84 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
)
85 throw (::com::sun::star::uno::RuntimeException
);
88 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
89 throw (::com::sun::star::uno::RuntimeException
);
90 virtual sal_Bool SAL_CALL
hasElements()
91 throw (::com::sun::star::uno::RuntimeException
);
93 typedef ::boost::unordered_map
< OUString
,
96 ::std::equal_to
< OUString
> > ModuleToWindowStateFileMap
;
98 typedef ::boost::unordered_map
< OUString
,
99 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
>,
101 ::std::equal_to
< OUString
> > ModuleToWindowStateConfigHashMap
;
104 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
105 ModuleToWindowStateFileMap m_aModuleToFileHashMap
;
106 ModuleToWindowStateConfigHashMap m_aModuleToWindowStateHashMap
;
107 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModuleManager2
> m_xModuleManager
;
110 } // namespace framework
112 #endif // __FRAMEWORK_UIELEMENT_WINDOWSTATECONFIGURATION_HXX_
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */