xref: /trunk/main/sfx2/source/sidebar/Deck.hxx (revision f120fe41)
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
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef SFX_SIDEBAR_DECK_HXX
23 #define SFX_SIDEBAR_DECK_HXX
24 
25 #include "Panel.hxx"
26 
27 #include <vcl/window.hxx>
28 #include <vcl/image.hxx>
29 #include <com/sun/star/ui/LayoutSize.hpp>
30 
31 #include <boost/function.hpp>
32 #include <boost/scoped_ptr.hpp>
33 
34 class ScrollBar;
35 
36 namespace css = ::com::sun::star;
37 
38 namespace sfx2 { namespace sidebar {
39 
40 class DeckDescriptor;
41 class DeckTitleBar;
42 
43 
44 /** This is the parent window of the panels.
45     It displays the deck title.
46 */
47 class Deck
48     : public Window
49 {
50 public:
51     Deck (
52         const DeckDescriptor& rDeckDescriptor,
53         Window* pParentWindow,
54         const ::boost::function<void(void)>& rCloserAction);
55     virtual ~Deck (void);
56 
57     void Dispose (void);
58 
59     const ::rtl::OUString& GetId (void) const;
60     DeckTitleBar* GetTitleBar (void) const;
61     Rectangle GetContentArea (void) const;
62     ::rtl::OUString GetIconURL (const bool bIsHighContrastModeActive) const;
63     void SetPanels (const SharedPanelContainer& rPanels);
64     const SharedPanelContainer& GetPanels (void) const;
65     void RequestLayout (void);
66     ::Window* GetPanelParentWindow (void);
67 
68     virtual void Paint (const Rectangle& rUpdateArea);
69     virtual void DataChanged (const DataChangedEvent& rEvent);
70 
71     void PrintWindowTree (void);
72     void PrintWindowTree (const ::std::vector<Panel*>& rPanels);
73     static void PrintWindowSubTree (Window* pRoot, int nIndentation);
74 
75     class ScrollContainerWindow : public Window
76     {
77     public:
78         ScrollContainerWindow (Window* pParentWindow);
79         virtual ~ScrollContainerWindow (void);
80         virtual void Paint (const Rectangle& rUpdateArea);
81         void SetSeparators (const ::std::vector<sal_Int32>& rSeparators);
82     private:
83         ::std::vector<sal_Int32> maSeparators;
84     };
85 
86 private:
87     const ::rtl::OUString msTitle;
88     const ::rtl::OUString msId;
89     Image maIcon;
90     const ::rtl::OUString msIconURL;
91     const ::rtl::OUString msHighContrastIconURL;
92     SharedPanelContainer maPanels;
93     ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
94     ::boost::scoped_ptr<Window> mpScrollClipWindow;
95     ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer;
96     ::boost::scoped_ptr<Window> mpFiller;
97     ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
98 
99     DECL_LINK(HandleVerticalScrollBarChange,void*);
100 };
101 
102 
103 } } // end of namespace sfx2::sidebar
104 
105 #endif
106