Simplify using designated initializers
[LibreOffice.git] / include / sfx2 / sidebar / PanelLayout.hxx
blob3058c9d514dda66dae2dc559a292feac61089ea7
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/.
8 */
10 #pragma once
12 #include <sfx2/dllapi.h>
13 #include <vcl/weld.hxx>
15 class DataChangedEvent;
16 class VclSimpleEvent;
17 namespace sfx2 { namespace sidebar { class Panel; } }
18 namespace tools { class JsonWriter; }
20 /// This class is the base for the Widget Layout-based sidebar panels.
21 class SFX2_DLLPUBLIC PanelLayout
23 protected:
24 std::unique_ptr<weld::Builder> m_xBuilder;
25 std::unique_ptr<weld::Container> m_xContainer;
26 sfx2::sidebar::Panel* m_pPanel;
28 virtual void DataChanged(const DataChangedEvent& rEvent);
29 virtual void DumpAsPropertyTree(tools::JsonWriter&);
31 virtual weld::Window* GetFrameWeld() const;
33 private:
34 DECL_DLLPRIVATE_LINK(DataChangedEventListener, VclSimpleEvent&, void);
35 DECL_DLLPRIVATE_LINK(DumpAsPropertyTreeHdl, tools::JsonWriter&, void);
37 public:
38 PanelLayout(weld::Widget* pParent, const OUString& rID, const OUString& rUIXMLDescription);
40 void SetPanel(sfx2::sidebar::Panel* pPanel);
42 virtual ~PanelLayout();
44 Size get_preferred_size() const
46 return m_xContainer->get_preferred_size();
49 void queue_resize();
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */