1*22de8995SAndre Fischer /**************************************************************
2*22de8995SAndre Fischer  *
3*22de8995SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
4*22de8995SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
5*22de8995SAndre Fischer  * distributed with this work for additional information
6*22de8995SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
7*22de8995SAndre Fischer  * to you under the Apache License, Version 2.0 (the
8*22de8995SAndre Fischer  * "License"); you may not use this file except in compliance
9*22de8995SAndre Fischer  * with the License.  You may obtain a copy of the License at
10*22de8995SAndre Fischer  *
11*22de8995SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
12*22de8995SAndre Fischer  *
13*22de8995SAndre Fischer  * Unless required by applicable law or agreed to in writing,
14*22de8995SAndre Fischer  * software distributed under the License is distributed on an
15*22de8995SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*22de8995SAndre Fischer  * KIND, either express or implied.  See the License for the
17*22de8995SAndre Fischer  * specific language governing permissions and limitations
18*22de8995SAndre Fischer  * under the License.
19*22de8995SAndre Fischer  *
20*22de8995SAndre Fischer  *************************************************************/
21*22de8995SAndre Fischer 
22*22de8995SAndre Fischer #ifndef SFX_SIDEBAR_CONTROLLER_HXX
23*22de8995SAndre Fischer #define SFX_SIDEBAR_CONTROLLER_HXX
24*22de8995SAndre Fischer 
25*22de8995SAndre Fischer #include "ContentPanelManager.hxx"
26*22de8995SAndre Fischer 
27*22de8995SAndre Fischer #include <com/sun/star/ui/XContextChangeEventListener.hpp>
28*22de8995SAndre Fischer #include <boost/noncopyable.hpp>
29*22de8995SAndre Fischer #include <cppuhelper/compbase1.hxx>
30*22de8995SAndre Fischer #include <cppuhelper/basemutex.hxx>
31*22de8995SAndre Fischer 
32*22de8995SAndre Fischer namespace css = ::com::sun::star;
33*22de8995SAndre Fischer namespace cssu = ::com::sun::star::uno;
34*22de8995SAndre Fischer 
35*22de8995SAndre Fischer namespace
36*22de8995SAndre Fischer {
37*22de8995SAndre Fischer     typedef ::cppu::WeakComponentImplHelper1 <
38*22de8995SAndre Fischer         css::ui::XContextChangeEventListener
39*22de8995SAndre Fischer         > SidebarControllerInterfaceBase;
40*22de8995SAndre Fischer }
41*22de8995SAndre Fischer 
42*22de8995SAndre Fischer 
43*22de8995SAndre Fischer namespace sfx2 {
44*22de8995SAndre Fischer 
45*22de8995SAndre Fischer class TabBar;
46*22de8995SAndre Fischer class DeckDescriptor;
47*22de8995SAndre Fischer class ContentPanelDescriptor;
48*22de8995SAndre Fischer 
49*22de8995SAndre Fischer class SidebarController
50*22de8995SAndre Fischer     : private ::boost::noncopyable,
51*22de8995SAndre Fischer       private ::cppu::BaseMutex,
52*22de8995SAndre Fischer       public SidebarControllerInterfaceBase
53*22de8995SAndre Fischer {
54*22de8995SAndre Fischer public:
55*22de8995SAndre Fischer     SidebarController(
56*22de8995SAndre Fischer         Window* pParentWindow,
57*22de8995SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame);
58*22de8995SAndre Fischer     virtual ~SidebarController (void);
59*22de8995SAndre Fischer 
60*22de8995SAndre Fischer     virtual void SAL_CALL notifyContextChangeEvent (const css::ui::ContextChangeEventObject& rEvent)
61*22de8995SAndre Fischer         throw(cssu::RuntimeException);
62*22de8995SAndre Fischer 
63*22de8995SAndre Fischer     virtual void SAL_CALL disposing (const css::lang::EventObject& rEventObject)
64*22de8995SAndre Fischer         throw(cssu::RuntimeException);
65*22de8995SAndre Fischer 
66*22de8995SAndre Fischer     void NotifyResize (void);
67*22de8995SAndre Fischer 
68*22de8995SAndre Fischer private:
69*22de8995SAndre Fischer     class Configuration;
70*22de8995SAndre Fischer     ::boost::scoped_ptr<Configuration> mpCurrentConfiguration;
71*22de8995SAndre Fischer     Window* mpParentWindow;
72*22de8995SAndre Fischer     TabBar* mpTabBar;
73*22de8995SAndre Fischer     cssu::Reference<css::frame::XFrame> mxFrame;
74*22de8995SAndre Fischer 
75*22de8995SAndre Fischer     DECL_LINK(WindowEventHandler, VclWindowEvent*);
76*22de8995SAndre Fischer     void UpdateConfiguration (
77*22de8995SAndre Fischer         const Context& rContext);
78*22de8995SAndre Fischer     void ProcessMatchingDeck (
79*22de8995SAndre Fischer         const DeckDescriptor& rDeck,
80*22de8995SAndre Fischer         Configuration& rConfiguration);
81*22de8995SAndre Fischer     void ProcessMatchingPanel (
82*22de8995SAndre Fischer         const ContentPanelDescriptor& rPanel,
83*22de8995SAndre Fischer         Configuration& rConfiguration);
84*22de8995SAndre Fischer     void MakeConfigurationCurrent (Configuration& rConfiguration);
85*22de8995SAndre Fischer 
86*22de8995SAndre Fischer     virtual void SAL_CALL disposing (void);
87*22de8995SAndre Fischer };
88*22de8995SAndre Fischer 
89*22de8995SAndre Fischer 
90*22de8995SAndre Fischer } // end of namespace sfx2
91*22de8995SAndre Fischer 
92*22de8995SAndre Fischer 
93*22de8995SAndre Fischer #endif
94