xref: /aoo4110/main/svx/inc/svx/fontworkgallery.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 
25 #ifndef _SVX_FONTWORK_GALLERY_DIALOG_HXX
26 #define _SVX_FONTWORK_GALLERY_DIALOG_HXX
27 
28 #include "svx/svxdllapi.h"
29 
30 #include <vcl/fixed.hxx>
31 #include <vcl/button.hxx>
32 #include <vcl/dialog.hxx>
33 #include <vcl/field.hxx>
34 
35 #include <svtools/valueset.hxx>
36 
37 #include <sfx2/tbxctrl.hxx>
38 
39 #include <vector>
40 
41 class FmFormModel;
42 class SdrView;
43 class Window;
44 class SdrTextObj;
45 class SdrObject;
46 class SdrModel;
47 
48 class SfxBindings;
49 class SfxStatusForwarder;
50 
51 //------------------------------------------------------------------------
52 
53 namespace svx
54 {
55 
56 class SVX_DLLPUBLIC FontWorkShapeTypeControl : public SfxToolBoxControl
57 {
58 	using SfxToolBoxControl::Select;
59 
60 public:
61 	SFX_DECL_TOOLBOX_CONTROL();
62 	FontWorkShapeTypeControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
63 	~FontWorkShapeTypeControl();
64 
65 	virtual void				Select( sal_Bool bMod1 = sal_False );
66 	virtual SfxPopupWindowType	GetPopupWindowType() const;
67 	virtual SfxPopupWindow*		CreatePopupWindow();
68 };
69 
70 //------------------------------------------------------------------------
71 
72 class FontworkCharacterSpacingDialog : public ModalDialog
73 {
74 	FixedText			maFLScale;
75 	MetricField			maMtrScale;
76 	OKButton			maOKButton;
77 	CancelButton		maCancelButton;
78 	HelpButton			maHelpButton;
79 
80 public:
81 	FontworkCharacterSpacingDialog( Window* pParent, sal_Int32 nScale );
82 	~FontworkCharacterSpacingDialog();
83 
84 	sal_Int32 getScale() const;
85 };
86 
87 
88 class SVX_DLLPUBLIC FontWorkGalleryDialog : public ModalDialog
89 {
90 	FixedLine			maFLFavorites;
91 	ValueSet			maCtlFavorites;
92 	OKButton			maOKButton;
93 	CancelButton		maCancelButton;
94 	HelpButton			maHelpButton;
95 
96 	sal_uInt16			mnThemeId;
97 
98 	SdrView*			mpSdrView;
99 	FmFormModel*		mpModel;
100 
101 	String				maStrClickToAddText;
102 
103 	DECL_LINK( DoubleClickFavoriteHdl, void * );
104 	DECL_LINK( ClickOKHdl, void * );
105 	DECL_LINK( ClickTextDirectionHdl, ImageButton * );
106 
107 	SdrObject**			mppSdrObject;
108 	SdrModel*			mpDestModel;
109 
110 	void			initFavorites(sal_uInt16 nThemeId);
111 	void			insertSelectedFontwork();
112 	void			changeText( SdrTextObj* pObj );
113 	void			fillFavorites(sal_uInt16 nThemeId);
114 
115 	std::vector< BitmapEx> maFavoritesHorizontal;
116 
117 public:
118 	FontWorkGalleryDialog( SdrView* pView, Window* pParent, sal_uInt16 nSID );
119 	~FontWorkGalleryDialog();
120 
121 	// SJ: if the SdrObject** is set, the SdrObject is not inserted into the page when executing the dialog
122 	void SetSdrObjectRef( SdrObject**, SdrModel* pModel );
123 };
124 
125 }
126 
127 #endif
128