SidebarController.hxx (a5297daf) | SidebarController.hxx (3091fa8a) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 28 unchanged lines hidden (view full) --- 37#include <com/sun/star/ui/XContextChangeEventListener.hpp> 38#include <com/sun/star/ui/XUIElement.hpp> 39#include <com/sun/star/ui/XSidebar.hpp> 40 41#include <boost/noncopyable.hpp> 42#include <boost/optional.hpp> 43#include <cppuhelper/compbase4.hxx> 44#include <cppuhelper/basemutex.hxx> | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 28 unchanged lines hidden (view full) --- 37#include <com/sun/star/ui/XContextChangeEventListener.hpp> 38#include <com/sun/star/ui/XUIElement.hpp> 39#include <com/sun/star/ui/XSidebar.hpp> 40 41#include <boost/noncopyable.hpp> 42#include <boost/optional.hpp> 43#include <cppuhelper/compbase4.hxx> 44#include <cppuhelper/basemutex.hxx> |
45#include <cppuhelper/weakref.hxx> 46#include <comphelper/stl_types.hxx> |
|
45 | 47 |
48 |
|
46namespace css = ::com::sun::star; 47namespace cssu = ::com::sun::star::uno; 48 49 50namespace 51{ 52 typedef ::cppu::WeakComponentImplHelper4 < 53 css::ui::XContextChangeEventListener, --- 21 unchanged lines hidden (view full) --- 75 public SidebarControllerInterfaceBase 76{ 77public: 78 SidebarController( 79 SidebarDockingWindow* pParentWindow, 80 const cssu::Reference<css::frame::XFrame>& rxFrame); 81 virtual ~SidebarController (void); 82 | 49namespace css = ::com::sun::star; 50namespace cssu = ::com::sun::star::uno; 51 52 53namespace 54{ 55 typedef ::cppu::WeakComponentImplHelper4 < 56 css::ui::XContextChangeEventListener, --- 21 unchanged lines hidden (view full) --- 78 public SidebarControllerInterfaceBase 79{ 80public: 81 SidebarController( 82 SidebarDockingWindow* pParentWindow, 83 const cssu::Reference<css::frame::XFrame>& rxFrame); 84 virtual ~SidebarController (void); 85 |
86 /** Return the SidebarController object that is associated with 87 the given XFrame. 88 @return 89 When there is no SidebarController object for the given 90 XFrame then <NULL/> is returned. 91 */ 92 static SidebarController* GetSidebarControllerForFrame ( 93 const cssu::Reference<css::frame::XFrame>& rxFrame); 94 |
|
83 // ui::XContextChangeEventListener 84 virtual void SAL_CALL notifyContextChangeEvent (const css::ui::ContextChangeEventObject& rEvent) 85 throw(cssu::RuntimeException); 86 87 // XEventListener 88 virtual void SAL_CALL disposing (const css::lang::EventObject& rEventObject) 89 throw(cssu::RuntimeException); 90 --- 17 unchanged lines hidden (view full) --- 108 constructed. In this case we have to a context change and 109 also force that all panels are destroyed and created new. 110 */ 111 const static sal_Int32 SwitchFlag_NoForce = 0x00; 112 const static sal_Int32 SwitchFlag_ForceSwitch = 0x01; 113 const static sal_Int32 SwitchFlag_ForceNewDeck = 0x02; 114 const static sal_Int32 SwitchFlag_ForceNewPanels = 0x02; 115 | 95 // ui::XContextChangeEventListener 96 virtual void SAL_CALL notifyContextChangeEvent (const css::ui::ContextChangeEventObject& rEvent) 97 throw(cssu::RuntimeException); 98 99 // XEventListener 100 virtual void SAL_CALL disposing (const css::lang::EventObject& rEventObject) 101 throw(cssu::RuntimeException); 102 --- 17 unchanged lines hidden (view full) --- 120 constructed. In this case we have to a context change and 121 also force that all panels are destroyed and created new. 122 */ 123 const static sal_Int32 SwitchFlag_NoForce = 0x00; 124 const static sal_Int32 SwitchFlag_ForceSwitch = 0x01; 125 const static sal_Int32 SwitchFlag_ForceNewDeck = 0x02; 126 const static sal_Int32 SwitchFlag_ForceNewPanels = 0x02; 127 |
116 void SwitchToDeck ( | 128 void RequestSwitchToDeck ( |
117 const ::rtl::OUString& rsDeckId); 118 void OpenThenSwitchToDeck ( 119 const ::rtl::OUString& rsDeckId); 120 121 /** Show only the tab bar, not the deck. 122 */ 123 void RequestCloseDeck (void); 124 125 /** Open the deck area and restore the parent window to its old width. 126 */ 127 void RequestOpenDeck (void); 128 129 FocusManager& GetFocusManager (void); 130 131private: | 129 const ::rtl::OUString& rsDeckId); 130 void OpenThenSwitchToDeck ( 131 const ::rtl::OUString& rsDeckId); 132 133 /** Show only the tab bar, not the deck. 134 */ 135 void RequestCloseDeck (void); 136 137 /** Open the deck area and restore the parent window to its old width. 138 */ 139 void RequestOpenDeck (void); 140 141 FocusManager& GetFocusManager (void); 142 143private: |
144 typedef ::std::map< 145 const cssu::Reference<css::frame::XFrame>, 146 cssu::WeakReference<SidebarController> 147 > SidebarControllerContainer; 148 static SidebarControllerContainer maSidebarControllerContainer; 149 |
|
132 ::boost::scoped_ptr<Deck> mpCurrentDeck; 133 SidebarDockingWindow* mpParentWindow; 134 ::boost::scoped_ptr<TabBar> mpTabBar; 135 cssu::Reference<css::frame::XFrame> mxFrame; 136 Context maCurrentContext; 137 Context maRequestedContext; 138 /// Use a combination of SwitchFlag_* as value. 139 sal_Int32 mnRequestedForceFlags; 140 ::rtl::OUString msCurrentDeckId; 141 ::rtl::OUString msCurrentDeckTitle; 142 AsynchronousCall maPropertyChangeForwarder; 143 AsynchronousCall maContextChangeUpdate; | 150 ::boost::scoped_ptr<Deck> mpCurrentDeck; 151 SidebarDockingWindow* mpParentWindow; 152 ::boost::scoped_ptr<TabBar> mpTabBar; 153 cssu::Reference<css::frame::XFrame> mxFrame; 154 Context maCurrentContext; 155 Context maRequestedContext; 156 /// Use a combination of SwitchFlag_* as value. 157 sal_Int32 mnRequestedForceFlags; 158 ::rtl::OUString msCurrentDeckId; 159 ::rtl::OUString msCurrentDeckTitle; 160 AsynchronousCall maPropertyChangeForwarder; 161 AsynchronousCall maContextChangeUpdate; |
162 AsynchronousCall maAsynchronousDeckSwitch; |
|
144 145 /** Two flags control whether the deck is displayed or if only the 146 tab bar remains visible. 147 The mbIsDeckOpen flag stores the current state while 148 mbIsDeckRequestedOpen stores how this state should be. User 149 actions like clicking on the deck closer affect the 150 mbIsDeckRequestedOpen. Normally both flags have the same 151 value. A document being read-only can prevent the deck from opening. --- 31 unchanged lines hidden (view full) --- 183 const bool bWantsCanvas, 184 const Context& rContext); 185 SharedPanel CreatePanel ( 186 const ::rtl::OUString& rsPanelId, 187 ::Window* pParentWindow, 188 const bool bIsInitiallyExpanded, 189 const Context& rContext); 190 void SwitchToDeck ( | 163 164 /** Two flags control whether the deck is displayed or if only the 165 tab bar remains visible. 166 The mbIsDeckOpen flag stores the current state while 167 mbIsDeckRequestedOpen stores how this state should be. User 168 actions like clicking on the deck closer affect the 169 mbIsDeckRequestedOpen. Normally both flags have the same 170 value. A document being read-only can prevent the deck from opening. --- 31 unchanged lines hidden (view full) --- 202 const bool bWantsCanvas, 203 const Context& rContext); 204 SharedPanel CreatePanel ( 205 const ::rtl::OUString& rsPanelId, 206 ::Window* pParentWindow, 207 const bool bIsInitiallyExpanded, 208 const Context& rContext); 209 void SwitchToDeck ( |
210 const ::rtl::OUString& rsDeckId); 211 void SwitchToDeck ( |
|
191 const DeckDescriptor& rDeckDescriptor, 192 const Context& rContext); 193 void ShowPopupMenu ( 194 const Rectangle& rButtonBox, 195 const ::std::vector<TabBar::DeckMenuData>& rMenuData) const; 196 void ShowDetailMenu (const ::rtl::OUString& rsMenuCommand) const; 197 ::boost::shared_ptr<PopupMenu> CreatePopupMenu ( 198 const ::std::vector<TabBar::DeckMenuData>& rMenuData) const; --- 41 unchanged lines hidden --- | 212 const DeckDescriptor& rDeckDescriptor, 213 const Context& rContext); 214 void ShowPopupMenu ( 215 const Rectangle& rButtonBox, 216 const ::std::vector<TabBar::DeckMenuData>& rMenuData) const; 217 void ShowDetailMenu (const ::rtl::OUString& rsMenuCommand) const; 218 ::boost::shared_ptr<PopupMenu> CreatePopupMenu ( 219 const ::std::vector<TabBar::DeckMenuData>& rMenuData) const; --- 41 unchanged lines hidden --- |