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
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>
32 namespace css
= ::com::sun::star
;
34 namespace sfx2
{ namespace sidebar
{
40 /** This is the parent window of the panels.
41 It displays the deck title.
48 const DeckDescriptor
& rDeckDescriptor
,
49 Window
* pParentWindow
,
50 const ::boost::function
<void(void)>& rCloserAction
);
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
83 ScrollContainerWindow (Window
* pParentWindow
);
84 virtual ~ScrollContainerWindow (void);
85 virtual void Paint (const Rectangle
& rUpdateArea
);
86 void SetSeparators (const ::std::vector
<sal_Int32
>& rSeparators
);
88 ::std::vector
<sal_Int32
> maSeparators
;
92 const ::rtl::OUString msTitle
;
93 const ::rtl::OUString msId
;
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