1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _SVX_FONT_SUBSTITUTION_HXX 28 #define _SVX_FONT_SUBSTITUTION_HXX 29 30 #include <sfx2/tabdlg.hxx> 31 #include <vcl/fixed.hxx> 32 #include <svx/simptabl.hxx> 33 #include <vcl/toolbox.hxx> 34 #include <svtools/ctrlbox.hxx> 35 36 namespace utl 37 { 38 class SourceViewConfig; 39 } 40 41 // class SvxFontSubstCheckListBox ------------------------------------------ 42 43 class SvxFontSubstCheckListBox : public SvxSimpleTable 44 { 45 friend class SvxFontSubstTabPage; 46 using SvxSimpleTable::SetTabs; 47 using SvTreeListBox::GetCheckButtonState; 48 using SvTreeListBox::SetCheckButtonState; 49 50 protected: 51 virtual void SetTabs(); 52 virtual void KeyInput( const KeyEvent& rKEvt ); 53 54 public: 55 SvxFontSubstCheckListBox(Window* pParent, const ResId& rResId ) : 56 SvxSimpleTable( pParent, rResId ){} 57 58 inline void *GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); } 59 inline void SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); } 60 61 sal_Bool IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0); 62 sal_Bool IsChecked(SvLBoxEntry* pEntry, sal_uInt16 nCol = 0); 63 void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked); 64 void CheckEntry(SvLBoxEntry* pEntry, sal_uInt16 nCol, sal_Bool bChecked); 65 SvButtonState GetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol ) const; 66 void SetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol, SvButtonState ); 67 }; 68 69 // class SvxFontSubstTabPage ---------------------------------------------------- 70 class SvtFontSubstConfig; 71 namespace svt {class SourceViewConfig;} 72 class SvxFontSubstTabPage : public SfxTabPage 73 { 74 CheckBox aUseTableCB; 75 FixedText aFont1FT; 76 FontNameBox aFont1CB; 77 FixedText aFont2FT; 78 FontNameBox aFont2CB; 79 ToolBox aNewDelTBX; 80 SvxFontSubstCheckListBox aCheckLB; 81 82 FixedLine aSourceViewFontsFL; 83 FixedText aFontNameFT; 84 ListBox aFontNameLB; 85 CheckBox aNonPropFontsOnlyCB; 86 FixedText aFontHeightFT; 87 ListBox aFontHeightLB; 88 89 ImageList aImageList; 90 String sAutomatic; 91 92 SvtFontSubstConfig* pConfig; 93 utl::SourceViewConfig* pSourceViewConfig; 94 95 String sHeader1; 96 String sHeader2; 97 String sHeader3; 98 String sHeader4; 99 100 Color aTextColor; 101 ByteString sFontGroup; 102 103 SvLBoxButtonData* pCheckButtonData; 104 105 DECL_LINK(SelectHdl, Window *pWin = 0); 106 DECL_LINK(NonPropFontsHdl, CheckBox* pBox); 107 108 SvLBoxEntry* CreateEntry(String& rFont1, String& rFont2); 109 void CheckEnable(); 110 111 112 SvxFontSubstTabPage( Window* pParent, const SfxItemSet& rSet ); 113 ~SvxFontSubstTabPage(); 114 115 public: 116 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet); 117 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 118 virtual void Reset( const SfxItemSet& rSet ); 119 }; 120 121 122 #endif // _SVX_FONT_SUBSTITUTION_HXX 123 124 125 126 127 128 129 130 131 132 133 134 135