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 #ifndef INCLUDED_VCL_NOTEBOOKBAR_HXX
11 #define INCLUDED_VCL_NOTEBOOKBAR_HXX
12 
13 #include <vcl/builder.hxx>
14 #include <vcl/ctrl.hxx>
16 #include <vcl/settings.hxx>
17 #include <set>
18 #include <vector>
19 
20 namespace com::sun::star::ui { class XContextChangeEventListener; }
21 
23 class SystemWindow;
24 class SfxViewShell;
25 
28 {
30 public:
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(long nX, long nY, long nWidth, 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 ControlListenerForCurrentController(bool bListen);
49  void StopListeningAllControllers();
50 
51  bool IsWelded() { return m_bIsWelded; }
52  VclPtr<vcl::Window>& GetMainContainer() { return m_xVclContentArea; }
53  OUString GetUIFilePath() { return m_sUIXMLDescription; }
54  void SetDisposeCallback(const Link<const SfxViewShell*, void> rDisposeCallback, const SfxViewShell* pViewShell);
55 
56 private:
58  css::uno::Reference<css::ui::XContextChangeEventListener> m_pEventListener;
59  std::set<css::uno::Reference<css::frame::XController>> m_alisteningControllers;
60  std::vector<NotebookbarContextControl*> m_pContextContainers;
61  css::uno::Reference<css::frame::XFrame> mxFrame;
63 
68 
71 
72  void UpdateBackground();
73 
74  void UpdateDefaultSettings();
75  void UpdatePersonaSettings();
76 };
77 
78 #endif // INCLUDED_VCL_NOTEBOOKBAR_HXX
79 
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AllSettings PersonaSettings
Definition: notebookbar.hxx:70
std::vector< NotebookbarContextControl * > m_pContextContainers
Definition: notebookbar.hxx:60
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
VclPtr< vcl::Window > m_xVclContentArea
Definition: notebookbar.hxx:64
virtual void StateChanged(StateChangedType nStateChange) override
Definition: ctrl.cxx:260
PosSizeFlags
Definition: window.hxx:140
bool IsWelded()
Definition: notebookbar.hxx:51
VclPtr< SystemWindow > m_pSystemWindow
Definition: notebookbar.hxx:57
StateChangedType
Definition: window.hxx:310
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2713
OUString m_sUIXMLDescription
Definition: notebookbar.hxx:66
std::set< css::uno::Reference< css::frame::XController > > m_alisteningControllers
Definition: notebookbar.hxx:59
OUString GetUIFilePath()
Definition: notebookbar.hxx:53
css::uno::Reference< css::ui::XContextChangeEventListener > m_pEventListener
Definition: notebookbar.hxx:58
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:51
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:69
virtual Size GetOptimalSize() const override
Definition: ctrl.cxx:374
VclPtr< vcl::Window > & GetMainContainer()
Definition: notebookbar.hxx:52
Link< const SfxViewShell *, void > m_rDisposeLink
Definition: notebookbar.hxx:67
virtual void Resize() override
Definition: ctrl.cxx:74
css::uno::Reference< css::frame::XFrame > mxFrame
Definition: notebookbar.hxx:61
Definition: ctrl.hxx:33
const SfxViewShell * m_pViewShell
Definition: notebookbar.hxx:62
bool m_bIsWelded
Definition: notebookbar.hxx:65
This implements Widget Layout-based notebook-like menu bar.
Definition: notebookbar.hxx:27
split from the main class since it needs different ref-counting mana
Definition: notebookbar.cxx:42
virtual void DataChanged(const DataChangedEvent &rDCEvt)
Definition: event.cxx:35