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