1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_VCL_NOTEBOOKBAR_HXX
11 #define INCLUDED_VCL_NOTEBOOKBAR_HXX
13 #include <vcl/builder.hxx>
14 #include <vcl/ctrl.hxx>
15 #include <vcl/NotebookBarAddonsMerger.hxx>
16 #include <vcl/settings.hxx>
20 namespace com
{ namespace sun
{ namespace star
{ namespace ui
{ class XContextChangeEventListener
; } } } }
22 class NotebookbarContextControl
;
26 /// This implements Widget Layout-based notebook-like menu bar.
27 class VCL_DLLPUBLIC NotebookBar final
: public Control
, public VclBuilderContainer
29 friend class NotebookBarContextChangeEventListener
;
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
;
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
;
42 void SetSystemWindow(SystemWindow
* pSystemWindow
);
44 void StateChanged(const StateChangedType nStateChange
) override
;
46 void DataChanged(const DataChangedEvent
& rDCEvt
) override
;
48 void ControlListenerForCurrentController(bool bListen
);
49 void StopListeningAllControllers();
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
);
57 VclPtr
<SystemWindow
> m_pSystemWindow
;
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
;
62 const SfxViewShell
* m_pViewShell
;
64 VclPtr
<vcl::Window
> m_xVclContentArea
;
66 OUString m_sUIXMLDescription
;
67 Link
<const SfxViewShell
*, void> m_rDisposeLink
;
69 AllSettings DefaultSettings
;
70 AllSettings PersonaSettings
;
72 void UpdateBackground();
74 void UpdateDefaultSettings();
75 void UpdatePersonaSettings();
78 #endif // INCLUDED_VCL_NOTEBOOKBAR_HXX
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */