122de8995SAndre Fischer /**************************************************************
222de8995SAndre Fischer  *
322de8995SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
422de8995SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
522de8995SAndre Fischer  * distributed with this work for additional information
622de8995SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
722de8995SAndre Fischer  * to you under the Apache License, Version 2.0 (the
822de8995SAndre Fischer  * "License"); you may not use this file except in compliance
922de8995SAndre Fischer  * with the License.  You may obtain a copy of the License at
1022de8995SAndre Fischer  *
1122de8995SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
1222de8995SAndre Fischer  *
1322de8995SAndre Fischer  * Unless required by applicable law or agreed to in writing,
1422de8995SAndre Fischer  * software distributed under the License is distributed on an
1522de8995SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1622de8995SAndre Fischer  * KIND, either express or implied.  See the License for the
1722de8995SAndre Fischer  * specific language governing permissions and limitations
1822de8995SAndre Fischer  * under the License.
1922de8995SAndre Fischer  *
2022de8995SAndre Fischer  *************************************************************/
2122de8995SAndre Fischer 
2222de8995SAndre Fischer #ifndef SFX_SIDEBAR_CONTROLLER_HXX
2322de8995SAndre Fischer #define SFX_SIDEBAR_CONTROLLER_HXX
2422de8995SAndre Fischer 
25ff12d537SAndre Fischer #include "ResourceManager.hxx"
2622de8995SAndre Fischer 
27*b9e67834SAndre Fischer #include <com/sun/star/awt/XWindowPeer.hpp>
28*b9e67834SAndre Fischer #include <com/sun/star/beans/XPropertyChangeListener.hpp>
2922de8995SAndre Fischer #include <com/sun/star/ui/XContextChangeEventListener.hpp>
3022de8995SAndre Fischer #include <boost/noncopyable.hpp>
31*b9e67834SAndre Fischer #include <cppuhelper/compbase2.hxx>
3222de8995SAndre Fischer #include <cppuhelper/basemutex.hxx>
3322de8995SAndre Fischer 
3422de8995SAndre Fischer namespace css = ::com::sun::star;
3522de8995SAndre Fischer namespace cssu = ::com::sun::star::uno;
3622de8995SAndre Fischer 
3722de8995SAndre Fischer namespace
3822de8995SAndre Fischer {
39*b9e67834SAndre Fischer     typedef ::cppu::WeakComponentImplHelper2 <
40*b9e67834SAndre Fischer         css::ui::XContextChangeEventListener,
41*b9e67834SAndre Fischer         css::beans::XPropertyChangeListener
4222de8995SAndre Fischer         > SidebarControllerInterfaceBase;
4322de8995SAndre Fischer }
4422de8995SAndre Fischer 
4522de8995SAndre Fischer 
46ff12d537SAndre Fischer class DockingWindow;
47ff12d537SAndre Fischer 
48ff12d537SAndre Fischer namespace sfx2 { namespace sidebar {
4922de8995SAndre Fischer 
50*b9e67834SAndre Fischer class Panel;
5122de8995SAndre Fischer class TabBar;
52ff12d537SAndre Fischer class TabBarConfiguration;
5322de8995SAndre Fischer class DeckDescriptor;
54ff12d537SAndre Fischer class DeckConfiguration;
5522de8995SAndre Fischer class ContentPanelDescriptor;
5622de8995SAndre Fischer 
5722de8995SAndre Fischer class SidebarController
5822de8995SAndre Fischer     : private ::boost::noncopyable,
5922de8995SAndre Fischer       private ::cppu::BaseMutex,
6022de8995SAndre Fischer       public SidebarControllerInterfaceBase
6122de8995SAndre Fischer {
6222de8995SAndre Fischer public:
6322de8995SAndre Fischer     SidebarController(
64ff12d537SAndre Fischer         DockingWindow* pParentWindow,
6522de8995SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame);
6622de8995SAndre Fischer     virtual ~SidebarController (void);
6722de8995SAndre Fischer 
68*b9e67834SAndre Fischer     // ui::XContextChangeEventListener
6922de8995SAndre Fischer     virtual void SAL_CALL notifyContextChangeEvent (const css::ui::ContextChangeEventObject& rEvent)
7022de8995SAndre Fischer         throw(cssu::RuntimeException);
7122de8995SAndre Fischer 
72*b9e67834SAndre Fischer     // XEventListener
7322de8995SAndre Fischer     virtual void SAL_CALL disposing (const css::lang::EventObject& rEventObject)
7422de8995SAndre Fischer         throw(cssu::RuntimeException);
7522de8995SAndre Fischer 
76*b9e67834SAndre Fischer     // beans::XPropertyChangeListener
77*b9e67834SAndre Fischer     virtual void SAL_CALL propertyChange (const css::beans::PropertyChangeEvent& rEvent)
78*b9e67834SAndre Fischer         throw(cssu::RuntimeException);
79*b9e67834SAndre Fischer 
8022de8995SAndre Fischer     void NotifyResize (void);
8122de8995SAndre Fischer 
82ff12d537SAndre Fischer     void SwitchToDeck (
83ff12d537SAndre Fischer         const DeckDescriptor& rDeckDescriptor);
84ff12d537SAndre Fischer 
8522de8995SAndre Fischer private:
86ff12d537SAndre Fischer     ::boost::shared_ptr<DeckConfiguration> mpCurrentConfiguration;
87ff12d537SAndre Fischer     DockingWindow* mpParentWindow;
8822de8995SAndre Fischer     TabBar* mpTabBar;
8922de8995SAndre Fischer     cssu::Reference<css::frame::XFrame> mxFrame;
90ff12d537SAndre Fischer     Context maCurrentContext;
9122de8995SAndre Fischer 
9222de8995SAndre Fischer     DECL_LINK(WindowEventHandler, VclWindowEvent*);
93ff12d537SAndre Fischer     void UpdateConfigurations (const Context& rContext);
94ff12d537SAndre Fischer     cssu::Reference<css::ui::XUIElement> CreateUIElement (
95ff12d537SAndre Fischer         const cssu::Reference<css::awt::XWindowPeer>& rxWindow,
96*b9e67834SAndre Fischer         const ::rtl::OUString& rsImplementationURL,
97*b9e67834SAndre Fischer         Panel* pPanel) const;
98ff12d537SAndre Fischer     void SwitchToDeck (
99ff12d537SAndre Fischer         const DeckDescriptor& rDeckDescriptor,
10022de8995SAndre Fischer         const Context& rContext);
101ff12d537SAndre Fischer     void MakeConfigurationCurrent (const ::boost::shared_ptr<DeckConfiguration>& rpConfiguration);
102ff12d537SAndre Fischer     void ShowPopupMenu (const Rectangle& rButtonBox) const;
103ff12d537SAndre Fischer     ::boost::shared_ptr<PopupMenu> CreatePopupMenu (void) const;
104ff12d537SAndre Fischer     DECL_LINK(OnMenuItemSelected, Menu*);
10522de8995SAndre Fischer 
10622de8995SAndre Fischer     virtual void SAL_CALL disposing (void);
10722de8995SAndre Fischer };
10822de8995SAndre Fischer 
10922de8995SAndre Fischer 
110ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar
11122de8995SAndre Fischer 
11222de8995SAndre Fischer #endif
113