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_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX
11 #define INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX
13 #include <sfx2/dllapi.h>
14 #include <rtl/ustring.hxx>
15 #include <vcl/notebookbar/notebookbar.hxx>
16 #include <vcl/WeldedTabbedNotebookbar.hxx>
17 #include <vcl/EnumContext.hxx>
20 #include <string_view>
22 namespace com::sun::star::frame
26 namespace com::sun::star::uno
28 template <typename
> class Reference
;
35 class ViewInstanceManager
;
39 /** Helpers for easier access to NotebookBar via the sfx2 infrastructure.
41 class SFX2_DLLPUBLIC SfxNotebookBar
44 static void CloseMethod(SfxBindings
& rBindings
);
45 static void CloseMethod(SystemWindow
* pSysWindow
);
47 static bool IsActive(bool bConsiderSingleToolbar
= false);
49 /// Function to be called from the sdi's ExecMethod.
50 static void ExecMethod(SfxBindings
& rBindings
, const OUString
& rUIName
);
52 /// Function to be called from the sdi's StateMethod.
53 static bool StateMethod(SfxBindings
& rBindings
, std::u16string_view rUIFile
,
54 bool bReloadNotebookbar
= false);
55 static bool StateMethod(SystemWindow
* pSysWindow
,
56 const css::uno::Reference
<css::frame::XFrame
>& xFrame
,
57 std::u16string_view rUIFile
, bool bReloadNotebookbar
= false);
59 /// Method temporarily blocks showing of the NotebookBar
60 static void LockNotebookBar();
61 /// Method restores normal behaviour of the Notebookbar
62 static void UnlockNotebookBar();
64 static void RemoveListeners(SystemWindow
const* pSysWindow
);
66 /** Show menu bar in all frames of current application */
67 static void ShowMenubar(bool bShow
);
68 /** Show menu bar only in current frame */
69 static void ShowMenubar(SfxViewFrame
const* pViewFrame
, bool bShow
);
70 static void ToggleMenubar();
71 static void ReloadNotebookBar(std::u16string_view sUIPath
);
77 static void ResetActiveToolbarModeToDefault(vcl::EnumContext::Application eApp
);
78 static void RemoveCurrentLOKWrapper();
80 DECL_DLLPRIVATE_STATIC_LINK(SfxNotebookBar
, VclDisposeHdl
, const SfxViewShell
*, void);
85 #endif // INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */