merge the formfield patch from ooo-build
[ooovba.git] / svx / inc / fontworkgallery.hxx
blob77de26d54809fd4f5afdc1df674c7269f5e9f092
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fontworkgallery.hxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _SVX_FONTWORK_GALLERY_DIALOG_HXX
33 #define _SVX_FONTWORK_GALLERY_DIALOG_HXX
35 #ifndef _FIXED_HXX //autogen
36 #include <vcl/fixed.hxx>
37 #endif
38 #include <svtools/valueset.hxx>
39 #ifndef _SV_BUTTON_HXX
40 #include <vcl/button.hxx>
41 #endif
42 #include <vcl/dialog.hxx>
43 #include <sfx2/tbxctrl.hxx>
44 #include "svx/svxdllapi.h"
46 #include <vector>
48 class FmFormModel;
49 class SdrView;
50 class Window;
51 class SdrTextObj;
52 class SdrObject;
53 class SdrModel;
55 class SfxBindings;
56 class ToolbarMenu;
57 class SfxStatusForwarder;
59 //------------------------------------------------------------------------
61 namespace svx
64 class FontWorkAlignmentWindow : public SfxPopupWindow
66 using FloatingWindow::StateChanged;
67 private:
68 ToolbarMenu* mpMenu;
70 Image maImgAlgin1;
71 Image maImgAlgin2;
72 Image maImgAlgin3;
73 Image maImgAlgin4;
74 Image maImgAlgin5;
75 Image maImgAlgin1h;
76 Image maImgAlgin2h;
77 Image maImgAlgin3h;
78 Image maImgAlgin4h;
79 Image maImgAlgin5h;
81 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
83 bool mbPopupMode;
85 DECL_LINK( SelectHdl, void * );
87 void implSetAlignment( int nAlignmentMode, bool bEnabled );
88 void implInit();
90 protected:
91 virtual BOOL Close();
92 virtual void PopupModeEnd();
94 /** This function is called when the window gets the focus. It grabs
95 the focus to the line ends value set so that it can be controlled with
96 the keyboard.
98 virtual void GetFocus (void);
100 public:
101 FontWorkAlignmentWindow( USHORT nId,
102 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
103 FontWorkAlignmentWindow( USHORT nId,
104 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
105 Window* pParentWindow );
106 ~FontWorkAlignmentWindow();
108 void StartSelection();
110 virtual SfxPopupWindow* Clone() const;
112 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
113 virtual void DataChanged( const DataChangedEvent& rDCEvt );
116 class SVX_DLLPUBLIC FontWorkAlignmentControl : public SfxToolBoxControl
118 public:
119 SFX_DECL_TOOLBOX_CONTROL();
120 FontWorkAlignmentControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
121 ~FontWorkAlignmentControl();
123 virtual void StateChanged( USHORT nSID, SfxItemState eState,
124 const SfxPoolItem* pState );
125 virtual SfxPopupWindowType GetPopupWindowType() const;
126 virtual SfxPopupWindow* CreatePopupWindow();
129 //------------------------------------------------------------------------
131 class FontWorkCharacterSpacingWindow : public SfxPopupWindow
133 using FloatingWindow::StateChanged;
134 private:
135 ToolbarMenu* mpMenu;
137 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
139 bool mbPopupMode;
141 DECL_LINK( SelectHdl, void * );
143 void implSetCharacterSpacing( sal_Int32 nCharacterSpacing, bool bEnabled );
144 void implSetKernCharacterPairs( sal_Bool bKernOnOff, bool bEnabled );
145 void implInit();
147 protected:
148 virtual BOOL Close();
149 virtual void PopupModeEnd();
151 /** This function is called when the window gets the focus. It grabs
152 the focus to the line ends value set so that it can be controlled with
153 the keyboard.
155 virtual void GetFocus (void);
157 public:
158 FontWorkCharacterSpacingWindow( USHORT nId,
159 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
160 FontWorkCharacterSpacingWindow( USHORT nId,
161 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
162 Window* pParentWindow );
163 ~FontWorkCharacterSpacingWindow();
165 void StartSelection();
167 virtual SfxPopupWindow* Clone() const;
169 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
170 virtual void DataChanged( const DataChangedEvent& rDCEvt );
173 class SVX_DLLPUBLIC FontWorkCharacterSpacingControl : public SfxToolBoxControl
175 public:
176 SFX_DECL_TOOLBOX_CONTROL();
177 FontWorkCharacterSpacingControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
178 ~FontWorkCharacterSpacingControl();
180 virtual void StateChanged( USHORT nSID, SfxItemState eState,
181 const SfxPoolItem* pState );
182 virtual SfxPopupWindowType GetPopupWindowType() const;
183 virtual SfxPopupWindow* CreatePopupWindow();
186 //------------------------------------------------------------------------
188 class SVX_DLLPUBLIC FontWorkShapeTypeControl : public SfxToolBoxControl
190 using SfxToolBoxControl::Select;
192 public:
193 SFX_DECL_TOOLBOX_CONTROL();
194 FontWorkShapeTypeControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
195 ~FontWorkShapeTypeControl();
197 virtual void Select( BOOL bMod1 = FALSE );
198 virtual void StateChanged( USHORT nSID, SfxItemState eState,
199 const SfxPoolItem* pState );
200 virtual SfxPopupWindowType GetPopupWindowType() const;
201 virtual SfxPopupWindow* CreatePopupWindow();
204 //------------------------------------------------------------------------
206 class FontworkCharacterSpacingDialog : public ModalDialog
208 FixedText maFLScale;
209 MetricField maMtrScale;
210 OKButton maOKButton;
211 CancelButton maCancelButton;
212 HelpButton maHelpButton;
214 public:
215 FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale );
216 ~FontworkCharacterSpacingDialog();
218 sal_Int32 getScale() const;
222 class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog
224 ValueSet maCtlFavorites;
225 FixedLine maFLFavorites;
226 OKButton maOKButton;
227 CancelButton maCancelButton;
228 HelpButton maHelpButton;
230 sal_uInt16 mnThemeId;
232 SdrView* mpSdrView;
233 FmFormModel* mpModel;
235 String maStrClickToAddText;
237 DECL_LINK( DoubleClickFavoriteHdl, void * );
238 DECL_LINK( ClickOKHdl, void * );
239 DECL_LINK( ClickTextDirectionHdl, ImageButton * );
241 SdrObject** mppSdrObject;
242 SdrModel* mpDestModel;
244 void initfavorites(sal_uInt16 nThemeId, std::vector< Bitmap * >& rFavorites);
245 void insertSelectedFontwork();
246 void changeText( SdrTextObj* pObj );
247 void fillFavorites( sal_uInt16 nThemeId, std::vector< Bitmap * >& rFavorites );
249 std::vector< Bitmap * > maFavoritesHorizontal;
251 public:
252 FontWorkGalleryDialog( SdrView* pView, Window* pParent, sal_uInt16 nSID );
253 ~FontWorkGalleryDialog();
255 // SJ: if the SdrObject** is set, the SdrObject is not inserted into the page when executing the dialog
256 void SetSdrObjectRef( SdrObject**, SdrModel* pModel );
261 #endif