Update git submodules
[LibreOffice.git] / include / vcl / notebookbar / notebookbar.hxx
blob5d94bdb0b7da12c5711575732b69d878fb35805c
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 <vcl/syswin.hxx>
13 #include <vcl/ctrl.hxx>
14 #include <vcl/notebookbar/NotebookBarAddonsMerger.hxx>
15 #include <vcl/settings.hxx>
16 #include <vector>
18 namespace com::sun::star::ui { class XContextChangeEventListener; }
20 class NotebookBarContextChangeEventListener;
21 class NotebookbarContextControl;
22 class SystemWindow;
23 class SfxViewShell;
25 /// This implements Widget Layout-based notebook-like menu bar.
26 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) NotebookBar final : public Control, public VclBuilderContainer
28 friend class NotebookBarContextChangeEventListener;
29 public:
30 NotebookBar(Window* pParent, const OUString& rID, const OUString& rUIXMLDescription,
31 const css::uno::Reference<css::frame::XFrame>& rFrame,
32 const NotebookBarAddonsItem& aNotebookBarAddonsItem);
33 virtual ~NotebookBar() override;
34 virtual void dispose() override;
36 virtual bool PreNotify( NotifyEvent& rNEvt ) override;
37 virtual Size GetOptimalSize() const override;
38 virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) override;
39 virtual void Resize() override;
41 void SetSystemWindow(SystemWindow* pSystemWindow);
43 void StateChanged(const StateChangedType nStateChange ) override;
45 void DataChanged(const DataChangedEvent& rDCEvt) override;
47 void SetupListener(bool bListen);
49 bool IsWelded() const { return m_bIsWelded; }
50 VclPtr<vcl::Window>& GetMainContainer() { return m_xVclContentArea; }
51 const OUString & GetUIFilePath() const { return m_sUIXMLDescription; }
52 void SetDisposeCallback(const Link<const SfxViewShell*, void> rDisposeCallback, const SfxViewShell* pViewShell);
54 private:
55 VclPtr<SystemWindow> m_pSystemWindow;
56 rtl::Reference<NotebookBarContextChangeEventListener> m_pEventListener;
57 std::vector<NotebookbarContextControl*> m_pContextContainers;
58 const SfxViewShell* m_pViewShell;
60 VclPtr<vcl::Window> m_xVclContentArea;
61 bool m_bIsWelded;
62 OUString m_sUIXMLDescription;
63 Link<const SfxViewShell*, void> m_rDisposeLink;
65 AllSettings DefaultSettings;
66 AllSettings PersonaSettings;
68 void UpdateBackground();
70 void UpdateDefaultSettings();
71 void UpdatePersonaSettings();
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */