update credits
[LibreOffice.git] / cui / source / inc / chardlg.hxx
blob422ffdff4dfd49f970cb6f6261763baadae165a5
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_CHARDLG_HXX
20 #define _SVX_CHARDLG_HXX
22 #include <svtools/ctrlbox.hxx>
23 #include <svtools/stdctrl.hxx>
24 #include <sfx2/tabdlg.hxx>
25 #include <svx/fntctrl.hxx>
26 #include <svx/checklbx.hxx>
27 #include <svx/langbox.hxx>
28 #include <vcl/layout.hxx>
30 // forward ---------------------------------------------------------------
32 class SvxFontListItem;
33 class FontList;
35 // -----------------------------------------------------------------------
37 #define DISABLE_CASEMAP ((sal_uInt16)0x0001)
38 #define DISABLE_WORDLINE ((sal_uInt16)0x0002)
39 #define DISABLE_BLINK ((sal_uInt16)0x0004)
40 #define DISABLE_UNDERLINE_COLOR ((sal_uInt16)0x0008)
42 #define DISABLE_LANGUAGE ((sal_uInt16)0x0010)
43 #define DISABLE_HIDE_LANGUAGE ((sal_uInt16)0x0020)
45 // class SvxCharBasePage -------------------------------------------------
47 class SvxCharBasePage : public SfxTabPage
49 protected:
50 SvxFontPrevWindow* m_pPreviewWin;
52 sal_Bool m_bPreviewBackgroundToCharacter;
54 SvxCharBasePage(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet& rItemset);
56 virtual ~SvxCharBasePage();
58 void SetPrevFontWidthScale( const SfxItemSet& rSet );
59 void SetPrevFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
61 inline SvxFont& GetPreviewFont();
62 inline SvxFont& GetPreviewCJKFont();
63 inline SvxFont& GetPreviewCTLFont();
65 public:
66 using SfxTabPage::ActivatePage;
67 using SfxTabPage::DeactivatePage;
69 virtual void ActivatePage( const SfxItemSet& rSet );
73 // class SvxCharNamePage -------------------------------------------------
75 struct SvxCharNamePage_Impl;
77 class SvxCharNamePage : public SvxCharBasePage
80 private:
81 VclContainer* m_pWestFrame;
82 FixedText* m_pWestFontNameFT;
83 FontNameBox* m_pWestFontNameLB;
84 FixedText* m_pWestFontStyleFT;
85 FontStyleBox* m_pWestFontStyleLB;
86 FixedText* m_pWestFontSizeFT;
87 FontSizeBox* m_pWestFontSizeLB;
88 FixedText* m_pWestFontLanguageFT;
89 SvxLanguageBox* m_pWestFontLanguageLB;
90 FixedText* m_pWestFontTypeFT;
92 VclContainer* m_pEastFrame;
93 FixedText* m_pEastFontNameFT;
94 FontNameBox* m_pEastFontNameLB;
95 FixedText* m_pEastFontStyleFT;
96 FontStyleBox* m_pEastFontStyleLB;
97 FixedText* m_pEastFontSizeFT;
98 FontSizeBox* m_pEastFontSizeLB;
99 FixedText* m_pEastFontLanguageFT;
100 SvxLanguageBox* m_pEastFontLanguageLB;
101 FixedText* m_pEastFontTypeFT;
103 VclContainer* m_pCTLFrame;
104 FixedText* m_pCTLFontNameFT;
105 FontNameBox* m_pCTLFontNameLB;
106 FixedText* m_pCTLFontStyleFT;
107 FontStyleBox* m_pCTLFontStyleLB;
108 FixedText* m_pCTLFontSizeFT;
109 FontSizeBox* m_pCTLFontSizeLB;
110 FixedText* m_pCTLFontLanguageFT;
111 SvxLanguageBox* m_pCTLFontLanguageLB;
112 FixedText* m_pCTLFontTypeFT;
114 SvxCharNamePage_Impl* m_pImpl;
116 SvxCharNamePage( Window* pParent, const SfxItemSet& rSet );
118 void Initialize();
119 const FontList* GetFontList() const;
120 void UpdatePreview_Impl();
121 void FillStyleBox_Impl( const FontNameBox* rBox );
122 void FillSizeBox_Impl( const FontNameBox* rBox );
124 enum LanguageGroup
126 /** Language for western text.
128 Western = 0,
130 /** Language for asian text.
132 Asian,
134 /** Language for ctl text.
139 void Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp );
140 sal_Bool FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp );
142 DECL_LINK(UpdateHdl_Impl, void *);
143 DECL_LINK( FontModifyHdl_Impl, void* );
145 public:
146 using SfxTabPage::ActivatePage;
147 using SfxTabPage::DeactivatePage;
149 virtual void ActivatePage( const SfxItemSet& rSet );
150 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
152 public:
153 ~SvxCharNamePage();
155 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
156 static sal_uInt16* GetRanges();
158 virtual void Reset( const SfxItemSet& rSet );
159 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
161 void SetFontList( const SvxFontListItem& rItem );
162 void EnableRelativeMode();
163 void EnableSearchMode();
164 /// the writer uses SID_ATTR_BRUSH as font background
165 void SetPreviewBackgroundToCharacter();
167 void DisableControls( sal_uInt16 nDisable );
168 virtual void PageCreated (SfxAllItemSet aSet);
171 // class SvxCharEffectsPage ----------------------------------------------
173 class SvxCharEffectsPage : public SvxCharBasePage
176 private:
177 FixedText* m_pFontColorFT;
178 ColorListBox* m_pFontColorLB;
180 FixedText* m_pEffectsFT;
181 ListBox* m_pEffectsLB;
183 FixedText* m_pReliefFT;
184 ListBox* m_pReliefLB;
186 TriStateBox* m_pOutlineBtn;
187 TriStateBox* m_pShadowBtn;
188 TriStateBox* m_pBlinkingBtn;
189 TriStateBox* m_pHiddenBtn;
191 ListBox* m_pOverlineLB;
192 FixedText* m_pOverlineColorFT;
193 ColorListBox* m_pOverlineColorLB;
195 ListBox* m_pStrikeoutLB;
197 ListBox* m_pUnderlineLB;
198 FixedText* m_pUnderlineColorFT;
199 ColorListBox* m_pUnderlineColorLB;
201 CheckBox* m_pIndividualWordsBtn;
203 FixedText* m_pEmphasisFT;
204 ListBox* m_pEmphasisLB;
206 FixedText* m_pPositionFT;
207 ListBox* m_pPositionLB;
209 sal_uInt16 m_nHtmlMode;
211 String m_aTransparentColorName;
213 SvxCharEffectsPage( Window* pParent, const SfxItemSet& rSet );
214 ~SvxCharEffectsPage();
216 void Initialize();
217 void UpdatePreview_Impl();
218 void SetCaseMap_Impl( SvxCaseMap eCaseMap );
219 void ResetColor_Impl( const SfxItemSet& rSet );
220 sal_Bool FillItemSetColor_Impl( SfxItemSet& rSet );
222 DECL_LINK( SelectHdl_Impl, ListBox* );
223 DECL_LINK(CbClickHdl_Impl, void *);
224 DECL_LINK(TristClickHdl_Impl, void *);
225 DECL_LINK(UpdatePreview_Impl, void *);
226 DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* );
228 public:
229 using SfxTabPage::DeactivatePage;
231 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
233 public:
234 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
235 static sal_uInt16* GetRanges();
237 virtual void Reset( const SfxItemSet& rSet );
238 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
240 void DisableControls( sal_uInt16 nDisable );
241 void EnableFlash();
242 /// the writer uses SID_ATTR_BRUSH as font background
243 void SetPreviewBackgroundToCharacter();
244 virtual void PageCreated (SfxAllItemSet aSet);
247 // class SvxCharPositionPage ---------------------------------------------
249 class SvxCharPositionPage : public SvxCharBasePage
252 private:
253 RadioButton* m_pHighPosBtn;
254 RadioButton* m_pNormalPosBtn;
255 RadioButton* m_pLowPosBtn;
256 FixedText* m_pHighLowFT;
257 MetricField* m_pHighLowMF;
258 CheckBox* m_pHighLowRB;
259 FixedText* m_pFontSizeFT;
260 MetricField* m_pFontSizeMF;
262 VclContainer* m_pRotationContainer;
264 FixedText* m_pScalingFT;
265 FixedText* m_pScalingAndRotationFT;
266 RadioButton* m_p0degRB;
267 RadioButton* m_p90degRB;
268 RadioButton* m_p270degRB;
269 CheckBox* m_pFitToLineCB;
271 MetricField* m_pScaleWidthMF;
273 ListBox* m_pKerningLB;
274 FixedText* m_pKerningFT;
275 MetricField* m_pKerningMF;
276 CheckBox* m_pPairKerningBtn;
278 short m_nSuperEsc;
279 short m_nSubEsc;
281 sal_uInt16 m_nScaleWidthItemSetVal;
282 sal_uInt16 m_nScaleWidthInitialVal;
284 sal_uInt8 m_nSuperProp;
285 sal_uInt8 m_nSubProp;
287 SvxCharPositionPage( Window* pParent, const SfxItemSet& rSet );
288 ~SvxCharPositionPage();
290 void Initialize();
291 void UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
292 void SetEscapement_Impl( sal_uInt16 nEsc );
294 DECL_LINK( PositionHdl_Impl, RadioButton* );
295 DECL_LINK( RotationHdl_Impl, RadioButton* );
296 DECL_LINK(FontModifyHdl_Impl, void *);
297 DECL_LINK( AutoPositionHdl_Impl, CheckBox* );
298 DECL_LINK( FitToLineHdl_Impl, CheckBox* );
299 DECL_LINK(KerningSelectHdl_Impl, void *);
300 DECL_LINK(KerningModifyHdl_Impl, void *);
301 DECL_LINK(PairKerningHdl_Impl, void *);
302 DECL_LINK( LoseFocusHdl_Impl, MetricField* );
303 DECL_LINK(ScaleWidthModifyHdl_Impl, void *);
305 public:
306 using SfxTabPage::ActivatePage;
307 using SfxTabPage::DeactivatePage;
309 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
310 virtual void ActivatePage( const SfxItemSet& rSet );
312 public:
313 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
314 static sal_uInt16* GetRanges();
316 virtual void Reset( const SfxItemSet& rSet );
317 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
318 virtual void FillUserData();
319 /// the writer uses SID_ATTR_BRUSH as font background
320 void SetPreviewBackgroundToCharacter();
321 virtual void PageCreated (SfxAllItemSet aSet);
324 // class SvxCharTwoLinesPage ---------------------------------------------
326 class SvxCharTwoLinesPage : public SvxCharBasePage
328 private:
329 CheckBox* m_pTwoLinesBtn;
330 VclContainer* m_pEnclosingFrame;
331 ListBox* m_pStartBracketLB;
332 ListBox* m_pEndBracketLB;
334 sal_uInt16 m_nStartBracketPosition;
335 sal_uInt16 m_nEndBracketPosition;
337 SvxCharTwoLinesPage(Window* pParent, const SfxItemSet& rSet);
338 ~SvxCharTwoLinesPage();
340 void UpdatePreview_Impl();
341 void Initialize();
342 void SelectCharacter( ListBox* pBox );
343 void SetBracket( sal_Unicode cBracket, sal_Bool bStart );
345 DECL_LINK(TwoLinesHdl_Impl, void *);
346 DECL_LINK( CharacterMapHdl_Impl, ListBox* );
348 public:
349 using SfxTabPage::ActivatePage;
350 using SfxTabPage::DeactivatePage;
352 virtual void ActivatePage( const SfxItemSet& rSet );
353 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
355 public:
356 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
357 static sal_uInt16* GetRanges();
359 virtual void Reset( const SfxItemSet& rSet );
360 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
361 /// the writer uses SID_ATTR_BRUSH as font background
362 void SetPreviewBackgroundToCharacter();
363 virtual void PageCreated (SfxAllItemSet aSet);
366 #endif // #ifndef _SVX_CHARDLG_HXX
368 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */