bump product version to 4.1.6.2
[LibreOffice.git] / include / svx / tbcontrl.hxx
blobb4bffeee4831f4e2303578a285569cea7a52bea9
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SVX_TBCONTRL_HXX
20 #define _SVX_TBCONTRL_HXX
22 /*--------------------------------------------------------------*\
24 Description:
25 -------------
26 ToolBox-Controller for:
27 Font-Name, Font-Height, Font-Color
28 Fore-/Background color /-patterns
29 Frames, Lines
30 (indentation-)templates
32 Use:
33 ----------
34 SvxFontNameToolBoxControl
35 -------------------------
36 Item type: SvxFontItem
37 Execute-Id: SID_ATTR_CHAR_FONT
38 -> SvxFontItem
39 Additional information
40 from DocShell: SvxFontListItem (SID_ATTR_CHAR_FONTLIST)
42 SvxFontColorToolBoxControl
43 --------------------------
44 Item type: SvxFontColorItem
45 Execute-Id: SID_ATTR_CHAR_COLOR
46 -> SvxFontColorItem
47 Additional information
48 from DocShell: presently none
49 in future: color palette
51 class SvxColorExtToolBoxControl
52 -----------------------------------
53 Item type: SvxColorItem
54 and SfxBoolItem
56 for font color (writer, ...)
57 Execute-Id SID_ATTR_CHAR_COLOR2
58 and SID_ATTR_CHAR_COLOR_EXT
60 for cell color (calc)
61 Execute-Id SID_ATTR_CHAR_COLOR
63 for character background color (writer)
64 Execute-Id SID_ATTR_CHAR_COLOR_BACKGROUND
65 and SID_ATTR_CHAR_COLOR_BACKGROUND_EXT
67 for paragraph background color (writer)
68 Execute-Id SID_BACKGROUND_COLOR
70 for cell background color (calc)
71 Execute-Id SID_ATTR_CHAR_COLOR_BACKGROUND
73 for table/cell border color (writer, calc)
74 Execute-Id SID_FRAME_LINECOLOR
76 SvxColorToolBoxControl
77 --------------------------------
78 Item type: SvxBrushItem
79 Execute-Id: SID_BACKGROUND_COLOR
80 -> SvxColorItem
82 SvxPatternToolBoxControl
83 ------------------------
84 Item type: SvxBrushItem
85 Execute-Id: SID_BACKGROUND_PATTERN
86 -> SvxBrushItem
87 Additional information
88 from DocShell: presently none
89 in future: color palette
90 Note: Analysis of BrushItem:
91 Brush-FillColor() is misused as switch,
92 to distinguish whether a new style
93 or a new color has been set
95 GetFillColor() == COL_BLACK -> GetStyle() ,
96 GetFillColor() == COL_WHITE -> GetColor()
98 SvxFrameToolBoxControl
99 ----------------------
100 Item type: SvxBoxItem
101 Execute-Id: SID_ATTR_BORDER
102 -> SvxBoxItem & SvxBoxInfoItem
103 Additional information
104 from DocShell: none
105 Bemerkung: provides dependant of chosen ValueSet-Item
106 only SvxBoxItem or additionally SvxBoxInfoItem
107 If the Controller ein SfxUInt16Item receives a
108 value != 0, paragraph mode will be switched on,
109 i.e. the last line will be hidden.
110 A value == 0 switches again to Tabel mode.
112 SvxFrameLineStyleToolBoxControl
113 -------------------------------
114 Item type: SvxLineItem
115 Execute-Id: SID_FRAME_LINESTYLE
116 -> SvxLineItem
117 Additional information
118 from DocShell: none
119 Bemerkung: provides a SvxLineItem, which provides a SvxBorderLine
120 without color information.
122 SvxFrameLineColorToolBoxControl
123 -------------------------------
124 Item type: SvxColorItem
125 Execute-Id: SID_FRAME_LINECOLOR
126 -> SvxColorItem
127 Additional information
128 from DocShell: none
130 SvxStyleToolBoxControl
131 ----------------------
132 Item type: SfxTemplateItem
133 Execute-Id: SID_TEMPLATE_APPLY
134 -> StyleName (SfxStringItem)
135 -> eStyleFamily (SfxUInt16Item)
136 Additional information
137 from DocShell: none
138 Bemerkung: Switch family by Invalidate
139 at the Bindings (->SfxStyleControllerItem)
141 \*--------------------------------------------------------------*/
143 // ITEMID_...-Defines i *.cxx
145 #include <rsc/rscsfx.hxx>
146 #include <svl/lstner.hxx>
147 #include <sfx2/tbxctrl.hxx>
148 #include <svx/strarray.hxx>
149 #include "svx/svxdllapi.h"
151 #include <com/sun/star/awt/FontDescriptor.hpp>
153 // important im tbxctrls.hxx created HeDaBu !!!
154 class SvxLineItem;
155 class SvxBoxInfoItem;
156 class SvxFontItem;
157 class SfxStyleControllerItem_Impl;
158 class SfxStyleSheetBasePool;
159 class SfxTemplateItem;
161 namespace svx
163 class ToolboxButtonColorUpdater;
165 //########################################################################
167 //========================================================================
168 // class SvxStyleToolBoxControl ------------------------------------------
169 //========================================================================
170 class SVX_DLLPUBLIC SvxStyleToolBoxControl : public SfxToolBoxControl
172 struct Impl;
173 public:
174 SFX_DECL_TOOLBOX_CONTROL();
176 SvxStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
177 ~SvxStyleToolBoxControl();
179 virtual Window* CreateItemWindow( Window *pParent );
181 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
182 const SfxPoolItem* pState );
184 DECL_LINK( VisibilityNotification, void* );
185 protected:
186 // XInitialization
187 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
189 // XUpdatable
190 virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
192 // XComponent
193 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
195 private:
197 #define MAX_FAMILIES 5
199 SfxStyleSheetBasePool* pStyleSheetPool;
200 SfxStyleControllerItem_Impl* pBoundItems [MAX_FAMILIES];
201 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xBoundItems[MAX_FAMILIES];
202 SfxTemplateItem* pFamilyState[MAX_FAMILIES];
203 sal_uInt16 nActFamily; // Id in the ToolBox = Position - 1
204 String aCurSel;
205 Impl* pImpl;
207 SVX_DLLPRIVATE void Update();
208 SVX_DLLPRIVATE void FillStyleBox();
209 SVX_DLLPRIVATE void SelectStyle( const String& rStyleName );
211 friend class SfxStyleControllerItem_Impl;
213 SVX_DLLPRIVATE void SetFamilyState ( sal_uInt16 nIdx, const SfxTemplateItem* pItem );
214 SVX_DLLPRIVATE SfxStyleFamily GetActFamily ();
217 //========================================================================
218 // class SvxFontNameToolBoxControl ---------------------------------------
219 //========================================================================
222 class SVX_DLLPUBLIC SvxFontNameToolBoxControl : public SfxToolBoxControl
224 public:
225 SFX_DECL_TOOLBOX_CONTROL();
226 SvxFontNameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
228 virtual void StateChanged ( sal_uInt16 nSID, SfxItemState eState,
229 const SfxPoolItem* pState );
230 virtual Window* CreateItemWindow ( Window *pParent );
235 //========================================================================
236 // class SvxFontColorToolBoxControl --------------------------------------
237 //========================================================================
241 class SVX_DLLPUBLIC SvxFontColorToolBoxControl : public SfxToolBoxControl
243 ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
244 Color mLastColor;
246 public:
247 SFX_DECL_TOOLBOX_CONTROL();
248 SvxFontColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
249 ~SvxFontColorToolBoxControl();
251 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
252 const SfxPoolItem* pState );
253 virtual SfxPopupWindowType GetPopupWindowType() const;
254 virtual SfxPopupWindow* CreatePopupWindow();
259 //========================================================================
260 // class SvxColorExtToolBoxControl --------------------------------------
261 //========================================================================
265 class SVX_DLLPUBLIC SvxColorExtToolBoxControl : public SfxToolBoxControl
267 using SfxToolBoxControl::StateChanged;
268 using SfxToolBoxControl::Select;
270 // SfxStatusForwarder aForward;
271 ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
272 Color mLastColor;
273 sal_Bool bChoiceFromPalette;
275 public:
276 SFX_DECL_TOOLBOX_CONTROL();
277 SvxColorExtToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
278 ~SvxColorExtToolBoxControl();
280 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
281 const SfxPoolItem* pState );
282 virtual SfxPopupWindowType GetPopupWindowType() const;
283 virtual SfxPopupWindow* CreatePopupWindow();
284 virtual void Select( sal_Bool bMod1 = sal_False );
289 //========================================================================
290 // class SvxColorToolBoxControl ------------------------------------------
291 //========================================================================
294 class SVX_DLLPUBLIC SvxColorToolBoxControl : public SfxToolBoxControl
296 ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
297 Color mLastColor;
299 public:
300 SvxColorToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
301 ~SvxColorToolBoxControl();
303 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
304 const SfxPoolItem* pState );
305 virtual SfxPopupWindowType GetPopupWindowType() const;
306 virtual SfxPopupWindow* CreatePopupWindow();
311 //========================================================================
312 // class SvxFrameToolBoxControl ------------------------------------------
313 //========================================================================
316 class SVX_DLLPUBLIC SvxFrameToolBoxControl : public SfxToolBoxControl
318 public:
319 SFX_DECL_TOOLBOX_CONTROL();
320 SvxFrameToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
322 virtual SfxPopupWindowType GetPopupWindowType() const;
323 virtual SfxPopupWindow* CreatePopupWindow();
324 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
325 const SfxPoolItem* pState );
331 //========================================================================
332 // class SvxLineStyleToolBoxControl --------------------------------------
333 //========================================================================
336 class SVX_DLLPUBLIC SvxFrameLineStyleToolBoxControl : public SfxToolBoxControl
338 public:
339 SFX_DECL_TOOLBOX_CONTROL();
340 SvxFrameLineStyleToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
342 virtual SfxPopupWindowType GetPopupWindowType() const;
343 virtual SfxPopupWindow* CreatePopupWindow();
344 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
345 const SfxPoolItem* pState );
350 //========================================================================
351 // class SvxFrameLineColorToolBoxControl ---------------------------------
352 //========================================================================
355 class SVX_DLLPUBLIC SvxFrameLineColorToolBoxControl : public SfxToolBoxControl
357 ::svx::ToolboxButtonColorUpdater* pBtnUpdater;
358 Color mLastColor;
360 public:
361 SFX_DECL_TOOLBOX_CONTROL();
362 SvxFrameLineColorToolBoxControl( sal_uInt16 nSlotId,
363 sal_uInt16 nId,
364 ToolBox& rTbx );
365 ~SvxFrameLineColorToolBoxControl();
367 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
368 const SfxPoolItem* pState );
369 virtual SfxPopupWindowType GetPopupWindowType() const;
370 virtual SfxPopupWindow* CreatePopupWindow();
373 class SVX_DLLPUBLIC SvxSimpleUndoRedoController : public SfxToolBoxControl
375 private:
376 OUString aDefaultText;
378 public:
379 SFX_DECL_TOOLBOX_CONTROL();
380 SvxSimpleUndoRedoController( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
381 ~SvxSimpleUndoRedoController();
383 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
384 const SfxPoolItem* pState );
387 #endif // #ifndef _SVX_TBCONTRL_HXX
389 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */