/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_CUI_SOURCE_INC_CHARDLG_HXX #define INCLUDED_CUI_SOURCE_INC_CHARDLG_HXX #include #include #include #include #include #include #include // forward --------------------------------------------------------------- class SvxFontListItem; class FontList; #define DISABLE_CASEMAP ((sal_uInt16)0x0001) #define DISABLE_WORDLINE ((sal_uInt16)0x0002) #define DISABLE_BLINK ((sal_uInt16)0x0004) #define DISABLE_UNDERLINE_COLOR ((sal_uInt16)0x0008) #define DISABLE_LANGUAGE ((sal_uInt16)0x0010) #define DISABLE_HIDE_LANGUAGE ((sal_uInt16)0x0020) // class SvxCharBasePage ------------------------------------------------- class SvxCharBasePage : public SfxTabPage { protected: VclPtr m_pPreviewWin; bool m_bPreviewBackgroundToCharacter; SvxCharBasePage(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet& rItemset); void SetPrevFontWidthScale( const SfxItemSet& rSet ); void SetPrevFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ); inline SvxFont& GetPreviewFont(); inline SvxFont& GetPreviewCJKFont(); inline SvxFont& GetPreviewCTLFont(); public: virtual ~SvxCharBasePage(); virtual void dispose() SAL_OVERRIDE; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE; }; // class SvxCharNamePage ------------------------------------------------- struct SvxCharNamePage_Impl; class SvxCharNamePage : public SvxCharBasePage { private: static const sal_uInt16 pNameRanges[]; VclPtr m_pWestFrame; VclPtr m_pWestFontNameFT; VclPtr m_pWestFontNameLB; VclPtr m_pWestFontStyleFT; VclPtr m_pWestFontStyleLB; VclPtr m_pWestFontSizeFT; VclPtr m_pWestFontSizeLB; VclPtr m_pWestFontLanguageFT; VclPtr m_pWestFontLanguageLB; VclPtr m_pWestFontTypeFT; VclPtr m_pEastFrame; VclPtr m_pEastFontNameFT; VclPtr m_pEastFontNameLB; VclPtr m_pEastFontStyleFT; VclPtr m_pEastFontStyleLB; VclPtr m_pEastFontSizeFT; VclPtr m_pEastFontSizeLB; VclPtr m_pEastFontLanguageFT; VclPtr m_pEastFontLanguageLB; VclPtr m_pEastFontTypeFT; VclPtr m_pCTLFrame; VclPtr m_pCTLFontNameFT; VclPtr m_pCTLFontNameLB; VclPtr m_pCTLFontStyleFT; VclPtr m_pCTLFontStyleLB; VclPtr m_pCTLFontSizeFT; VclPtr m_pCTLFontSizeLB; VclPtr m_pCTLFontLanguageFT; VclPtr m_pCTLFontLanguageLB; VclPtr m_pCTLFontTypeFT; SvxCharNamePage_Impl* m_pImpl; SvxCharNamePage( vcl::Window* pParent, const SfxItemSet& rSet ); void Initialize(); const FontList* GetFontList() const; void UpdatePreview_Impl(); void FillStyleBox_Impl( const FontNameBox* rBox ); void FillSizeBox_Impl( const FontNameBox* rBox ); enum LanguageGroup { /** Language for western text. */ Western = 0, /** Language for asian text. */ Asian, /** Language for ctl text. */ Ctl }; void Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp ); bool FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp ); DECL_LINK_TYPED(UpdateHdl_Impl, Idle *, void); DECL_LINK( FontModifyHdl_Impl, void* ); public: using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE; virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; public: virtual ~SvxCharNamePage(); virtual void dispose() SAL_OVERRIDE; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pNameRanges; } virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; void SetFontList( const SvxFontListItem& rItem ); void EnableRelativeMode(); void EnableSearchMode(); /// the writer uses SID_ATTR_BRUSH as font background void SetPreviewBackgroundToCharacter(); void DisableControls( sal_uInt16 nDisable ); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; }; // class SvxCharEffectsPage ---------------------------------------------- class SvxCharEffectsPage : public SvxCharBasePage { private: static const sal_uInt16 pEffectsRanges[]; VclPtr m_pFontColorFT; VclPtr m_pFontColorLB; VclPtr m_pEffectsFT; VclPtr m_pEffectsLB; VclPtr m_pReliefFT; VclPtr m_pReliefLB; VclPtr m_pOutlineBtn; VclPtr m_pShadowBtn; VclPtr m_pBlinkingBtn; VclPtr m_pHiddenBtn; VclPtr m_pOverlineLB; VclPtr m_pOverlineColorFT; VclPtr m_pOverlineColorLB; VclPtr m_pStrikeoutLB; VclPtr m_pUnderlineLB; VclPtr m_pUnderlineColorFT; VclPtr m_pUnderlineColorLB; VclPtr m_pIndividualWordsBtn; VclPtr m_pEmphasisFT; VclPtr m_pEmphasisLB; VclPtr m_pPositionFT; VclPtr m_pPositionLB; sal_uInt16 m_nHtmlMode; OUString m_aTransparentColorName; SvxCharEffectsPage( vcl::Window* pParent, const SfxItemSet& rSet ); void Initialize(); void UpdatePreview_Impl(); void SetCaseMap_Impl( SvxCaseMap eCaseMap ); void ResetColor_Impl( const SfxItemSet& rSet ); bool FillItemSetColor_Impl( SfxItemSet& rSet ); DECL_LINK( SelectHdl_Impl, ListBox* ); DECL_LINK(CbClickHdl_Impl, void *); DECL_LINK(TristClickHdl_Impl, void *); DECL_LINK(UpdatePreview_Impl, void *); DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* ); public: virtual ~SvxCharEffectsPage(); virtual void dispose() SAL_OVERRIDE; using SfxTabPage::DeactivatePage; virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; public: static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pEffectsRanges; } virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; void DisableControls( sal_uInt16 nDisable ); void EnableFlash(); /// the writer uses SID_ATTR_BRUSH as font background void SetPreviewBackgroundToCharacter(); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; }; // class SvxCharPositionPage --------------------------------------------- class SvxCharPositionPage : public SvxCharBasePage { static const sal_uInt16 pPositionRanges[]; private: VclPtr m_pHighPosBtn; VclPtr m_pNormalPosBtn; VclPtr m_pLowPosBtn; VclPtr m_pHighLowFT; VclPtr m_pHighLowMF; VclPtr m_pHighLowRB; VclPtr m_pFontSizeFT; VclPtr m_pFontSizeMF; VclPtr m_pRotationContainer; VclPtr m_pScalingFT; VclPtr m_pScalingAndRotationFT; VclPtr m_p0degRB; VclPtr m_p90degRB; VclPtr m_p270degRB; VclPtr m_pFitToLineCB; VclPtr m_pScaleWidthMF; VclPtr m_pKerningLB; VclPtr m_pKerningFT; VclPtr m_pKerningMF; VclPtr m_pPairKerningBtn; short m_nSuperEsc; short m_nSubEsc; sal_uInt16 m_nScaleWidthItemSetVal; sal_uInt16 m_nScaleWidthInitialVal; sal_uInt8 m_nSuperProp; sal_uInt8 m_nSubProp; SvxCharPositionPage( vcl::Window* pParent, const SfxItemSet& rSet ); void Initialize(); void UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ); void SetEscapement_Impl( sal_uInt16 nEsc ); DECL_LINK( PositionHdl_Impl, RadioButton* ); DECL_LINK( RotationHdl_Impl, RadioButton* ); DECL_LINK(FontModifyHdl_Impl, void *); DECL_LINK( AutoPositionHdl_Impl, CheckBox* ); DECL_LINK( FitToLineHdl_Impl, CheckBox* ); DECL_LINK(KerningSelectHdl_Impl, void *); DECL_LINK(KerningModifyHdl_Impl, void *); DECL_STATIC_LINK(SvxCharPositionPage, PairKerningHdl_Impl, void *); DECL_LINK( LoseFocusHdl_Impl, MetricField* ); DECL_LINK(ScaleWidthModifyHdl_Impl, void *); public: virtual ~SvxCharPositionPage(); virtual void dispose() SAL_OVERRIDE; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE; public: static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pPositionRanges; } virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; virtual void FillUserData() SAL_OVERRIDE; /// the writer uses SID_ATTR_BRUSH as font background void SetPreviewBackgroundToCharacter(); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; }; // class SvxCharTwoLinesPage --------------------------------------------- class SvxCharTwoLinesPage : public SvxCharBasePage { private: static const sal_uInt16 pTwoLinesRanges[]; VclPtr m_pTwoLinesBtn; VclPtr m_pEnclosingFrame; VclPtr m_pStartBracketLB; VclPtr m_pEndBracketLB; sal_uInt16 m_nStartBracketPosition; sal_uInt16 m_nEndBracketPosition; SvxCharTwoLinesPage(vcl::Window* pParent, const SfxItemSet& rSet); void UpdatePreview_Impl(); void Initialize(); void SelectCharacter( ListBox* pBox ); void SetBracket( sal_Unicode cBracket, bool bStart ); DECL_LINK(TwoLinesHdl_Impl, void *); DECL_LINK( CharacterMapHdl_Impl, ListBox* ); public: virtual ~SvxCharTwoLinesPage(); virtual void dispose() SAL_OVERRIDE; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE; virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pTwoLinesRanges; } virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE; virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE; /// the writer uses SID_ATTR_BRUSH as font background void SetPreviewBackgroundToCharacter(); virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE; }; #endif // INCLUDED_CUI_SOURCE_INC_CHARDLG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */