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 
19 namespace com::sun::star::ui { class XContextChangeEventListener; }
20 
22 class SystemWindow;
23 class SfxViewShell;
24 
27 {
29 public:
30  NotebookBar(Window* pParent, const OString& 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;
35 
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;
40 
41  void SetSystemWindow(SystemWindow* pSystemWindow);
42 
43  void StateChanged(const StateChangedType nStateChange ) override;
44 
45  void DataChanged(const DataChangedEvent& rDCEvt) override;
46 
47  void ControlListenerForCurrentController(bool bListen);
48  void StopListeningAllControllers();
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 
55 private:
57  css::uno::Reference<css::ui::XContextChangeEventListener> m_pEventListener;
58  std::set<css::uno::Reference<css::frame::XController>> m_alisteningControllers;
59  std::vector<NotebookbarContextControl*> m_pContextContainers;
60  css::uno::Reference<css::frame::XFrame> mxFrame;
62 
67 
70 
71  void UpdateBackground();
72 
73  void UpdateDefaultSettings();
74  void UpdatePersonaSettings();
75 };
76 
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AllSettings PersonaSettings
Definition: notebookbar.hxx:69
std::vector< NotebookbarContextControl * > m_pContextContainers
Definition: notebookbar.hxx:59
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
long Long
VclPtr< vcl::Window > m_xVclContentArea
Definition: notebookbar.hxx:63
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:260
PosSizeFlags
Definition: window.hxx:125
VclPtr< SystemWindow > m_pSystemWindow
Definition: notebookbar.hxx:56
StateChangedType
Definition: window.hxx:289
OUString m_sUIXMLDescription
Definition: notebookbar.hxx:65
std::set< css::uno::Reference< css::frame::XController > > m_alisteningControllers
Definition: notebookbar.hxx:58
css::uno::Reference< css::ui::XContextChangeEventListener > m_pEventListener
Definition: notebookbar.hxx:57
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:52
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
AllSettings DefaultSettings
Definition: notebookbar.hxx:68
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2658
virtual Size GetOptimalSize() const override
Definition: ctrl.cxx:374
VclPtr< vcl::Window > & GetMainContainer()
Definition: notebookbar.hxx:51
Link< const SfxViewShell *, void > m_rDisposeLink
Definition: notebookbar.hxx:66
virtual void Resize() override
Definition: ctrl.cxx:74
css::uno::Reference< css::frame::XFrame > mxFrame
Definition: notebookbar.hxx:60
Definition: ctrl.hxx:33
const SfxViewShell * m_pViewShell
Definition: notebookbar.hxx:61
bool IsWelded() const
Definition: notebookbar.hxx:50
bool m_bIsWelded
Definition: notebookbar.hxx:64
This implements Widget Layout-based notebook-like menu bar.
Definition: notebookbar.hxx:26
split from the main class since it needs different ref-counting mana
Definition: notebookbar.cxx:46
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:36
const OUString & GetUIFilePath() const
Definition: notebookbar.hxx:52