Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / vcl / notebookbar / notebookbar.hxx
blob15186fce2cc318e0d32964e9d29ff4a870e66afb
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 <set>
17 #include <vector>
19 namespace com::sun::star::ui { class XContextChangeEventListener; }
21 class NotebookBarContextChangeEventListener;
22 class NotebookbarContextControl;
23 class SystemWindow;
24 class SfxViewShell;
26 /// This implements Widget Layout-based notebook-like menu bar.
27 class VCL_DLLPUBLIC NotebookBar final : public Control, public VclBuilderContainer
29 friend class NotebookBarContextChangeEventListener;
30 public:
31 NotebookBar(Window* pParent, const OUString& 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;
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;
42 void SetSystemWindow(SystemWindow* pSystemWindow);
44 void StateChanged(const StateChangedType nStateChange ) override;
46 void DataChanged(const DataChangedEvent& rDCEvt) override;
48 void SetupListener(bool bListen);
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);
55 private:
56 VclPtr<SystemWindow> m_pSystemWindow;
57 rtl::Reference<NotebookBarContextChangeEventListener> m_pEventListener;
58 std::vector<NotebookbarContextControl*> m_pContextContainers;
59 const SfxViewShell* m_pViewShell;
61 VclPtr<vcl::Window> m_xVclContentArea;
62 bool m_bIsWelded;
63 OUString m_sUIXMLDescription;
64 Link<const SfxViewShell*, void> m_rDisposeLink;
66 AllSettings DefaultSettings;
67 AllSettings PersonaSettings;
69 void UpdateBackground();
71 void UpdateDefaultSettings();
72 void UpdatePersonaSettings();
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */