1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef _SVX_FONT_SUBSTITUTION_HXX
28 #define _SVX_FONT_SUBSTITUTION_HXX
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>
38 class SourceViewConfig
;
41 // class SvxFontSubstCheckListBox ------------------------------------------
43 class SvxFontSubstCheckListBox
: public SvxSimpleTable
45 friend class SvxFontSubstTabPage
;
46 using SvxSimpleTable::SetTabs
;
47 using SvTreeListBox::GetCheckButtonState
;
48 using SvTreeListBox::SetCheckButtonState
;
51 virtual void SetTabs();
52 virtual void KeyInput( const KeyEvent
& rKEvt
);
55 SvxFontSubstCheckListBox(Window
* pParent
, const ResId
& rResId
) :
56 SvxSimpleTable( pParent
, rResId
){}
58 inline void *GetUserData(sal_uLong nPos
) { return GetEntry(nPos
)->GetUserData(); }
59 inline void SetUserData(sal_uLong nPos
, void *pData
) { GetEntry(nPos
)->SetUserData(pData
); }
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
);
69 // class SvxFontSubstTabPage ----------------------------------------------------
70 class SvtFontSubstConfig
;
71 namespace svt
{class SourceViewConfig
;}
72 class SvxFontSubstTabPage
: public SfxTabPage
80 SvxFontSubstCheckListBox aCheckLB
;
82 FixedLine aSourceViewFontsFL
;
83 FixedText aFontNameFT
;
85 CheckBox aNonPropFontsOnlyCB
;
86 FixedText aFontHeightFT
;
87 ListBox aFontHeightLB
;
92 SvtFontSubstConfig
* pConfig
;
93 utl::SourceViewConfig
* pSourceViewConfig
;
101 ByteString sFontGroup
;
103 SvLBoxButtonData
* pCheckButtonData
;
105 DECL_LINK(SelectHdl
, Window
*pWin
= 0);
106 DECL_LINK(NonPropFontsHdl
, CheckBox
* pBox
);
108 SvLBoxEntry
* CreateEntry(String
& rFont1
, String
& rFont2
);
112 SvxFontSubstTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
113 ~SvxFontSubstTabPage();
116 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
117 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
118 virtual void Reset( const SfxItemSet
& rSet
);
122 #endif // _SVX_FONT_SUBSTITUTION_HXX