/* -*- 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 #include // forward --------------------------------------------------------------- class SvxFontListItem; class FontList; // 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() override; virtual void dispose() override; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& rSet ) override; }; // class SvxCharNamePage ------------------------------------------------- struct SvxCharNamePage_Impl; class SvxCharNamePage : public SvxCharBasePage { friend class VclPtr; 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; std::unique_ptr 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( UpdateHdl_Impl, Timer *, void ); DECL_LINK( FontModifyEditHdl_Impl, Edit&, void ); DECL_LINK( FontModifyListBoxHdl_Impl, ListBox&, void ); DECL_LINK( FontModifyComboBoxHdl_Impl, ComboBox&, void ); void FontModifyHdl_Impl(void const *); public: using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: virtual ~SvxCharNamePage() override; virtual void dispose() override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pNameRanges; } virtual void Reset( const SfxItemSet* rSet ) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void ChangesApplied() override; void SetFontList( const SvxFontListItem& rItem ); void EnableRelativeMode(); void EnableSearchMode(); void DisableControls( sal_uInt16 nDisable ); virtual void PageCreated(const SfxAllItemSet& aSet) override; }; // class SvxCharEffectsPage ---------------------------------------------- class SvxCharEffectsPage : public SvxCharBasePage { friend class VclPtr; private: static const sal_uInt16 pEffectsRanges[]; bool m_bOrigFontColor; bool m_bNewFontColor; bool m_bEnableNoneFontColor; Color m_aOrigFontColor; 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; VclPtr m_pA11yWarningFT; sal_uInt16 m_nHtmlMode; 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 ); Color GetPreviewFontColor(const Color& rColor) const; void EnableNoneFontColor(); void SelectHdl_Impl(ListBox*); DECL_LINK(SelectListBoxHdl_Impl, ListBox&, void); DECL_LINK(CbClickHdl_Impl, Button*, void); DECL_LINK(TristClickHdl_Impl, Button*, void); DECL_LINK(UpdatePreview_Impl, ListBox&, void); DECL_LINK(ColorBoxSelectHdl_Impl, SvxColorListBox&, void); public: virtual ~SvxCharEffectsPage() override; virtual void dispose() override; using SfxTabPage::DeactivatePage; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pEffectsRanges; } virtual void Reset( const SfxItemSet* rSet ) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void ChangesApplied() override; void DisableControls( sal_uInt16 nDisable ); virtual void PageCreated(const SfxAllItemSet& aSet) override; }; // class SvxCharPositionPage --------------------------------------------- class SvxCharPositionPage : public SvxCharBasePage { friend class VclPtr; 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_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( SvxEscapement nEsc ); DECL_LINK( PositionHdl_Impl, Button*, void ); DECL_LINK( RotationHdl_Impl, Button*, void ); DECL_LINK( FontModifyHdl_Impl, Edit&, void ); DECL_LINK( AutoPositionHdl_Impl, Button*, void ); DECL_LINK( FitToLineHdl_Impl, Button*, void ); DECL_LINK( KerningSelectHdl_Impl, ListBox&, void ); DECL_LINK( KerningModifyHdl_Impl, Edit&, void ); DECL_LINK( LoseFocusHdl_Impl, Control&, void ); DECL_LINK( ScaleWidthModifyHdl_Impl, Edit&, void ); public: virtual ~SvxCharPositionPage() override; virtual void dispose() override; using SfxTabPage::DeactivatePage; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pPositionRanges; } virtual void Reset( const SfxItemSet* rSet ) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void ChangesApplied() override; virtual void FillUserData() override; virtual void PageCreated(const SfxAllItemSet& aSet) override; }; // class SvxCharTwoLinesPage --------------------------------------------- class SvxCharTwoLinesPage : public SvxCharBasePage { friend class VclPtr; 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, Button*, void); DECL_LINK(CharacterMapHdl_Impl, ListBox&, void ); public: virtual ~SvxCharTwoLinesPage() override; virtual void dispose() override; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; virtual void ActivatePage( const SfxItemSet& rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; static VclPtr Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pTwoLinesRanges; } virtual void Reset( const SfxItemSet* rSet ) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void PageCreated(const SfxAllItemSet& aSet) override; }; #endif // INCLUDED_CUI_SOURCE_INC_CHARDLG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */