1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2008 by Sun Microsystems, Inc.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * $RCSfile: layoutmanager.hxx,v $
10*cdf0e10cSrcweir  * $Revision: 1.34 $
11*cdf0e10cSrcweir  *
12*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
13*cdf0e10cSrcweir  *
14*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
15*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
16*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
17*cdf0e10cSrcweir  *
18*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
19*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
22*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
23*cdf0e10cSrcweir  *
24*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
25*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
26*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
27*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
28*cdf0e10cSrcweir  *
29*cdf0e10cSrcweir  ************************************************************************/
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef __FRAMEWORK_LAYOUTMANAGER_TOOLBARLAYOUTMANAGER_HXX_
32*cdf0e10cSrcweir #define __FRAMEWORK_LAYOUTMANAGER_TOOLBARLAYOUTMANAGER_HXX_
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
35*cdf0e10cSrcweir                with solaris headers ...
36*cdf0e10cSrcweir */
37*cdf0e10cSrcweir #include <vector>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
40*cdf0e10cSrcweir //	my own includes
41*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
42*cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx>
43*cdf0e10cSrcweir #include <threadhelp/resetableguard.hxx>
44*cdf0e10cSrcweir #include <threadhelp/writeguard.hxx>
45*cdf0e10cSrcweir #include <threadhelp/readguard.hxx>
46*cdf0e10cSrcweir #include <macros/generic.hxx>
47*cdf0e10cSrcweir #include <macros/xinterface.hxx>
48*cdf0e10cSrcweir #include <macros/xtypeprovider.hxx>
49*cdf0e10cSrcweir #include <macros/xserviceinfo.hxx>
50*cdf0e10cSrcweir #include <stdtypes.h>
51*cdf0e10cSrcweir #include <properties.h>
52*cdf0e10cSrcweir #include <stdtypes.h>
53*cdf0e10cSrcweir #include <uiconfiguration/globalsettings.hxx>
54*cdf0e10cSrcweir #include <uiconfiguration/windowstateconfiguration.hxx>
55*cdf0e10cSrcweir #include <framework/addonsoptions.hxx>
56*cdf0e10cSrcweir #include <uielement/uielement.hxx>
57*cdf0e10cSrcweir #include <helper/ilayoutnotifications.hxx>
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
60*cdf0e10cSrcweir //	interface includes
61*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
62*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
63*cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
64*cdf0e10cSrcweir #include <com/sun/star/frame/XLayoutManager.hpp>
65*cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManager.hpp>
66*cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfiguration.hpp>
67*cdf0e10cSrcweir #include <com/sun/star/frame/XModuleManager.hpp>
68*cdf0e10cSrcweir #include <com/sun/star/frame/XFrameActionListener.hpp>
69*cdf0e10cSrcweir #include <com/sun/star/awt/XWindowListener.hpp>
70*cdf0e10cSrcweir #include <com/sun/star/util/XURLTransformer.hpp>
71*cdf0e10cSrcweir #include <com/sun/star/ui/XUIElementFactory.hpp>
72*cdf0e10cSrcweir #include <com/sun/star/ui/DockingArea.hpp>
73*cdf0e10cSrcweir #include <com/sun/star/awt/XTopWindow2.hpp>
74*cdf0e10cSrcweir #include <com/sun/star/awt/XWindow2.hpp>
75*cdf0e10cSrcweir #include <com/sun/star/awt/XDockableWindow.hpp>
76*cdf0e10cSrcweir #include <com/sun/star/awt/XDockableWindowListener.hpp>
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
79*cdf0e10cSrcweir //	other includes
80*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir namespace framework
86*cdf0e10cSrcweir {
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir class ToolbarLayoutManager : public ::cppu::WeakImplHelper3< ::com::sun::star::awt::XDockableWindowListener,
89*cdf0e10cSrcweir                                                              ::com::sun::star::ui::XUIConfigurationListener,
90*cdf0e10cSrcweir                                                              ::com::sun::star::awt::XWindowListener >,
91*cdf0e10cSrcweir                              private ThreadHelpBase // Struct for right initalization of mutex member! Must be first of baseclasses.
92*cdf0e10cSrcweir {
93*cdf0e10cSrcweir     public:
94*cdf0e10cSrcweir         enum { DOCKINGAREAS_COUNT = 4 };
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir         ToolbarLayoutManager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMGR,
97*cdf0e10cSrcweir                               const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElementFactory >& xUIElementFactory,
98*cdf0e10cSrcweir                               ILayoutNotifications* pParentLayouter );
99*cdf0e10cSrcweir         virtual ~ToolbarLayoutManager();
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir         void reset();
102*cdf0e10cSrcweir         void attach( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
103*cdf0e10cSrcweir                      const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager >& xModuleCfgMgr,
104*cdf0e10cSrcweir                      const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager >& xDocCfgMgr,
105*cdf0e10cSrcweir                      const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& xPersistentWindowState );
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir         void setParentWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentWindow );
108*cdf0e10cSrcweir         void setDockingAreaOffsets( const ::Rectangle aOffsets );
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir         void resetDockingArea();
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir         ::com::sun::star::awt::Rectangle getDockingArea();
113*cdf0e10cSrcweir         void setDockingArea( const ::com::sun::star::awt::Rectangle& rDockingArea );
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir         // layouting
116*cdf0e10cSrcweir         bool isLayoutDirty();
117*cdf0e10cSrcweir         void doLayout(const ::Size& aContainerSize);
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir         // creation/destruction
120*cdf0e10cSrcweir         void createStaticToolbars();
121*cdf0e10cSrcweir         void destroyToolbars();
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir         bool requestToolbar( const ::rtl::OUString& rResourceURL );
124*cdf0e10cSrcweir         bool createToolbar( const ::rtl::OUString& rResourceURL );
125*cdf0e10cSrcweir         bool destroyToolbar( const ::rtl::OUString& rResourceURL );
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir         // visibility
128*cdf0e10cSrcweir         bool showToolbar( const ::rtl::OUString& rResourceURL );
129*cdf0e10cSrcweir         bool hideToolbar( const ::rtl::OUString& rResourceURL );
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir         void refreshToolbarsVisibility( bool bAutomaticToolbars );
132*cdf0e10cSrcweir         void setFloatingToolbarsVisibility( bool bVisible );
133*cdf0e10cSrcweir         void setVisible(bool bVisible);
134*cdf0e10cSrcweir         bool isVisible() { return m_bVisible; }
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir         // docking and further functions
137*cdf0e10cSrcweir         bool dockToolbar( const ::rtl::OUString& rResourceURL, ::com::sun::star::ui::DockingArea eDockingArea, const ::com::sun::star::awt::Point& aPos );
138*cdf0e10cSrcweir         bool dockAllToolbars();
139*cdf0e10cSrcweir         bool floatToolbar( const ::rtl::OUString& rResoureURL );
140*cdf0e10cSrcweir         bool lockToolbar( const ::rtl::OUString& rResourceURL );
141*cdf0e10cSrcweir         bool unlockToolbar( const ::rtl::OUString& rResourceURL );
142*cdf0e10cSrcweir         void setToolbarPos( const ::rtl::OUString& rResourceURL, const ::com::sun::star::awt::Point& aPos );
143*cdf0e10cSrcweir         void setToolbarSize( const ::rtl::OUString& rResourceURL, const ::com::sun::star::awt::Size& aSize );
144*cdf0e10cSrcweir         void setToolbarPosSize( const ::rtl::OUString& rResourceURL, const ::com::sun::star::awt::Point& aPos, const ::com::sun::star::awt::Size& aSize );
145*cdf0e10cSrcweir         bool isToolbarVisible( const ::rtl::OUString& rResourceURL );
146*cdf0e10cSrcweir         bool isToolbarFloating( const ::rtl::OUString& rResourceURL );
147*cdf0e10cSrcweir         bool isToolbarDocked( const ::rtl::OUString& rResourceURL );
148*cdf0e10cSrcweir         bool isToolbarLocked( const ::rtl::OUString& rResourceURL );
149*cdf0e10cSrcweir         ::com::sun::star::awt::Point getToolbarPos( const ::rtl::OUString& rResourceURL );
150*cdf0e10cSrcweir         ::com::sun::star::awt::Size getToolbarSize( const ::rtl::OUString& rResourceURL );
151*cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > getToolbar( const ::rtl::OUString& aName );
152*cdf0e10cSrcweir         ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > > getToolbars();
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir         // child window notifications
155*cdf0e10cSrcweir         long childWindowEvent( VclSimpleEvent* pEvent );
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
158*cdf0e10cSrcweir         // XInterface
159*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
160*cdf0e10cSrcweir         virtual void SAL_CALL acquire() throw();
161*cdf0e10cSrcweir         virtual void SAL_CALL release() throw();
162*cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw( ::com::sun::star::uno::RuntimeException );
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
165*cdf0e10cSrcweir         // XEventListener
166*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
167*cdf0e10cSrcweir         virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
170*cdf0e10cSrcweir         // XWindowListener
171*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
172*cdf0e10cSrcweir         virtual void SAL_CALL windowResized( const css::awt::WindowEvent& aEvent ) throw( css::uno::RuntimeException );
173*cdf0e10cSrcweir         virtual void SAL_CALL windowMoved( const css::awt::WindowEvent& aEvent ) throw( css::uno::RuntimeException );
174*cdf0e10cSrcweir         virtual void SAL_CALL windowShown( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
175*cdf0e10cSrcweir         virtual void SAL_CALL windowHidden( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
178*cdf0e10cSrcweir         // XDockableWindowListener
179*cdf0e10cSrcweir 	    //---------------------------------------------------------------------------------------------------------
180*cdf0e10cSrcweir         virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
181*cdf0e10cSrcweir         virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
182*cdf0e10cSrcweir         virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
183*cdf0e10cSrcweir         virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
184*cdf0e10cSrcweir         virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
185*cdf0e10cSrcweir         virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
186*cdf0e10cSrcweir         virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent& e ) throw (::com::sun::star::uno::RuntimeException);
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
189*cdf0e10cSrcweir         // XUIConfigurationListener
190*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
191*cdf0e10cSrcweir         virtual void SAL_CALL elementInserted( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
192*cdf0e10cSrcweir         virtual void SAL_CALL elementRemoved( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
193*cdf0e10cSrcweir         virtual void SAL_CALL elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir     private:
196*cdf0e10cSrcweir         enum DockingOperation
197*cdf0e10cSrcweir         {
198*cdf0e10cSrcweir             DOCKOP_BEFORE_COLROW,
199*cdf0e10cSrcweir             DOCKOP_ON_COLROW,
200*cdf0e10cSrcweir             DOCKOP_AFTER_COLROW
201*cdf0e10cSrcweir         };
202*cdf0e10cSrcweir 
203*cdf0e10cSrcweir         typedef std::vector< UIElement > UIElementVector;
204*cdf0e10cSrcweir         struct SingleRowColumnWindowData
205*cdf0e10cSrcweir         {
206*cdf0e10cSrcweir             SingleRowColumnWindowData() : nVarSize( 0 ), nStaticSize( 0 ), nSpace( 0 ) {}
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir             std::vector< rtl::OUString >                                                      aUIElementNames;
209*cdf0e10cSrcweir             std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > > aRowColumnWindows;
210*cdf0e10cSrcweir             std::vector< ::com::sun::star::awt::Rectangle >                                   aRowColumnWindowSizes;
211*cdf0e10cSrcweir             std::vector< sal_Int32 >                                                          aRowColumnSpace;
212*cdf0e10cSrcweir             ::com::sun::star::awt::Rectangle                                                  aRowColumnRect;
213*cdf0e10cSrcweir             sal_Int32                                                                         nVarSize;
214*cdf0e10cSrcweir             sal_Int32                                                                         nStaticSize;
215*cdf0e10cSrcweir             sal_Int32                                                                         nSpace;
216*cdf0e10cSrcweir             sal_Int32                                                                         nRowColumn;
217*cdf0e10cSrcweir         };
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
220*cdf0e10cSrcweir         // internal helper methods
221*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
222*cdf0e10cSrcweir         bool             implts_isParentWindowVisible() const;
223*cdf0e10cSrcweir         ::Rectangle      implts_calcDockingArea();
224*cdf0e10cSrcweir         void             implts_sortUIElements();
225*cdf0e10cSrcweir         void             implts_reparentToolbars();
226*cdf0e10cSrcweir         rtl::OUString    implts_generateGenericAddonToolbarTitle( sal_Int32 nNumber ) const;
227*cdf0e10cSrcweir         void             implts_setElementData( UIElement& rUIElement, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindow >& rDockWindow );
228*cdf0e10cSrcweir         void             implts_destroyDockingAreaWindows();
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
231*cdf0e10cSrcweir         // layout methods
232*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
233*cdf0e10cSrcweir         void             implts_setDockingAreaWindowSizes( const ::com::sun::star::awt::Rectangle& rBorderSpace );
234*cdf0e10cSrcweir         ::Point          implts_findNextCascadeFloatingPos();
235*cdf0e10cSrcweir         void             implts_renumberRowColumnData( ::com::sun::star::ui::DockingArea eDockingArea, DockingOperation eDockingOperation, const UIElement& rUIElement );
236*cdf0e10cSrcweir         void             implts_calcWindowPosSizeOnSingleRowColumn( sal_Int32 nDockingArea,
237*cdf0e10cSrcweir                                                                     sal_Int32 nOffset,
238*cdf0e10cSrcweir                                                                     SingleRowColumnWindowData& rRowColumnWindowData,
239*cdf0e10cSrcweir                                                                     const ::Size& rContainerSize );
240*cdf0e10cSrcweir         void             implts_setLayoutDirty();
241*cdf0e10cSrcweir         void             implts_setLayoutInProgress( bool bInProgress = true );
242*cdf0e10cSrcweir         bool             implts_isLayoutInProgress() const { return m_bLayoutInProgress; }
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
245*cdf0e10cSrcweir         // lookup/container methods
246*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
247*cdf0e10cSrcweir         UIElement        implts_findToolbar( const rtl::OUString& aName );
248*cdf0e10cSrcweir         UIElement        implts_findToolbar( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xToolbar );
249*cdf0e10cSrcweir         UIElement&       impl_findToolbar( const rtl::OUString& aName );
250*cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > implts_getXWindow( const ::rtl::OUString& aName );
251*cdf0e10cSrcweir         Window*          implts_getWindow( const ::rtl::OUString& aName );
252*cdf0e10cSrcweir         bool             implts_insertToolbar( const UIElement& rUIElement );
253*cdf0e10cSrcweir         void             implts_setToolbar( const UIElement& rUIElement );
254*cdf0e10cSrcweir         ::Size           implts_getTopBottomDockingAreaSizes();
255*cdf0e10cSrcweir         void             implts_getUIElementVectorCopy( UIElementVector& rCopy );
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
258*cdf0e10cSrcweir         // internal docking methods
259*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
260*cdf0e10cSrcweir         ::Rectangle      implts_calcHotZoneRect( const ::Rectangle& rRect, sal_Int32 nHotZoneOffset );
261*cdf0e10cSrcweir         void             implts_calcDockingPosSize( UIElement& aUIElement, DockingOperation& eDockOperation, ::Rectangle& rTrackingRect, const Point& rMousePos );
262*cdf0e10cSrcweir         DockingOperation implts_determineDockingOperation( ::com::sun::star::ui::DockingArea DockingArea, const ::Rectangle& rRowColRect, const Point& rMousePos );
263*cdf0e10cSrcweir         ::Rectangle      implts_getWindowRectFromRowColumn( ::com::sun::star::ui::DockingArea DockingArea, const SingleRowColumnWindowData& rRowColumnWindowData, const ::Point& rMousePos, const rtl::OUString& rExcludeElementName );
264*cdf0e10cSrcweir         ::Rectangle      implts_determineFrontDockingRect( ::com::sun::star::ui::DockingArea eDockingArea,
265*cdf0e10cSrcweir                                                            sal_Int32 nRowCol,
266*cdf0e10cSrcweir                                                            const ::Rectangle& rDockedElementRect,
267*cdf0e10cSrcweir                                                            const ::rtl::OUString& rMovedElementName,
268*cdf0e10cSrcweir                                                            const ::Rectangle& rMovedElementRect );
269*cdf0e10cSrcweir         ::Rectangle      implts_calcTrackingAndElementRect( ::com::sun::star::ui::DockingArea eDockingArea,
270*cdf0e10cSrcweir                                                             sal_Int32 nRowCol,
271*cdf0e10cSrcweir                                                             UIElement& rUIElement,
272*cdf0e10cSrcweir                                                             const ::Rectangle& rTrackingRect,
273*cdf0e10cSrcweir                                                             const ::Rectangle& rRowColumnRect,
274*cdf0e10cSrcweir                                                             const ::Size& rContainerWinSize );
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir         void             implts_getDockingAreaElementInfos( ::com::sun::star::ui::DockingArea DockingArea, std::vector< SingleRowColumnWindowData >& rRowColumnsWindowData );
277*cdf0e10cSrcweir         void             implts_getDockingAreaElementInfoOnSingleRowCol( ::com::sun::star::ui::DockingArea, sal_Int32 nRowCol, SingleRowColumnWindowData& rRowColumnWindowData );
278*cdf0e10cSrcweir         void             implts_findNextDockingPos( ::com::sun::star::ui::DockingArea DockingArea, const ::Size& aUIElementSize, ::Point& rVirtualPos, ::Point& rPixelPos );
279*cdf0e10cSrcweir         void             implts_setTrackingRect( ::com::sun::star::ui::DockingArea eDockingArea, const ::Point& rMousePos, ::Rectangle& rTrackingRect );
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
282*cdf0e10cSrcweir         // creation methods
283*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
284*cdf0e10cSrcweir         void             implts_createAddonsToolBars();
285*cdf0e10cSrcweir         void             implts_createCustomToolBars();
286*cdf0e10cSrcweir         void             implts_createNonContextSensitiveToolBars();
287*cdf0e10cSrcweir         void             implts_createCustomToolBars( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& aCustomTbxSeq );
288*cdf0e10cSrcweir         void             implts_createCustomToolBar( const rtl::OUString& aTbxResName, const rtl::OUString& aTitle );
289*cdf0e10cSrcweir         void             implts_createToolBar( const ::rtl::OUString& aName, bool& bNotify, ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& rUIElement );
290*cdf0e10cSrcweir         css::uno::Reference< css::ui::XUIElement > implts_createElement( const ::rtl::OUString& aName );
291*cdf0e10cSrcweir         void             implts_setToolbarCreation( bool bStart = true );
292*cdf0e10cSrcweir         bool             implts_isToolbarCreationActive();
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
295*cdf0e10cSrcweir         // persistence methods
296*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
297*cdf0e10cSrcweir         sal_Bool         implts_readWindowStateData( const rtl::OUString& aName, UIElement& rElementData );
298*cdf0e10cSrcweir         void             implts_writeWindowStateData( const UIElement& rElementData );
299*cdf0e10cSrcweir         void             implts_writeNewWindowStateData( const rtl::OUString aName, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& xWindow );
300*cdf0e10cSrcweir 
301*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
302*cdf0e10cSrcweir         // members
303*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
304*cdf0e10cSrcweir         css::uno::Reference< css::lang::XMultiServiceFactory >               m_xSMGR;
305*cdf0e10cSrcweir         css::uno::Reference< css::frame::XFrame >                            m_xFrame;
306*cdf0e10cSrcweir         css::uno::Reference< css::awt::XWindow2 >                            m_xContainerWindow;
307*cdf0e10cSrcweir         css::uno::Reference< css::awt::XWindow >                             m_xDockAreaWindows[DOCKINGAREAS_COUNT];
308*cdf0e10cSrcweir         css::uno::Reference< ::com::sun::star::ui::XUIElementFactory >       m_xUIElementFactoryManager;
309*cdf0e10cSrcweir         css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xModuleCfgMgr;
310*cdf0e10cSrcweir         css::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xDocCfgMgr;
311*cdf0e10cSrcweir         css::uno::Reference< ::com::sun::star::awt::XToolkit >               m_xToolkit;
312*cdf0e10cSrcweir         css::uno::Reference< ::com::sun::star::container::XNameAccess >      m_xPersistentWindowState;
313*cdf0e10cSrcweir         ILayoutNotifications*                                                m_pParentLayouter;
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir         UIElementVector                                                      m_aUIElements;
316*cdf0e10cSrcweir         UIElement                                                            m_aDockUIElement;
317*cdf0e10cSrcweir         Point                                                                m_aStartDockMousePos;
318*cdf0e10cSrcweir         Rectangle                                                            m_aDockingArea;
319*cdf0e10cSrcweir         Rectangle                                                            m_aDockingAreaOffsets;
320*cdf0e10cSrcweir         DockingOperation                                                     m_eDockOperation;
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir         AddonsOptions*                                                       m_pAddonOptions;
323*cdf0e10cSrcweir         GlobalSettings*                                                      m_pGlobalSettings;
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir         bool                                                                 m_bComponentAttached;
326*cdf0e10cSrcweir         bool                                                                 m_bMustLayout;
327*cdf0e10cSrcweir         bool                                                                 m_bLayoutDirty;
328*cdf0e10cSrcweir         bool                                                                 m_bStoreWindowState;
329*cdf0e10cSrcweir         bool                                                                 m_bGlobalSettings;
330*cdf0e10cSrcweir         bool                                                                 m_bDockingInProgress;
331*cdf0e10cSrcweir         bool                                                                 m_bVisible;
332*cdf0e10cSrcweir         bool                                                                 m_bLayoutInProgress;
333*cdf0e10cSrcweir         bool                                                                 m_bToolbarCreation;
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir         ::rtl::OUString                                                      m_aFullAddonTbxPrefix;
336*cdf0e10cSrcweir         ::rtl::OUString                                                      m_aCustomTbxPrefix;
337*cdf0e10cSrcweir         ::rtl::OUString                                                      m_aCustomizeCmd;
338*cdf0e10cSrcweir         ::rtl::OUString                                                      m_aToolbarTypeString;
339*cdf0e10cSrcweir         ::rtl::OUString                                                      m_aModuleIdentifier;
340*cdf0e10cSrcweir };
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir } // namespace framework
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir #endif // __FRAMEWORK_LAYOUTMANAGER_TOOLBARLAYOUTMANAGER_HXX_
345