LibreOffice Module sfx2 (master) 1
SidebarToolBox.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_SFX2_SIDEBAR_SIDEBARTOOLBOX_HXX
20#define INCLUDED_SFX2_SIDEBAR_SIDEBARTOOLBOX_HXX
21
22#include <vcl/builder.hxx>
23#include <vcl/toolbox.hxx>
24#include <map>
25
26namespace com::sun::star::frame { class XToolbarController; }
27
28namespace sfx2::sidebar {
29
35class SidebarToolBox : public ToolBox
36{
37public:
38 SidebarToolBox(vcl::Window* pParentWindow);
39 virtual ~SidebarToolBox() override;
40 virtual void dispose() override;
41
43
45 virtual void InsertItem(const OUString& rCommand,
46 const css::uno::Reference<css::frame::XFrame>& rFrame,
47 ToolBoxItemBits nBits,
48 const Size& rRequestedSize,
49 ImplToolItems::size_type nPos = APPEND) override;
50
51 virtual bool EventNotify(NotifyEvent& rEvent) override;
52 virtual void KeyInput( const KeyEvent& rKEvt ) override;
53
55
56protected:
57 css::uno::Reference<css::lang::XComponent> mxImageController;
58 typedef std::map<ToolBoxItemId, css::uno::Reference<css::frame::XToolbarController>> ControllerContainer;
63
64 DECL_LINK(DropDownClickHandler, ToolBox*, void);
65 DECL_LINK(ClickHandler, ToolBox*, void);
66 DECL_LINK(DoubleClickHandler, ToolBox*, void);
67 DECL_LINK(SelectHandler, ToolBox*, void);
68 DECL_LINK(ChangedIconHandler, LinkParamNone*, void );
69 DECL_LINK(ChangedDataHandler, const DataChangedEvent*, void );
70
71 css::uno::Reference<css::frame::XToolbarController> GetControllerForItemId(const ToolBoxItemId nItemId) const;
72
73 void CreateController(const ToolBoxItemId nItemId,
74 const css::uno::Reference<css::frame::XFrame>& rxFrame,
75 const sal_Int32 nItemWidth, bool bSideBar);
76 void RegisterHandlers();
77};
78
79
80} // end of namespace sfx2::sidebar
81
82#endif
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static constexpr auto APPEND
virtual void InsertItem(const OUString &rCommand, const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBoxItemBits nBits, const Size &rRequestedSize, ImplToolItems::size_type nPos=APPEND)
std::map< OUString, OUString > stringmap
The sidebar tool box has two responsibilities:
css::uno::Reference< css::frame::XToolbarController > GetControllerForItemId(const ToolBoxItemId nItemId) const
DECL_LINK(DropDownClickHandler, ToolBox *, void)
DECL_LINK(ChangedDataHandler, const DataChangedEvent *, void)
void CreateController(const ToolBoxItemId nItemId, const css::uno::Reference< css::frame::XFrame > &rxFrame, const sal_Int32 nItemWidth, bool bSideBar)
void InitToolBox(VclBuilder::stringmap &rMap)
SidebarToolBox(vcl::Window *pParentWindow)
DECL_LINK(DoubleClickHandler, ToolBox *, void)
css::uno::Reference< css::lang::XComponent > mxImageController
virtual void InsertItem(const OUString &rCommand, const css::uno::Reference< css::frame::XFrame > &rFrame, ToolBoxItemBits nBits, const Size &rRequestedSize, ImplToolItems::size_type nPos=APPEND) override
std::map< ToolBoxItemId, css::uno::Reference< css::frame::XToolbarController > > ControllerContainer
virtual bool EventNotify(NotifyEvent &rEvent) override
DECL_LINK(ClickHandler, ToolBox *, void)
virtual void dispose() override
ControllerContainer maControllers
virtual void KeyInput(const KeyEvent &rKEvt) override
DECL_LINK(ChangedIconHandler, LinkParamNone *, void)
virtual ToolBoxButtonSize GetDefaultButtonSize() const
virtual ~SidebarToolBox() override
DECL_LINK(SelectHandler, ToolBox *, void)
sal_uInt16 nPos
Definition: linksrc.cxx:118
ToolBoxButtonSize
ToolBoxItemBits