LibreOffice Module sfx2 (master) 1
Deck.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
23#include <vcl/weld.hxx>
24
25namespace sfx2::sidebar
26{
27class DeckDescriptor;
28class DeckTitleBar;
29class SidebarDockingWindow;
30
37class Deck final : public InterimItemWindow
38{
39public:
40 Deck(const DeckDescriptor& rDeckDescriptor, SidebarDockingWindow* pParentWindow,
41 const std::function<void()>& rCloserAction);
42 virtual ~Deck() override;
43 virtual void dispose() override;
44
45 const OUString& GetId() const { return msId; }
46
49 void ResetPanels(SharedPanelContainer&& rPanels);
50 const SharedPanelContainer& GetPanels() const { return maPanels; }
51
52 std::shared_ptr<Panel> GetPanel(std::u16string_view panelId);
53
54 void RequestLayout();
56
61 void ShowPanel(const Panel& rPanel);
62
63 virtual void DataChanged(const DataChangedEvent& rEvent) override;
64
65 virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
66
67 sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; }
68
69 static void LOKSendSidebarFullUpdate();
70
71private:
73
74private:
75 const OUString msId;
76 sal_Int32 mnMinimalWidth;
78 sal_Int32 mnMinimalHeight;
80
82 std::unique_ptr<DeckTitleBar> mxTitleBar;
83 std::unique_ptr<weld::ScrolledWindow> mxVerticalScrollBar;
84 std::unique_ptr<weld::Box> mxContents;
85};
86
87} // end of namespace sfx2::sidebar
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This is the parent window of the panels.
Definition: Deck.hxx:38
const OUString & GetId() const
Definition: Deck.hxx:45
virtual ~Deck() override
Definition: Deck.cxx:79
std::unique_ptr< DeckTitleBar > mxTitleBar
Definition: Deck.hxx:82
weld::Widget * GetPanelParentWindow()
Definition: Deck.cxx:258
void RequestLayoutInternal()
Definition: Deck.cxx:208
sal_Int32 mnScrolledWindowExtraWidth
Definition: Deck.hxx:77
std::unique_ptr< weld::ScrolledWindow > mxVerticalScrollBar
Definition: Deck.hxx:83
Deck(const DeckDescriptor &rDeckDescriptor, SidebarDockingWindow *pParentWindow, const std::function< void()> &rCloserAction)
Definition: Deck.cxx:49
SharedPanelContainer maPanels
Definition: Deck.hxx:79
virtual void DumpAsPropertyTree(tools::JsonWriter &) override
Definition: Deck.cxx:137
sal_Int32 mnMinimalHeight
Definition: Deck.hxx:78
std::shared_ptr< Panel > GetPanel(std::u16string_view panelId)
Definition: Deck.cxx:263
void ShowPanel(const Panel &rPanel)
Try to make the panel completely visible.
Definition: Deck.cxx:276
const OUString msId
Definition: Deck.hxx:75
DeckTitleBar * GetTitleBar() const
Definition: Deck.cxx:105
tools::Rectangle GetContentArea() const
Definition: Deck.cxx:110
static void LOKSendSidebarFullUpdate()
Definition: Deck.cxx:40
std::unique_ptr< weld::Box > mxContents
Definition: Deck.hxx:84
virtual void dispose() override
Definition: Deck.cxx:84
sal_Int32 GetMinimalWidth() const
Definition: Deck.hxx:67
VclPtr< SidebarDockingWindow > mxParentWindow
Definition: Deck.hxx:81
const SharedPanelContainer & GetPanels() const
Definition: Deck.hxx:50
virtual void DataChanged(const DataChangedEvent &rEvent) override
Definition: Deck.cxx:124
void ResetPanels(SharedPanelContainer &&rPanels)
This container may contain existing panels that are being re-used, and new ones too.
Definition: Deck.cxx:179
sal_Int32 mnMinimalWidth
Definition: Deck.hxx:76
void RequestLayout()
Definition: Deck.cxx:226
Multiple panels form a single deck.
Definition: Panel.hxx:54
std::vector< std::shared_ptr< Panel > > SharedPanelContainer
Definition: Panel.hxx:118