bump product version to 4.1.6.2
[LibreOffice.git] / sfx2 / source / sidebar / Deck.hxx
blob0dc86ff9bafa927b3dad28787ed797447211d15c
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef SFX_SIDEBAR_DECK_HXX
19 #define SFX_SIDEBAR_DECK_HXX
21 #include "Panel.hxx"
23 #include <vcl/window.hxx>
24 #include <vcl/image.hxx>
25 #include <com/sun/star/ui/LayoutSize.hpp>
27 #include <boost/function.hpp>
28 #include <boost/scoped_ptr.hpp>
30 class ScrollBar;
32 namespace css = ::com::sun::star;
34 namespace sfx2 { namespace sidebar {
36 class DeckDescriptor;
37 class DeckTitleBar;
40 /** This is the parent window of the panels.
41 It displays the deck title.
43 class Deck
44 : public Window
46 public:
47 Deck (
48 const DeckDescriptor& rDeckDescriptor,
49 Window* pParentWindow,
50 const ::boost::function<void(void)>& rCloserAction);
51 virtual ~Deck (void);
53 void Dispose (void);
55 const ::rtl::OUString& GetId (void) const;
56 DeckTitleBar* GetTitleBar (void) const;
57 Rectangle GetContentArea (void) const;
58 ::rtl::OUString GetIconURL (const bool bIsHighContrastModeActive) const;
59 void SetPanels (const SharedPanelContainer& rPanels);
60 const SharedPanelContainer& GetPanels (void) const;
61 void RequestLayout (void);
62 ::Window* GetPanelParentWindow (void);
64 /** Try to make the panel completely visible.
65 When the whole panel does not fit then make its top visible
66 and it off at the bottom.
68 void ShowPanel (const Panel& rPanel);
70 virtual void Paint (const Rectangle& rUpdateArea);
71 virtual void DataChanged (const DataChangedEvent& rEvent);
72 virtual long Notify (NotifyEvent& rEvent);
74 void PrintWindowTree (void);
75 void PrintWindowTree (const ::std::vector<Panel*>& rPanels);
76 static void PrintWindowSubTree (Window* pRoot, int nIndentation);
78 sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; }
80 class ScrollContainerWindow : public Window
82 public:
83 ScrollContainerWindow (Window* pParentWindow);
84 virtual ~ScrollContainerWindow (void);
85 virtual void Paint (const Rectangle& rUpdateArea);
86 void SetSeparators (const ::std::vector<sal_Int32>& rSeparators);
87 private:
88 ::std::vector<sal_Int32> maSeparators;
91 private:
92 const ::rtl::OUString msTitle;
93 const ::rtl::OUString msId;
94 Image maIcon;
95 const ::rtl::OUString msIconURL;
96 const ::rtl::OUString msHighContrastIconURL;
97 sal_Int32 mnMinimalWidth;
98 SharedPanelContainer maPanels;
99 ::boost::scoped_ptr<DeckTitleBar> mpTitleBar;
100 ::boost::scoped_ptr<Window> mpScrollClipWindow;
101 ::boost::scoped_ptr<ScrollContainerWindow> mpScrollContainer;
102 ::boost::scoped_ptr<Window> mpFiller;
103 ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
105 DECL_LINK(HandleVerticalScrollBarChange,void*);
106 bool ProcessWheelEvent (
107 CommandEvent* pCommandEvent,
108 NotifyEvent& rEvent);
112 } } // end of namespace sfx2::sidebar
114 #endif