xref: /core/sw/source/uibase/inc/workctrl.hxx (revision d5d99478)
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>
24 
25 class PopupMenu;
26 class SwView;
27 
28 // double entry! hrc and hxx
29 // these Ids say what the buttons below the scrollbar are doing
30 #define NID_START   20000
31 #define NID_NEXT    20000
32 #define NID_PREV    20001
33 #define NID_TBL     20002
34 #define NID_FRM     20003
35 #define NID_PGE     20004
36 #define NID_DRW     20005
37 #define NID_CTRL    20006
38 #define NID_REG     20007
39 #define NID_BKM     20008
40 #define NID_GRF     20009
41 #define NID_OLE     20010
42 #define NID_OUTL    20011
43 #define NID_SEL     20012
44 #define NID_FTN     20013
45 #define NID_MARK    20014
46 #define NID_POSTIT  20015
47 #define NID_SRCH_REP 20016
48 #define NID_INDEX_ENTRY  20017
49 #define NID_TABLE_FORMULA   20018
50 #define NID_TABLE_FORMULA_ERROR     20019
51 #define NID_COUNT  20
52 
53 class SwTbxAutoTextCtrl : public SfxToolBoxControl
54 {
55 public:
56     SFX_DECL_TOOLBOX_CONTROL();
57 
58     SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
59     virtual ~SwTbxAutoTextCtrl() override;
60 
61     virtual VclPtr<SfxPopupWindow> CreatePopupWindow() override;
62     virtual void                StateChanged( sal_uInt16 nSID,
63                                               SfxItemState eState,
64                                               const SfxPoolItem* pState ) override;
65 
66     DECL_STATIC_LINK(SwTbxAutoTextCtrl, PopupHdl, Menu*, bool);
67 };
68 
69 class SwScrollNaviPopup;
70 
71 class SwScrollNaviToolBox : public ToolBox
72 {
73     VclPtr<SwScrollNaviPopup> m_pNaviPopup;
74 
75     virtual void    MouseButtonUp( const MouseEvent& rMEvt ) override;
76     virtual void    RequestHelp( const HelpEvent& rHEvt ) override;
77 
78 public:
79     SwScrollNaviToolBox(vcl::Window* pParent, SwScrollNaviPopup* pNaviPopup, WinBits nWinStyle)
80         : ToolBox(pParent, nWinStyle)
81         , m_pNaviPopup(pNaviPopup)
82     {
83     }
84     virtual ~SwScrollNaviToolBox() override;
85     virtual void dispose() override;
86 };
87 
88 class SwScrollNaviPopup : public SfxPopupWindow
89 {
90     VclPtr<SwScrollNaviToolBox> m_pToolBox;
91     VclPtr<FixedText>           m_pInfoField;
92 
93     OUString        sQuickHelp[2 * NID_COUNT];
94 
95 protected:
96     DECL_LINK(SelectHdl, ToolBox*, void);
97 
98 public:
99     SwScrollNaviPopup( sal_uInt16 nId, const css::uno::Reference< css::frame::XFrame >& rFrame, vcl::Window *pParent );
100     virtual ~SwScrollNaviPopup() override;
101     virtual void dispose() override;
102 
103     static OUString     GetToolTip(bool bNext);
104 
105     void                GrabFocus() { m_pToolBox->GrabFocus(); }
106 
107     virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
108 };
109 
110 class SwPreviewZoomControl : public SfxToolBoxControl
111 {
112 public:
113     SFX_DECL_TOOLBOX_CONTROL();
114 
115     SwPreviewZoomControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
116     virtual ~SwPreviewZoomControl() override;
117 
118     virtual void            StateChanged( sal_uInt16 nSID,
119                                               SfxItemState eState,
120                                               const SfxPoolItem* pState ) override;
121 
122     virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) override;
123 };
124 
125 class SwJumpToSpecificPageControl : public SfxToolBoxControl
126 {
127 public:
128     SFX_DECL_TOOLBOX_CONTROL();
129 
130     SwJumpToSpecificPageControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
131     virtual ~SwJumpToSpecificPageControl() override;
132 
133     virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) override;
134 };
135 #endif
136 
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
138