1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_DECK_HXX
20 #define INCLUDED_SFX2_SOURCE_SIDEBAR_DECK_HXX
22 #include <sfx2/sidebar/Panel.hxx>
24 #include <vcl/window.hxx>
28 namespace sfx2
{ namespace sidebar
{
33 /** This is the parent window of the panels.
34 It displays the deck title.
36 class Deck final
: public vcl::Window
39 Deck(const DeckDescriptor
& rDeckDescriptor
,
40 vcl::Window
* pParentWindow
,
41 const std::function
<void()>& rCloserAction
);
42 virtual ~Deck() override
;
43 virtual void dispose() override
;
45 const OUString
& GetId() const { return msId
; }
47 VclPtr
<DeckTitleBar
> const & GetTitleBar() const;
48 tools::Rectangle
GetContentArea() const;
49 void ResetPanels (const SharedPanelContainer
& rPanels
);
50 const SharedPanelContainer
& GetPanels() const { return maPanels
; }
52 Panel
* GetPanel(OUString
const & panelId
);
55 vcl::Window
* GetPanelParentWindow();
57 /** Try to make the panel completely visible.
58 When the whole panel does not fit then make its top visible
59 and it off at the bottom.
61 void ShowPanel (const Panel
& rPanel
);
63 virtual void ApplySettings(vcl::RenderContext
& rRenderContext
) override
;
64 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rUpdateArea
) override
;
65 virtual void DataChanged (const DataChangedEvent
& rEvent
) override
;
66 virtual bool EventNotify(NotifyEvent
& rEvent
) override
;
67 virtual void Resize() override
;
69 virtual boost::property_tree::ptree
DumpAsPropertyTree() override
;
71 static void PrintWindowSubTree (vcl::Window
* pRoot
, int nIndentation
);
73 sal_Int32
GetMinimalWidth() const { return mnMinimalWidth
; }
75 class ScrollContainerWindow final
: public vcl::Window
78 ScrollContainerWindow(vcl::Window
* pParentWindow
);
79 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rUpdateArea
) override
;
80 void SetSeparators(const ::std::vector
<sal_Int32
>& rSeparators
);
82 std::vector
<sal_Int32
> maSeparators
;
86 void RequestLayoutInternal();
90 sal_Int32 mnMinimalWidth
;
91 sal_Int32 mnMinimalHeight
;
92 SharedPanelContainer maPanels
;
93 VclPtr
<DeckTitleBar
> mpTitleBar
;
94 VclPtr
<vcl::Window
> mpScrollClipWindow
;
95 VclPtr
<ScrollContainerWindow
> mpScrollContainer
;
96 VclPtr
<vcl::Window
> mpFiller
;
97 VclPtr
<ScrollBar
> mpVerticalScrollBar
;
99 DECL_LINK(HandleVerticalScrollBarChange
, ScrollBar
*, void);
100 bool ProcessWheelEvent(CommandEvent
const * pCommandEvent
);
104 } } // end of namespace sfx2::sidebar
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */