follow org.freedesktop.appearance.color-scheme setting
[LibreOffice.git] / include / sfx2 / weldutils.hxx
blobaaa2fe08a2e33b94cfed016aaff6e69a68b94ff5
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_WELDUTILS_HXX
11 #define INCLUDED_SFX2_WELDUTILS_HXX
13 #include <com/sun/star/frame/XFrame.hpp>
14 #include <com/sun/star/frame/XToolbarController.hpp>
16 #include <com/sun/star/uno/Reference.hxx>
17 #include <tools/link.hxx>
18 #include <sfx2/dllapi.h>
19 #include <svtools/miscopt.hxx>
20 #include <vcl/weld.hxx>
22 #include <map>
24 namespace weld
26 class Builder;
27 class Toolbar;
30 class SFX2_DLLPUBLIC ToolbarUnoDispatcher
32 private:
33 css::uno::Reference<css::frame::XFrame> m_xFrame;
34 SvtMiscOptions m_aToolbarOptions;
35 weld::Toolbar* m_pToolbar;
36 weld::Builder* m_pBuilder;
37 bool m_bSideBar;
39 DECL_DLLPRIVATE_LINK(SelectHdl, const OString&, void);
40 DECL_DLLPRIVATE_LINK(ToggleMenuHdl, const OString&, void);
41 DECL_DLLPRIVATE_LINK(ChangedIconSizeHandler, LinkParamNone*, void);
43 void CreateController(const OUString& rCommand);
44 static vcl::ImageType GetIconSize();
46 typedef std::map<OUString, css::uno::Reference<css::frame::XToolbarController>>
47 ControllerContainer;
48 ControllerContainer maControllers;
50 public:
51 // fill in the label and icons for actions and dispatch the action on item click
52 ToolbarUnoDispatcher(weld::Toolbar& rToolbar, weld::Builder& rBuilder,
53 const css::uno::Reference<css::frame::XFrame>& rFrame,
54 bool bSideBar = true);
56 css::uno::Reference<css::frame::XToolbarController>
57 GetControllerForCommand(const OUString& rCommand) const;
59 css::uno::Reference<css::frame::XFrame> GetFrame() const { return m_xFrame; }
61 void dispose();
62 ~ToolbarUnoDispatcher();
65 #endif
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */