Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / inc / chardlg.hxx
blob587161d5efe43bca2078bbb99988a61f71a93958
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;
51 FixedText* m_pFontTypeFT;
53 sal_Bool m_bPreviewBackgroundToCharacter;
55 SvxCharBasePage(Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription, const SfxItemSet& rItemset);
57 virtual ~SvxCharBasePage();
59 void SetPrevFontWidthScale( const SfxItemSet& rSet );
60 void SetPrevFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
62 inline SvxFont& GetPreviewFont();
63 inline SvxFont& GetPreviewCJKFont();
64 inline SvxFont& GetPreviewCTLFont();
66 public:
67 using SfxTabPage::ActivatePage;
68 using SfxTabPage::DeactivatePage;
70 virtual void ActivatePage( const SfxItemSet& rSet );
74 // class SvxCharNamePage -------------------------------------------------
76 struct SvxCharNamePage_Impl;
78 class SvxCharNamePage : public SvxCharBasePage
81 private:
82 VclContainer* m_pWestFrame;
83 FixedText* m_pWestFontNameFT;
84 FontNameBox* m_pWestFontNameLB;
85 FixedText* m_pWestFontStyleFT;
86 FontStyleBox* m_pWestFontStyleLB;
87 FixedText* m_pWestFontSizeFT;
88 FontSizeBox* m_pWestFontSizeLB;
89 FixedText* m_pWestFontLanguageFT;
90 SvxLanguageBox* m_pWestFontLanguageLB;
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;
102 VclContainer* m_pCTLFrame;
103 FixedText* m_pCTLFontNameFT;
104 FontNameBox* m_pCTLFontNameLB;
105 FixedText* m_pCTLFontStyleFT;
106 FontStyleBox* m_pCTLFontStyleLB;
107 FixedText* m_pCTLFontSizeFT;
108 FontSizeBox* m_pCTLFontSizeLB;
109 FixedText* m_pCTLFontLanguageFT;
110 SvxLanguageBox* m_pCTLFontLanguageLB;
112 SvxCharNamePage_Impl* m_pImpl;
114 SvxCharNamePage( Window* pParent, const SfxItemSet& rSet );
116 void Initialize();
117 const FontList* GetFontList() const;
118 void UpdatePreview_Impl();
119 void FillStyleBox_Impl( const FontNameBox* rBox );
120 void FillSizeBox_Impl( const FontNameBox* rBox );
122 enum LanguageGroup
124 /** Language for western text.
126 Western = 0,
128 /** Language for asian text.
130 Asian,
132 /** Language for ctl text.
137 void Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp );
138 sal_Bool FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp );
140 DECL_LINK(UpdateHdl_Impl, void *);
141 DECL_LINK( FontModifyHdl_Impl, void* );
143 public:
144 using SfxTabPage::ActivatePage;
145 using SfxTabPage::DeactivatePage;
147 virtual void ActivatePage( const SfxItemSet& rSet );
148 virtual int DeactivatePage( SfxItemSet* pSet = 0 );
150 public:
151 ~SvxCharNamePage();
153 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
154 static sal_uInt16* GetRanges();
156 virtual void Reset( const SfxItemSet& rSet );
157 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
159 void SetFontList( const SvxFontListItem& rItem );
160 void EnableRelativeMode();
161 void EnableSearchMode();
162 /// the writer uses SID_ATTR_BRUSH as font background
163 void SetPreviewBackgroundToCharacter();
165 void DisableControls( sal_uInt16 nDisable );
166 virtual void PageCreated (SfxAllItemSet aSet);
169 // class SvxCharEffectsPage ----------------------------------------------
171 class SvxCharEffectsPage : public SvxCharBasePage
174 private:
175 FixedText* m_pFontColorFT;
176 ColorListBox* m_pFontColorLB;
178 FixedText* m_pEffectsFT;
179 ListBox* m_pEffectsLB;
181 FixedText* m_pReliefFT;
182 ListBox* m_pReliefLB;
184 TriStateBox* m_pOutlineBtn;
185 TriStateBox* m_pShadowBtn;
186 TriStateBox* m_pBlinkingBtn;
187 TriStateBox* m_pHiddenBtn;
189 ListBox* m_pOverlineLB;
190 FixedText* m_pOverlineColorFT;
191 ColorListBox* m_pOverlineColorLB;
193 ListBox* m_pStrikeoutLB;
195 ListBox* m_pUnderlineLB;
196 FixedText* m_pUnderlineColorFT;
197 ColorListBox* m_pUnderlineColorLB;
199 CheckBox* m_pIndividualWordsBtn;
201 FixedLine* m_pAsianLine;
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: */