xref: /trunk/main/sfx2/source/sidebar/Deck.hxx (revision 95a18594)
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 
28 
29 namespace sfx2 { namespace sidebar {
30 
31 class DeckDescriptor;
32 class Panel;
33 class TitleBar;
34 
35 
36 /** This is the parent window of the panels.
37     It displays the deck title.
38 */
39 class Deck
40     : public Window
41 {
42 public:
43     Deck (
44         const DeckDescriptor& rDeckDescriptor,
45         Window* pParentWindow);
46     virtual ~Deck (void);
47 
48     void Dispose (void);
49 
50     const ::rtl::OUString& GetId (void) const;
51     TitleBar* GetTitleBar (void) const;
52     Rectangle GetContentArea (void) const;
53     ::rtl::OUString GetIconURL (const bool bIsHighContrastModeActive) const;
54     void SetPanels (const ::std::vector<Panel*>& rPanels);
55     void RequestLayout (void);
56 
57     virtual void Paint (const Rectangle& rUpdateArea);
58     virtual void DataChanged (const DataChangedEvent& rEvent);
59 
60 private:
61     const ::rtl::OUString msTitle;
62     const ::rtl::OUString msId;
63     TitleBar* mpTitleBar;
64     Image maIcon;
65     const ::rtl::OUString msIconURL;
66     const ::rtl::OUString msHighContrastIconURL;
67     ::std::vector<Panel*> maPanels;
68     ::std::vector<sal_Int32> maSeparators;
69     Window* mpFiller;
70 
71     void LayoutSinglePanel (void);
72     void LayoutMultiplePanels (void);
73     Rectangle PlaceDeckTitle (
74         TitleBar* pDeckTitleBar,
75         const Rectangle& rAvailableSpace);
76     void ShowFiller (const Rectangle& rBox);
77     void HideFiller (void);
78 };
79 
80 
81 } } // end of namespace sfx2::sidebar
82 
83 #endif
84