xref: /trunk/main/sfx2/source/sidebar/Deck.hxx (revision 7a32b0c8)
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 "vcl/window.hxx"
26 #include "vcl/image.hxx"
27 #include <com/sun/star/ui/LayoutSize.hpp>
28 
29 #include <boost/function.hpp>
30 #include <boost/scoped_ptr.hpp>
31 
32 class ScrollBar;
33 
34 namespace css = ::com::sun::star;
35 
36 namespace sfx2 { namespace sidebar {
37 
38 class DeckDescriptor;
39 class Panel;
40 class DeckTitleBar;
41 
42 
43 /** This is the parent window of the panels.
44     It displays the deck title.
45 */
46 class Deck
47     : public Window
48 {
49 public:
50     Deck (
51         const DeckDescriptor& rDeckDescriptor,
52         Window* pParentWindow,
53         const ::boost::function<void(void)>& rCloserAction);
54     virtual ~Deck (void);
55 
56     void Dispose (void);
57 
58     const ::rtl::OUString& GetId (void) const;
59     DeckTitleBar* GetTitleBar (void) const;
60     Rectangle GetContentArea (void) const;
61     ::rtl::OUString GetIconURL (const bool bIsHighContrastModeActive) const;
62     void SetPanels (const ::std::vector<Panel*>& rPanels);
63     void RequestLayout (void);
64     ::Window* GetPanelParentWindow (void);
65 
66     virtual void Paint (const Rectangle& rUpdateArea);
67     virtual void DataChanged (const DataChangedEvent& rEvent);
68 
69     void PrintWindowTree (void);
70     void PrintWindowTree (const ::std::vector<Panel*>& rPanels);
71     static void PrintWindowSubTree (Window* pRoot, int nIndentation);
72 
73     class ScrollContainerWindow : public Window
74     {
75     public:
76         ScrollContainerWindow (Window* pParentWindow);
77         virtual ~ScrollContainerWindow (void);
78         virtual void Paint (const Rectangle& rUpdateArea);
79         void SetSeparators (const ::std::vector<sal_Int32>& rSeparators);
80     private:
81         ::std::vector<sal_Int32> maSeparators;
82     };
83 
84 private:
85     const ::rtl::OUString msTitle;
86     const ::rtl::OUString msId;
87     Image maIcon;
88     const ::rtl::OUString msIconURL;
89     const ::rtl::OUString msHighContrastIconURL;
90     typedef ::std::vector<Panel*> PanelContainer;
91     PanelContainer maPanels;
92     ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
93     ::boost::scoped_ptr<Window> mpScrollClipWindow;
94     ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer;
95     ::boost::scoped_ptr<Window> mpFiller;
96     ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
97 
98     DECL_LINK(HandleVerticalScrollBarChange,void*);
99 };
100 
101 
102 } } // end of namespace sfx2::sidebar
103 
104 #endif
105