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;
121
122 virtual bool DoKeyInput(const KeyEvent& /*rKEvt*/);
123
125 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
126
127 void ReleaseFocus_Impl();
128};
129
131{
132public:
134 const uno::Reference<frame::XFrame>& xFrame);
135
136 virtual void dispose() override
137 {
138 m_xComboBox.reset();
140 }
141
142 virtual void GetFocus() override
143 {
144 if (m_xComboBox)
145 m_xComboBox->grab_focus();
147 }
148
149 virtual bool DoKeyInput(const KeyEvent& rKEvt) override;
150
151 virtual ~NavElementBox_Impl() override
152 {
153 disposeOnce();
154 }
155};
156
157class NavElementToolBoxControl : public svt::ToolboxController, public lang::XServiceInfo
158{
159public:
161 const css::uno::Reference< css::uno::XComponentContext >& rServiceManager );
162
163 // XInterface
164 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
165 virtual void SAL_CALL acquire() noexcept override;
166 virtual void SAL_CALL release() noexcept override;
167
168 // XServiceInfo
169 virtual OUString SAL_CALL getImplementationName() override;
170 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
171 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
172
173 // XComponent
174 virtual void SAL_CALL dispose() override;
175
176 // XStatusListener
177 virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
178
179 // XToolbarController
180 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
181 virtual void SAL_CALL click() override;
182 virtual void SAL_CALL doubleClick() override;
183 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override;
184 virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
185
187
188private:
190 std::unique_ptr<NavElementBox_Base> m_xWeldBox;
192};
193
194#endif
195/* 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:655
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:586
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:613
weld::ComboBox * GetComboBox()
Definition: workctrl.hxx:112
virtual void dispose() override
Definition: workctrl.hxx:136
NavElementBox_Impl(vcl::Window *pParent, const uno::Reference< frame::XFrame > &xFrame)
Definition: workctrl.cxx:605
virtual void GetFocus() override
Definition: workctrl.hxx:142
virtual ~NavElementBox_Impl() override
Definition: workctrl.hxx:151
virtual bool DoKeyInput(const KeyEvent &rKEvt) override
Definition: workctrl.cxx:660
VclPtr< NavElementBox_Impl > m_xVclBox
Definition: workctrl.hxx:189
virtual void SAL_CALL release() noexcept override
Definition: workctrl.cxx:693
NavElementBox_Base * m_pBox
Definition: workctrl.hxx:191
std::unique_ptr< NavElementBox_Base > m_xWeldBox
Definition: workctrl.hxx:190
NavElementToolBoxControl(const css::uno::Reference< css::uno::XComponentContext > &rServiceManager)
Definition: workctrl.cxx:670
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: workctrl.cxx:679
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: workctrl.cxx:699
virtual OUString SAL_CALL getImplementationName() override
Definition: workctrl.cxx:704
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow(const css::uno::Reference< css::awt::XWindow > &Parent) override
Definition: workctrl.cxx:769
virtual void SAL_CALL click() override
Definition: workctrl.cxx:756
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: workctrl.cxx:709
weld::ComboBox * GetComboBox()
Definition: workctrl.hxx:186
virtual void SAL_CALL dispose() override
Definition: workctrl.cxx:715
virtual void SAL_CALL doubleClick() override
Definition: workctrl.cxx:760
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
Definition: workctrl.cxx:764
virtual void SAL_CALL acquire() noexcept override
Definition: workctrl.cxx:688
virtual void SAL_CALL execute(sal_Int16 KeyModifier) override
Definition: workctrl.cxx:752
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
Definition: workctrl.cxx:726
virtual ~SwJumpToSpecificPageControl() override
Definition: workctrl.cxx:577
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:580
SwJumpToSpecificPageControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:570
SwPreviewZoomControl(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox &rTbx)
Definition: workctrl.cxx:480
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent) override
Definition: workctrl.cxx:508
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
Definition: workctrl.cxx:492
virtual ~SwPreviewZoomControl() override
Definition: workctrl.cxx:488
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