update dev300-m58
[ooovba.git] / svx / source / cui / chardlg.hxx
blobe89ac291e79121dba126c33547fe80767c7fc955
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: chardlg.hxx,v $
10 * $Revision: 1.8.184.1 $
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 ************************************************************************/
30 #ifndef _SVX_CHARDLG_HXX
31 #define _SVX_CHARDLG_HXX
33 // include ---------------------------------------------------------------
35 #include <svtools/ctrlbox.hxx>
36 #include <svtools/stdctrl.hxx>
37 #include <sfx2/tabdlg.hxx>
38 #include <svx/fntctrl.hxx>
39 #include <svx/checklbx.hxx>
40 #include <svx/langbox.hxx>
42 // forward ---------------------------------------------------------------
44 class SvxFontListItem;
45 class FontList;
47 // -----------------------------------------------------------------------
49 #define DISABLE_CASEMAP ((USHORT)0x0001)
50 #define DISABLE_WORDLINE ((USHORT)0x0002)
51 #define DISABLE_BLINK ((USHORT)0x0004)
52 #define DISABLE_UNDERLINE_COLOR ((USHORT)0x0008)
54 #define DISABLE_LANGUAGE ((USHORT)0x0010)
55 #define DISABLE_HIDE_LANGUAGE ((USHORT)0x0020)
57 // class SvxCharBasePage -------------------------------------------------
59 class SvxCharBasePage : public SfxTabPage
61 protected:
62 SvxFontPrevWindow m_aPreviewWin;
63 FixedInfo m_aFontTypeFT;
65 BOOL m_bPreviewBackgroundToCharacter;
67 SvxCharBasePage( Window* pParent, const ResId& rResIdTabPage, const SfxItemSet&,
68 USHORT nResIdPrewievWin, USHORT nResIdFontTypeFT );
69 virtual ~SvxCharBasePage();
71 void SetPrevFontSize( const SfxItemSet& rSet, USHORT nSlot, SvxFont& rFont );
72 void SetPrevFont( const SfxItemSet& rSet, USHORT nSlot, SvxFont& rFont );
73 void SetPrevFontStyle( const SfxItemSet& rSet, USHORT nSlotPosture, USHORT nSlotWeight, SvxFont& rFont ); // posture/weight
74 void SetPrevFontWidthScale( const SfxItemSet& rSet );
76 void SetPrevFontEscapement( BYTE nProp, BYTE nEscProp, short nEsc );
78 inline SvxFont& GetPreviewFont();
79 inline SvxFont& GetPreviewCJKFont();
80 inline SvxFont& GetPreviewCTLFont();
82 public:
83 using SfxTabPage::ActivatePage;
84 using SfxTabPage::DeactivatePage;
86 virtual void ActivatePage( const SfxItemSet& rSet );
87 // virtual int DeactivatePage( SfxItemSet* pSet = 0 );
91 // class SvxCharNamePage -------------------------------------------------
93 struct SvxCharNamePage_Impl;
95 class SvxCharNamePage : public SvxCharBasePage
98 private:
99 FixedLine* m_pWestLine;
100 FixedText* m_pWestFontNameFT;
101 FontNameBox* m_pWestFontNameLB;
102 FixedText* m_pWestFontStyleFT;
103 FontStyleBox* m_pWestFontStyleLB;
104 FixedText* m_pWestFontSizeFT;
105 FontSizeBox* m_pWestFontSizeLB;
106 FixedText* m_pWestFontLanguageFT;
107 SvxLanguageBox* m_pWestFontLanguageLB;
109 FixedLine* m_pEastLine;
110 FixedText* m_pEastFontNameFT;
111 FontNameBox* m_pEastFontNameLB;
112 FixedText* m_pEastFontStyleFT;
113 FontStyleBox* m_pEastFontStyleLB;
114 FixedText* m_pEastFontSizeFT;
115 FontSizeBox* m_pEastFontSizeLB;
116 FixedText* m_pEastFontLanguageFT;
117 SvxLanguageBox* m_pEastFontLanguageLB;
119 FixedLine* m_pCTLLine;
120 FixedText* m_pCTLFontNameFT;
121 FontNameBox* m_pCTLFontNameLB;
122 FixedText* m_pCTLFontStyleFT;
123 FontStyleBox* m_pCTLFontStyleLB;
124 FixedText* m_pCTLFontSizeFT;
125 FontSizeBox* m_pCTLFontSizeLB;
126 FixedText* m_pCTLFontLanguageFT;
127 SvxLanguageBox* m_pCTLFontLanguageLB;
129 FixedLine* m_pColorFL;
130 FixedText* m_pColorFT;
131 ColorListBox* m_pColorLB;
133 SvxCharNamePage_Impl* m_pImpl;
135 SvxCharNamePage( Window* pParent, const SfxItemSet& rSet );
137 void Initialize();
138 const FontList* GetFontList() const;
139 void UpdatePreview_Impl();
140 void FillStyleBox_Impl( const FontNameBox* rBox );
141 void FillSizeBox_Impl( const FontNameBox* rBox );
143 enum LanguageGroup
145 /** Language for western text.
147 Western = 0,
149 /** Language for asian text.
151 Asian,
153 /** Language for ctl text.
158 void Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp );
159 BOOL FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp );
160 void ResetColor_Impl( const SfxItemSet& rSet );
161 BOOL FillItemSetColor_Impl( SfxItemSet& rSet );
163 DECL_LINK( UpdateHdl_Impl, Timer* );
164 DECL_LINK( FontModifyHdl_Impl, void* );
165 DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* );
167 public:
168 using SfxTabPage::ActivatePage;
169 using SfxTabPage::DeactivatePage;
171 virtual void ActivatePage( const SfxItemSet& rSet );
172 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
174 public:
175 ~SvxCharNamePage();
177 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
178 static USHORT* GetRanges();
180 virtual void Reset( const SfxItemSet& rSet );
181 virtual BOOL FillItemSet( SfxItemSet& rSet );
183 void SetFontList( const SvxFontListItem& rItem );
184 void EnableRelativeMode();
185 void EnableSearchMode();
186 // the writer uses SID_ATTR_BRUSH as font background
187 void SetPreviewBackgroundToCharacter();
189 void DisableControls( USHORT nDisable );
190 virtual void PageCreated (SfxAllItemSet aSet);
193 // class SvxCharEffectsPage ----------------------------------------------
195 class SvxCharEffectsPage : public SvxCharBasePage
198 private:
199 FixedText m_aFontColorFT;
200 ColorListBox m_aFontColorLB;
202 FixedText m_aEffectsFT;
203 SvxCheckListBox m_aEffectsLB;
205 ListBox m_aEffects2LB;
207 FixedText m_aReliefFT;
208 ListBox m_aReliefLB;
210 TriStateBox m_aOutlineBtn;
211 TriStateBox m_aShadowBtn;
212 TriStateBox m_aBlinkingBtn;
213 TriStateBox m_aHiddenBtn;
215 FixedLine m_aVerticalLine;
217 FixedText m_aOverlineFT;
218 ListBox m_aOverlineLB;
219 FixedText m_aOverlineColorFT;
220 ColorListBox m_aOverlineColorLB;
222 FixedText m_aStrikeoutFT;
223 ListBox m_aStrikeoutLB;
225 FixedText m_aUnderlineFT;
226 ListBox m_aUnderlineLB;
227 FixedText m_aUnderlineColorFT;
228 ColorListBox m_aUnderlineColorLB;
230 CheckBox m_aIndividualWordsBtn;
232 FixedLine m_aAsianLine;
234 FixedText m_aEmphasisFT;
235 ListBox m_aEmphasisLB;
237 FixedText m_aPositionFT;
238 ListBox m_aPositionLB;
240 USHORT m_nHtmlMode;
242 String m_aTransparentColorName;
244 SvxCharEffectsPage( Window* pParent, const SfxItemSet& rSet );
246 void Initialize();
247 void UpdatePreview_Impl();
248 void SetCaseMap_Impl( SvxCaseMap eCaseMap );
249 void ResetColor_Impl( const SfxItemSet& rSet );
250 BOOL FillItemSetColor_Impl( SfxItemSet& rSet );
252 DECL_LINK( SelectHdl_Impl, ListBox* );
253 DECL_LINK( CbClickHdl_Impl, CheckBox* );
254 DECL_LINK( TristClickHdl_Impl, TriStateBox* );
255 DECL_LINK( UpdatePreview_Impl, ListBox* );
256 DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* );
258 public:
259 // using SfxTabPage::ActivatePage;
260 using SfxTabPage::DeactivatePage;
262 // virtual void ActivatePage( const SfxItemSet& rSet );
263 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
265 public:
266 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
267 static USHORT* GetRanges();
269 virtual void Reset( const SfxItemSet& rSet );
270 virtual BOOL FillItemSet( SfxItemSet& rSet );
272 void DisableControls( USHORT nDisable );
273 void EnableFlash();
274 // the writer uses SID_ATTR_BRUSH as font background
275 void SetPreviewBackgroundToCharacter();
276 virtual void PageCreated (SfxAllItemSet aSet);
279 // class SvxCharPositionPage ---------------------------------------------
281 class SvxCharPositionPage : public SvxCharBasePage
284 private:
285 FixedLine m_aPositionLine;
286 RadioButton m_aHighPosBtn;
287 RadioButton m_aNormalPosBtn;
288 RadioButton m_aLowPosBtn;
289 FixedText m_aHighLowFT;
290 MetricField m_aHighLowEdit;
291 CheckBox m_aHighLowRB;
292 FixedText m_aFontSizeFT;
293 MetricField m_aFontSizeEdit;
294 FixedLine m_aRotationScalingFL;
295 FixedLine m_aScalingFL;
296 RadioButton m_a0degRB;
297 RadioButton m_a90degRB;
298 RadioButton m_a270degRB;
299 CheckBox m_aFitToLineCB;
300 FixedText m_aScaleWidthFT;
301 MetricField m_aScaleWidthMF;
303 FixedLine m_aKerningLine;
304 ListBox m_aKerningLB;
305 FixedText m_aKerningFT;
306 MetricField m_aKerningEdit;
307 CheckBox m_aPairKerningBtn;
309 short m_nSuperEsc;
310 short m_nSubEsc;
312 UINT16 m_nScaleWidthItemSetVal;
313 UINT16 m_nScaleWidthInitialVal;
315 BYTE m_nSuperProp;
316 BYTE m_nSubProp;
318 SvxCharPositionPage( Window* pParent, const SfxItemSet& rSet );
320 void Initialize();
321 void UpdatePreview_Impl( BYTE nProp, BYTE nEscProp, short nEsc );
322 void SetEscapement_Impl( USHORT nEsc );
324 DECL_LINK( PositionHdl_Impl, RadioButton* );
325 DECL_LINK( RotationHdl_Impl, RadioButton* );
326 DECL_LINK( FontModifyHdl_Impl, MetricField* );
327 DECL_LINK( AutoPositionHdl_Impl, CheckBox* );
328 DECL_LINK( FitToLineHdl_Impl, CheckBox* );
329 DECL_LINK( KerningSelectHdl_Impl, ListBox* );
330 DECL_LINK( KerningModifyHdl_Impl, MetricField* );
331 DECL_LINK( PairKerningHdl_Impl, CheckBox* );
332 DECL_LINK( LoseFocusHdl_Impl, MetricField* );
333 DECL_LINK( ScaleWidthModifyHdl_Impl, MetricField* );
335 public:
336 using SfxTabPage::ActivatePage;
337 using SfxTabPage::DeactivatePage;
339 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
340 virtual void ActivatePage( const SfxItemSet& rSet );
342 public:
343 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
344 static USHORT* GetRanges();
346 virtual void Reset( const SfxItemSet& rSet );
347 virtual BOOL FillItemSet( SfxItemSet& rSet );
348 virtual void FillUserData();
349 // the writer uses SID_ATTR_BRUSH as font background
350 void SetPreviewBackgroundToCharacter();
351 virtual void PageCreated (SfxAllItemSet aSet);
354 // class SvxCharTwoLinesPage ---------------------------------------------
356 class SvxCharTwoLinesPage : public SvxCharBasePage
358 private:
359 FixedLine m_aSwitchOnLine;
360 CheckBox m_aTwoLinesBtn;
362 FixedLine m_aEncloseLine;
363 FixedText m_aStartBracketFT;
364 ListBox m_aStartBracketLB;
365 FixedText m_aEndBracketFT;
366 ListBox m_aEndBracketLB;
368 USHORT m_nStartBracketPosition;
369 USHORT m_nEndBracketPosition;
371 SvxCharTwoLinesPage( Window* pParent, const SfxItemSet& rSet );
373 void UpdatePreview_Impl();
374 void Initialize();
375 void SelectCharacter( ListBox* pBox );
376 void SetBracket( sal_Unicode cBracket, BOOL bStart );
378 DECL_LINK( TwoLinesHdl_Impl, CheckBox* );
379 DECL_LINK( CharacterMapHdl_Impl, ListBox* );
381 public:
382 using SfxTabPage::ActivatePage;
383 using SfxTabPage::DeactivatePage;
385 virtual void ActivatePage( const SfxItemSet& rSet );
386 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
388 public:
389 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
390 static USHORT* GetRanges();
392 virtual void Reset( const SfxItemSet& rSet );
393 virtual BOOL FillItemSet( SfxItemSet& rSet );
394 // the writer uses SID_ATTR_BRUSH as font background
395 void SetPreviewBackgroundToCharacter();
396 virtual void PageCreated (SfxAllItemSet aSet);
399 #endif // #ifndef _SVX_CHARDLG_HXX