LibreOffice Module vcl (master) 1
notebookbar.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
10#pragma once
11
12#include <vcl/syswin.hxx>
13#include <vcl/ctrl.hxx>
15#include <vcl/settings.hxx>
16#include <set>
17#include <vector>
18
19namespace com::sun::star::ui { class XContextChangeEventListener; }
20
22class NotebookbarContextControl;
23class SystemWindow;
24class SfxViewShell;
25
27class VCL_DLLPUBLIC NotebookBar final : public Control, public VclBuilderContainer
28{
30public:
31 NotebookBar(Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
32 const css::uno::Reference<css::frame::XFrame>& rFrame,
33 const NotebookBarAddonsItem& aNotebookBarAddonsItem);
34 virtual ~NotebookBar() override;
35 virtual void dispose() override;
36
37 virtual bool PreNotify( NotifyEvent& rNEvt ) override;
38 virtual Size GetOptimalSize() const override;
39 virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) override;
40 virtual void Resize() override;
41
42 void SetSystemWindow(SystemWindow* pSystemWindow);
43
44 void StateChanged(const StateChangedType nStateChange ) override;
45
46 void DataChanged(const DataChangedEvent& rDCEvt) override;
47
48 void SetupListener(bool bListen);
49
50 bool IsWelded() const { return m_bIsWelded; }
51 VclPtr<vcl::Window>& GetMainContainer() { return m_xVclContentArea; }
52 const OUString & GetUIFilePath() const { return m_sUIXMLDescription; }
53 void SetDisposeCallback(const Link<const SfxViewShell*, void> rDisposeCallback, const SfxViewShell* pViewShell);
54
55private:
58 std::vector<NotebookbarContextControl*> m_pContextContainers;
60
65
68
69 void UpdateBackground();
70
71 void UpdateDefaultSettings();
72 void UpdatePersonaSettings();
73};
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: ctrl.hxx:82
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:257
virtual void Resize() override
Definition: ctrl.cxx:75
virtual Size GetOptimalSize() const override
Definition: ctrl.cxx:370
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: ctrl.cxx:59
split from the main class since it needs different ref-counting mana
Definition: notebookbar.cxx:49
This implements Widget Layout-based notebook-like menu bar.
Definition: notebookbar.hxx:28
rtl::Reference< NotebookBarContextChangeEventListener > m_pEventListener
Definition: notebookbar.hxx:57
bool m_bIsWelded
Definition: notebookbar.hxx:62
OUString m_sUIXMLDescription
Definition: notebookbar.hxx:63
VclPtr< vcl::Window > m_xVclContentArea
Definition: notebookbar.hxx:61
const SfxViewShell * m_pViewShell
Definition: notebookbar.hxx:59
AllSettings PersonaSettings
Definition: notebookbar.hxx:67
const OUString & GetUIFilePath() const
Definition: notebookbar.hxx:52
VclPtr< vcl::Window > & GetMainContainer()
Definition: notebookbar.hxx:51
bool IsWelded() const
Definition: notebookbar.hxx:50
Link< const SfxViewShell *, void > m_rDisposeLink
Definition: notebookbar.hxx:64
VclPtr< SystemWindow > m_pSystemWindow
Definition: notebookbar.hxx:56
AllSettings DefaultSettings
Definition: notebookbar.hxx:66
std::vector< NotebookbarContextControl * > m_pContextContainers
Definition: notebookbar.hxx:58
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:52
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2670
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:36
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
long Long
PosSizeFlags
Definition: window.hxx:127
StateChangedType
Definition: window.hxx:291