1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_CUI_SOURCE_INC_CHARDLG_HXX
20 #define INCLUDED_CUI_SOURCE_INC_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
;
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
50 VclPtr
<SvxFontPrevWindow
> m_pPreviewWin
;
52 bool m_bPreviewBackgroundToCharacter
;
54 SvxCharBasePage(vcl::Window
* pParent
, const OString
& rID
, const OUString
& rUIXMLDescription
, const SfxItemSet
& rItemset
);
56 void SetPrevFontWidthScale( const SfxItemSet
& rSet
);
57 void SetPrevFontEscapement( sal_uInt8 nProp
, sal_uInt8 nEscProp
, short nEsc
);
59 inline SvxFont
& GetPreviewFont();
60 inline SvxFont
& GetPreviewCJKFont();
61 inline SvxFont
& GetPreviewCTLFont();
64 virtual ~SvxCharBasePage();
65 virtual void dispose() SAL_OVERRIDE
;
67 using SfxTabPage::ActivatePage
;
68 using SfxTabPage::DeactivatePage
;
70 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
74 // class SvxCharNamePage -------------------------------------------------
76 struct SvxCharNamePage_Impl
;
78 class SvxCharNamePage
: public SvxCharBasePage
80 friend class VclPtr
<SvxCharNamePage
>;
83 static const sal_uInt16 pNameRanges
[];
84 VclPtr
<VclContainer
> m_pWestFrame
;
85 VclPtr
<FixedText
> m_pWestFontNameFT
;
86 VclPtr
<FontNameBox
> m_pWestFontNameLB
;
87 VclPtr
<FixedText
> m_pWestFontStyleFT
;
88 VclPtr
<FontStyleBox
> m_pWestFontStyleLB
;
89 VclPtr
<FixedText
> m_pWestFontSizeFT
;
90 VclPtr
<FontSizeBox
> m_pWestFontSizeLB
;
91 VclPtr
<FixedText
> m_pWestFontLanguageFT
;
92 VclPtr
<SvxLanguageComboBox
> m_pWestFontLanguageLB
;
93 VclPtr
<FixedText
> m_pWestFontTypeFT
;
95 VclPtr
<VclContainer
> m_pEastFrame
;
96 VclPtr
<FixedText
> m_pEastFontNameFT
;
97 VclPtr
<FontNameBox
> m_pEastFontNameLB
;
98 VclPtr
<FixedText
> m_pEastFontStyleFT
;
99 VclPtr
<FontStyleBox
> m_pEastFontStyleLB
;
100 VclPtr
<FixedText
> m_pEastFontSizeFT
;
101 VclPtr
<FontSizeBox
> m_pEastFontSizeLB
;
102 VclPtr
<FixedText
> m_pEastFontLanguageFT
;
103 VclPtr
<SvxLanguageBox
> m_pEastFontLanguageLB
;
104 VclPtr
<FixedText
> m_pEastFontTypeFT
;
106 VclPtr
<VclContainer
> m_pCTLFrame
;
107 VclPtr
<FixedText
> m_pCTLFontNameFT
;
108 VclPtr
<FontNameBox
> m_pCTLFontNameLB
;
109 VclPtr
<FixedText
> m_pCTLFontStyleFT
;
110 VclPtr
<FontStyleBox
> m_pCTLFontStyleLB
;
111 VclPtr
<FixedText
> m_pCTLFontSizeFT
;
112 VclPtr
<FontSizeBox
> m_pCTLFontSizeLB
;
113 VclPtr
<FixedText
> m_pCTLFontLanguageFT
;
114 VclPtr
<SvxLanguageBox
> m_pCTLFontLanguageLB
;
115 VclPtr
<FixedText
> m_pCTLFontTypeFT
;
117 SvxCharNamePage_Impl
* m_pImpl
;
119 SvxCharNamePage( vcl::Window
* pParent
, const SfxItemSet
& rSet
);
122 const FontList
* GetFontList() const;
123 void UpdatePreview_Impl();
124 void FillStyleBox_Impl( const FontNameBox
* rBox
);
125 void FillSizeBox_Impl( const FontNameBox
* rBox
);
129 /** Language for western text.
133 /** Language for asian text.
137 /** Language for ctl text.
142 void Reset_Impl( const SfxItemSet
& rSet
, LanguageGroup eLangGrp
);
143 bool FillItemSet_Impl( SfxItemSet
& rSet
, LanguageGroup eLangGrp
);
145 DECL_LINK_TYPED(UpdateHdl_Impl
, Idle
*, void);
146 DECL_LINK( FontModifyHdl_Impl
, void* );
149 using SfxTabPage::ActivatePage
;
150 using SfxTabPage::DeactivatePage
;
152 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
153 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
= 0 ) SAL_OVERRIDE
;
156 virtual ~SvxCharNamePage();
157 virtual void dispose() SAL_OVERRIDE
;
159 static VclPtr
<SfxTabPage
> Create( vcl::Window
* pParent
, const SfxItemSet
* rSet
);
160 static const sal_uInt16
* GetRanges() { return pNameRanges
; }
162 virtual void Reset( const SfxItemSet
* rSet
) SAL_OVERRIDE
;
163 virtual bool FillItemSet( SfxItemSet
* rSet
) SAL_OVERRIDE
;
165 void SetFontList( const SvxFontListItem
& rItem
);
166 void EnableRelativeMode();
167 void EnableSearchMode();
168 /// the writer uses SID_ATTR_BRUSH as font background
169 void SetPreviewBackgroundToCharacter();
171 void DisableControls( sal_uInt16 nDisable
);
172 virtual void PageCreated(const SfxAllItemSet
& aSet
) SAL_OVERRIDE
;
175 // class SvxCharEffectsPage ----------------------------------------------
177 class SvxCharEffectsPage
: public SvxCharBasePage
179 friend class VclPtr
<SvxCharEffectsPage
>;
182 static const sal_uInt16 pEffectsRanges
[];
183 VclPtr
<FixedText
> m_pFontColorFT
;
184 VclPtr
<ColorListBox
> m_pFontColorLB
;
186 VclPtr
<FixedText
> m_pEffectsFT
;
187 VclPtr
<ListBox
> m_pEffectsLB
;
189 VclPtr
<FixedText
> m_pReliefFT
;
190 VclPtr
<ListBox
> m_pReliefLB
;
192 VclPtr
<TriStateBox
> m_pOutlineBtn
;
193 VclPtr
<TriStateBox
> m_pShadowBtn
;
194 VclPtr
<TriStateBox
> m_pBlinkingBtn
;
195 VclPtr
<TriStateBox
> m_pHiddenBtn
;
197 VclPtr
<ListBox
> m_pOverlineLB
;
198 VclPtr
<FixedText
> m_pOverlineColorFT
;
199 VclPtr
<ColorListBox
> m_pOverlineColorLB
;
201 VclPtr
<ListBox
> m_pStrikeoutLB
;
203 VclPtr
<ListBox
> m_pUnderlineLB
;
204 VclPtr
<FixedText
> m_pUnderlineColorFT
;
205 VclPtr
<ColorListBox
> m_pUnderlineColorLB
;
207 VclPtr
<CheckBox
> m_pIndividualWordsBtn
;
209 VclPtr
<FixedText
> m_pEmphasisFT
;
210 VclPtr
<ListBox
> m_pEmphasisLB
;
212 VclPtr
<FixedText
> m_pPositionFT
;
213 VclPtr
<ListBox
> m_pPositionLB
;
215 sal_uInt16 m_nHtmlMode
;
217 OUString m_aTransparentColorName
;
219 SvxCharEffectsPage( vcl::Window
* pParent
, const SfxItemSet
& rSet
);
222 void UpdatePreview_Impl();
223 void SetCaseMap_Impl( SvxCaseMap eCaseMap
);
224 void ResetColor_Impl( const SfxItemSet
& rSet
);
225 bool FillItemSetColor_Impl( SfxItemSet
& rSet
);
227 DECL_LINK( SelectHdl_Impl
, ListBox
* );
228 DECL_LINK(CbClickHdl_Impl
, void *);
229 DECL_LINK(TristClickHdl_Impl
, void *);
230 DECL_LINK(UpdatePreview_Impl
, void *);
231 DECL_LINK( ColorBoxSelectHdl_Impl
, ColorListBox
* );
234 virtual ~SvxCharEffectsPage();
235 virtual void dispose() SAL_OVERRIDE
;
237 using SfxTabPage::DeactivatePage
;
238 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
= 0 ) SAL_OVERRIDE
;
241 static VclPtr
<SfxTabPage
> Create( vcl::Window
* pParent
, const SfxItemSet
* rSet
);
242 static const sal_uInt16
* GetRanges() { return pEffectsRanges
; }
244 virtual void Reset( const SfxItemSet
* rSet
) SAL_OVERRIDE
;
245 virtual bool FillItemSet( SfxItemSet
* rSet
) SAL_OVERRIDE
;
247 void DisableControls( sal_uInt16 nDisable
);
249 /// the writer uses SID_ATTR_BRUSH as font background
250 void SetPreviewBackgroundToCharacter();
251 virtual void PageCreated(const SfxAllItemSet
& aSet
) SAL_OVERRIDE
;
254 // class SvxCharPositionPage ---------------------------------------------
257 class SvxCharPositionPage
: public SvxCharBasePage
259 friend class VclPtr
<SvxCharPositionPage
>;
260 static const sal_uInt16 pPositionRanges
[];
263 VclPtr
<RadioButton
> m_pHighPosBtn
;
264 VclPtr
<RadioButton
> m_pNormalPosBtn
;
265 VclPtr
<RadioButton
> m_pLowPosBtn
;
266 VclPtr
<FixedText
> m_pHighLowFT
;
267 VclPtr
<MetricField
> m_pHighLowMF
;
268 VclPtr
<CheckBox
> m_pHighLowRB
;
269 VclPtr
<FixedText
> m_pFontSizeFT
;
270 VclPtr
<MetricField
> m_pFontSizeMF
;
272 VclPtr
<VclContainer
> m_pRotationContainer
;
274 VclPtr
<FixedText
> m_pScalingFT
;
275 VclPtr
<FixedText
> m_pScalingAndRotationFT
;
276 VclPtr
<RadioButton
> m_p0degRB
;
277 VclPtr
<RadioButton
> m_p90degRB
;
278 VclPtr
<RadioButton
> m_p270degRB
;
279 VclPtr
<CheckBox
> m_pFitToLineCB
;
281 VclPtr
<MetricField
> m_pScaleWidthMF
;
283 VclPtr
<ListBox
> m_pKerningLB
;
284 VclPtr
<FixedText
> m_pKerningFT
;
285 VclPtr
<MetricField
> m_pKerningMF
;
286 VclPtr
<CheckBox
> m_pPairKerningBtn
;
291 sal_uInt16 m_nScaleWidthItemSetVal
;
292 sal_uInt16 m_nScaleWidthInitialVal
;
294 sal_uInt8 m_nSuperProp
;
295 sal_uInt8 m_nSubProp
;
297 SvxCharPositionPage( vcl::Window
* pParent
, const SfxItemSet
& rSet
);
300 void UpdatePreview_Impl( sal_uInt8 nProp
, sal_uInt8 nEscProp
, short nEsc
);
301 void SetEscapement_Impl( sal_uInt16 nEsc
);
303 DECL_LINK( PositionHdl_Impl
, RadioButton
* );
304 DECL_LINK( RotationHdl_Impl
, RadioButton
* );
305 DECL_LINK(FontModifyHdl_Impl
, void *);
306 DECL_LINK( AutoPositionHdl_Impl
, CheckBox
* );
307 DECL_LINK( FitToLineHdl_Impl
, CheckBox
* );
308 DECL_LINK(KerningSelectHdl_Impl
, void *);
309 DECL_LINK(KerningModifyHdl_Impl
, void *);
310 DECL_STATIC_LINK(SvxCharPositionPage
, PairKerningHdl_Impl
, void *);
311 DECL_LINK( LoseFocusHdl_Impl
, MetricField
* );
312 DECL_LINK(ScaleWidthModifyHdl_Impl
, void *);
315 virtual ~SvxCharPositionPage();
316 virtual void dispose() SAL_OVERRIDE
;
318 using SfxTabPage::ActivatePage
;
319 using SfxTabPage::DeactivatePage
;
321 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
= 0 ) SAL_OVERRIDE
;
322 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
325 static VclPtr
<SfxTabPage
> Create( vcl::Window
* pParent
, const SfxItemSet
* rSet
);
326 static const sal_uInt16
* GetRanges() { return pPositionRanges
; }
328 virtual void Reset( const SfxItemSet
* rSet
) SAL_OVERRIDE
;
329 virtual bool FillItemSet( SfxItemSet
* rSet
) SAL_OVERRIDE
;
330 virtual void FillUserData() SAL_OVERRIDE
;
331 /// the writer uses SID_ATTR_BRUSH as font background
332 void SetPreviewBackgroundToCharacter();
333 virtual void PageCreated(const SfxAllItemSet
& aSet
) SAL_OVERRIDE
;
336 // class SvxCharTwoLinesPage ---------------------------------------------
338 class SvxCharTwoLinesPage
: public SvxCharBasePage
340 friend class VclPtr
<SvxCharTwoLinesPage
>;
342 static const sal_uInt16 pTwoLinesRanges
[];
343 VclPtr
<CheckBox
> m_pTwoLinesBtn
;
344 VclPtr
<VclContainer
> m_pEnclosingFrame
;
345 VclPtr
<ListBox
> m_pStartBracketLB
;
346 VclPtr
<ListBox
> m_pEndBracketLB
;
348 sal_uInt16 m_nStartBracketPosition
;
349 sal_uInt16 m_nEndBracketPosition
;
351 SvxCharTwoLinesPage(vcl::Window
* pParent
, const SfxItemSet
& rSet
);
353 void UpdatePreview_Impl();
355 void SelectCharacter( ListBox
* pBox
);
356 void SetBracket( sal_Unicode cBracket
, bool bStart
);
358 DECL_LINK(TwoLinesHdl_Impl
, void *);
359 DECL_LINK( CharacterMapHdl_Impl
, ListBox
* );
362 virtual ~SvxCharTwoLinesPage();
363 virtual void dispose() SAL_OVERRIDE
;
365 using SfxTabPage::ActivatePage
;
366 using SfxTabPage::DeactivatePage
;
368 virtual void ActivatePage( const SfxItemSet
& rSet
) SAL_OVERRIDE
;
369 virtual sfxpg
DeactivatePage( SfxItemSet
* pSet
= 0 ) SAL_OVERRIDE
;
371 static VclPtr
<SfxTabPage
> Create( vcl::Window
* pParent
, const SfxItemSet
* rSet
);
372 static const sal_uInt16
* GetRanges() { return pTwoLinesRanges
; }
374 virtual void Reset( const SfxItemSet
* rSet
) SAL_OVERRIDE
;
375 virtual bool FillItemSet( SfxItemSet
* rSet
) SAL_OVERRIDE
;
376 /// the writer uses SID_ATTR_BRUSH as font background
377 void SetPreviewBackgroundToCharacter();
378 virtual void PageCreated(const SfxAllItemSet
& aSet
) SAL_OVERRIDE
;
381 #endif // INCLUDED_CUI_SOURCE_INC_CHARDLG_HXX
383 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */