LibreOffice Module sw (master) 1
workctrl.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_SW_SOURCE_UIBASE_INC_WORKCTRL_HXX
20#define INCLUDED_SW_SOURCE_UIBASE_INC_WORKCTRL_HXX
21
22#include <sfx2/tbxctrl.hxx>
23#include <vcl/toolbox.hxx>
25#include <com/sun/star/lang/XServiceInfo.hpp>
26
27class PopupMenu;
28class SwView;
29
30using namespace ::com::sun::star;
31
32// double entry! hrc and hxx
33// these Ids say what the buttons below the scrollbar are doing
34#define NID_START 20000
35#define NID_TBL 20000
36#define NID_FRM 20001
37#define NID_PGE 20002
38#define NID_DRW 20003
39#define NID_CTRL 20004
40#define NID_REG 20005
41#define NID_BKM 20006
42#define NID_GRF 20007
43#define NID_OLE 20008
44#define NID_OUTL 20009
45#define NID_SEL 20010
46#define NID_FTN 20011
47#define NID_MARK 20012
48#define NID_POSTIT 20013
49#define NID_SRCH_REP 20014
50#define NID_INDEX_ENTRY 20015
51#define NID_TABLE_FORMULA 20016
52#define NID_TABLE_FORMULA_ERROR 20017
53#define NID_RECENCY 20018
54#define NID_FIELD 20019
55#define NID_FIELD_BYTYPE 20020
56#define NID_COUNT 21
57
59{
60public:
62
63 SwTbxAutoTextCtrl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
64 virtual ~SwTbxAutoTextCtrl() override;
65
66 virtual void CreatePopupWindow() override;
67 virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID,
68 SfxItemState eState,
69 const SfxPoolItem* pState ) override;
70
72};
73
75{
76public:
78
79 SwPreviewZoomControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
80 virtual ~SwPreviewZoomControl() override;
81
82 virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID,
83 SfxItemState eState,
84 const SfxPoolItem* pState ) override;
85
86 virtual VclPtr<InterimItemWindow> CreateItemWindow( vcl::Window *pParent ) override;
87};
88
90{
91public:
93
94 SwJumpToSpecificPageControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
95 virtual ~SwJumpToSpecificPageControl() override;
96
97 virtual VclPtr<InterimItemWindow> CreateItemWindow( vcl::Window *pParent ) override;
98};
99
101
103{
104public:
105 NavElementBox_Base(std::unique_ptr<weld::ComboBox> xComboBox,
106 uno::Reference<frame::XFrame> xFrame);
107
109
110 void set_sensitive(bool bSensitive) {m_xComboBox->set_sensitive(bSensitive);}
111
113
114 void UpdateBox();
115
116
117protected:
118 std::unique_ptr<weld::ComboBox> m_xComboBox;
119 uno::Reference< frame::XFrame > m_xFrame;
120
121 virtual bool DoKeyInput(const KeyEvent& /*rKEvt*/);
122
124 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
125
126 void ReleaseFocus_Impl();
127};
128
130{
131public:
133 const uno::Reference<frame::XFrame>& xFrame);
134
135 virtual void dispose() override
136 {
137 m_xComboBox.reset();
139 }
140
141 virtual void GetFocus() override
142 {
143 if (m_xComboBox)
144 m_xComboBox->grab_focus();
146 }
147
148 virtual bool DoKeyInput(const KeyEvent& rKEvt) override;
149
150 virtual ~NavElementBox_Impl() override
151 {
152 disposeOnce();
153 }
154};
155
156typedef cppu::ImplInheritanceHelper< ::svt::ToolboxController, lang::XServiceInfo> NavElementToolBoxControl_Base;
158{
159public:
161 const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
162
163 // XServiceInfo
164 virtual OUString SAL_CALL getImplementationName() override;
165 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
166 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
167
168 // XComponent
169 virtual void SAL_CALL dispose() override;
170
171 // XStatusListener
172 virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
173
174 // XToolbarController
175 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
176 virtual void SAL_CALL click() override;
177 virtual void SAL_CALL doubleClick() override;
178 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override;
179 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
180
182
183private:
185 std::unique_ptr<NavElementBox_Base> m_xWeldBox;
187};
188
189#endif
190/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void dispose() override
virtual void GetFocus() override
virtual ~NavElementBox_Base()
Definition: workctrl.hxx:108
std::unique_ptr< weld::ComboBox > m_xComboBox
Definition: workctrl.hxx:118
virtual bool DoKeyInput(const KeyEvent &)
Definition: workctrl.cxx:654
DECL_STATIC_LINK(NavElementBox_Base, SelectHdl, weld::ComboBox &, void)
NavElementBox_Base(std::unique_ptr< weld::ComboBox > xComboBox, uno::Reference< frame::XFrame > xFrame)
Definition: workctrl.cxx:589
DECL_LINK(KeyInputHdl, const KeyEvent &, bool)
void set_sensitive(bool bSensitive)
Definition: workctrl.hxx:110
uno::Reference< frame::XFrame > m_xFrame
Definition: workctrl.hxx:119
void ReleaseFocus_Impl()
Definition: workctrl.cxx:615
weld::ComboBox * GetComboBox()
Definition: workctrl.hxx:112
virtual void dispose() override
Definition: workctrl.hxx:135
NavElementBox_Impl(vcl::Window *pParent, const uno::Reference< frame::XFrame > &xFrame)
Definition: workctrl.cxx:607
virtual void GetFocus() override
Definition: workctrl.hxx:141
virtual ~NavElementBox_Impl() override
Definition: workctrl.hxx:150
virtual bool DoKeyInput(const KeyEvent &rKEvt) override
Definition: workctrl.cxx:659
VclPtr< NavElementBox_Impl > m_xVclBox
Definition: workctrl.hxx:184
NavElementBox_Base * m_pBox
Definition: workctrl.hxx:186
std::unique_ptr< NavElementBox_Base > m_xWeldBox
Definition: workctrl.hxx:185
NavElementToolBoxControl(const css::uno::Reference< css::uno::XComponentContext > &rServiceManager)
Definition: workctrl.cxx:669
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: workctrl.cxx:678
virtual OUString SAL_CALL getImplementationName() override
Definition: workctrl.cxx:683
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow(const css::uno::Reference< css::awt::XWindow > &Parent) override
Definition: workctrl.cxx:748
virtual void SAL_CALL click() override
Definition: workctrl.cxx:735
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: workctrl.cxx:688
weld::ComboBox * GetComboBox()
Definition: workctrl.hxx:181
virtual void SAL_CALL dispose() override
Definition: workctrl.cxx:694
virtual void SAL_CALL doubleClick() override
Definition: workctrl.cxx:739
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
Definition: workctrl.cxx:743
virtual void SAL_CALL execute(sal_Int16 KeyModifier) override
Definition: workctrl.cxx:731
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
Definition: workctrl.cxx:705
virtual ~SwJumpToSpecificPageControl() override
Definition: workctrl.cxx:580
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:583
SwJumpToSpecificPageControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:573
SwPreviewZoomControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:481
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:509
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:493
virtual ~SwPreviewZoomControl() override
Definition: workctrl.cxx:489
DECL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu *, bool)
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:125
virtual void CreatePopupWindow() override
Definition: workctrl.cxx:78
SwTbxAutoTextCtrl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:65
virtual ~SwTbxAutoTextCtrl() override
Definition: workctrl.cxx:74
Definition: view.hxx:146
SfxItemState
Reference< XFrame > xFrame
unsigned char sal_Bool
cppu::ImplInheritanceHelper< ::svt::ToolboxController, lang::XServiceInfo > NavElementToolBoxControl_Base
Definition: workctrl.hxx:156