Bump version to 21.06.18.1
[LibreOffice.git] / include / sfx2 / sidebar / Deck.hxx
blobf5940366fa1f4555c7df38fadc02e85475ca1ed4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
21 #include <sfx2/sidebar/Panel.hxx>
22 #include <vcl/InterimItemWindow.hxx>
23 #include <vcl/weld.hxx>
25 namespace sfx2::sidebar
27 class DeckDescriptor;
28 class DeckTitleBar;
29 class SidebarDockingWindow;
31 /** This is the parent window of the panels.
32 It displays the deck title.
34 A deck consists of multiple panels.
35 E.g. Properties, Styles, Navigator.
37 class Deck final : public InterimItemWindow
39 public:
40 Deck(const DeckDescriptor& rDeckDescriptor, SidebarDockingWindow* pParentWindow,
41 const std::function<void()>& rCloserAction);
42 virtual ~Deck() override;
43 virtual void dispose() override;
45 const OUString& GetId() const { return msId; }
47 DeckTitleBar* GetTitleBar() const;
48 tools::Rectangle GetContentArea() const;
49 void ResetPanels(const SharedPanelContainer& rPanels);
50 const SharedPanelContainer& GetPanels() const { return maPanels; }
52 std::shared_ptr<Panel> GetPanel(std::u16string_view panelId);
54 void RequestLayout();
55 weld::Widget* 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 DataChanged(const DataChangedEvent& rEvent) override;
65 virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
67 static void PrintWindowSubTree(vcl::Window* pRoot, int nIndentation);
69 sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; }
71 SidebarDockingWindow* GetDockingWindow() const { return mxParentWindow; }
73 private:
74 void RequestLayoutInternal();
76 private:
77 const OUString msId;
78 sal_Int32 mnMinimalWidth;
79 sal_Int32 mnMinimalHeight;
80 SharedPanelContainer maPanels;
82 VclPtr<SidebarDockingWindow> mxParentWindow;
83 std::unique_ptr<DeckTitleBar> mxTitleBar;
84 std::unique_ptr<weld::ScrolledWindow> mxVerticalScrollBar;
85 std::unique_ptr<weld::Container> mxContents;
88 } // end of namespace sfx2::sidebar
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */