1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fontworkgallery.hxx,v $
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>
38 #include <svtools/valueset.hxx>
39 #ifndef _SV_BUTTON_HXX
40 #include <vcl/button.hxx>
42 #include <vcl/dialog.hxx>
43 #include <sfx2/tbxctrl.hxx>
44 #include "svx/svxdllapi.h"
57 class SfxStatusForwarder
;
59 //------------------------------------------------------------------------
64 class FontWorkAlignmentWindow
: public SfxPopupWindow
66 using FloatingWindow::StateChanged
;
81 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> mxFrame
;
85 DECL_LINK( SelectHdl
, void * );
87 void implSetAlignment( int nAlignmentMode
, bool bEnabled
);
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
98 virtual void GetFocus (void);
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
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
;
137 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> mxFrame
;
141 DECL_LINK( SelectHdl
, void * );
143 void implSetCharacterSpacing( sal_Int32 nCharacterSpacing
, bool bEnabled
);
144 void implSetKernCharacterPairs( sal_Bool bKernOnOff
, bool bEnabled
);
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
155 virtual void GetFocus (void);
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
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
;
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
209 MetricField maMtrScale
;
211 CancelButton maCancelButton
;
212 HelpButton maHelpButton
;
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
;
227 CancelButton maCancelButton
;
228 HelpButton maHelpButton
;
230 sal_uInt16 mnThemeId
;
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
;
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
);