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