workaround segfault in compiler on macos-clang-intel
[LibreOffice.git] / include / sfx2 / notebookbar / SfxNotebookBar.hxx
blob47bd9cc7990133f3a479fb242de188789d935972
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 #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>
19 #include <memory>
20 #include <string_view>
22 namespace com::sun::star::frame
24 class XFrame;
26 namespace com::sun::star::uno
28 template <typename> class Reference;
31 class SfxBindings;
32 class SfxViewFrame;
33 class SfxViewShell;
34 class SystemWindow;
35 class ViewInstanceManager;
37 namespace sfx2
39 /** Helpers for easier access to NotebookBar via the sfx2 infrastructure.
41 class SFX2_DLLPUBLIC SfxNotebookBar
43 public:
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);
73 private:
74 static bool m_bLock;
75 static bool m_bHide;
77 static void ResetActiveToolbarModeToDefault(vcl::EnumContext::Application eApp);
78 static void RemoveCurrentLOKWrapper();
80 DECL_DLLPRIVATE_STATIC_LINK(SfxNotebookBar, VclDisposeHdl, const SfxViewShell*, void);
83 } // namespace sfx2
85 #endif // INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */