1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fontsubs.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_FONT_SUBSTITUTION_HXX
31 #define _SVX_FONT_SUBSTITUTION_HXX
33 #include <sfx2/tabdlg.hxx>
34 #include <vcl/fixed.hxx>
35 #include <svx/simptabl.hxx>
36 #include <vcl/toolbox.hxx>
37 #include <svtools/ctrlbox.hxx>
39 // class SvxFontSubstCheckListBox ------------------------------------------
41 class SvxFontSubstCheckListBox
: public SvxSimpleTable
43 friend class SvxFontSubstTabPage
;
44 using SvxSimpleTable::SetTabs
;
45 using SvTreeListBox::GetCheckButtonState
;
46 using SvTreeListBox::SetCheckButtonState
;
49 virtual void SetTabs();
50 virtual void KeyInput( const KeyEvent
& rKEvt
);
53 SvxFontSubstCheckListBox(Window
* pParent
, const ResId
& rResId
) :
54 SvxSimpleTable( pParent
, rResId
){}
56 inline void *GetUserData(ULONG nPos
) { return GetEntry(nPos
)->GetUserData(); }
57 inline void SetUserData(ULONG nPos
, void *pData
) { GetEntry(nPos
)->SetUserData(pData
); }
59 BOOL
IsChecked(ULONG nPos
, USHORT nCol
= 0);
60 BOOL
IsChecked(SvLBoxEntry
* pEntry
, USHORT nCol
= 0);
61 void CheckEntryPos(ULONG nPos
, USHORT nCol
, BOOL bChecked
);
62 void CheckEntry(SvLBoxEntry
* pEntry
, USHORT nCol
, BOOL bChecked
);
63 SvButtonState
GetCheckButtonState( SvLBoxEntry
*, USHORT nCol
) const;
64 void SetCheckButtonState( SvLBoxEntry
*, USHORT nCol
, SvButtonState
);
67 // class SvxFontSubstTabPage ----------------------------------------------------
68 class SvtFontSubstConfig
;
69 namespace svt
{class SourceViewConfig
;}
70 class SvxFontSubstTabPage
: public SfxTabPage
78 SvxFontSubstCheckListBox aCheckLB
;
80 FixedLine aSourceViewFontsFL
;
81 FixedText aFontNameFT
;
83 CheckBox aNonPropFontsOnlyCB
;
84 FixedText aFontHeightFT
;
85 ListBox aFontHeightLB
;
90 SvtFontSubstConfig
* pConfig
;
91 svt::SourceViewConfig
* pSourceViewConfig
;
99 ByteString sFontGroup
;
101 SvLBoxButtonData
* pCheckButtonData
;
103 DECL_LINK(SelectHdl
, Window
*pWin
= 0);
104 DECL_LINK(NonPropFontsHdl
, CheckBox
* pBox
);
106 SvLBoxEntry
* CreateEntry(String
& rFont1
, String
& rFont2
);
110 SvxFontSubstTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
111 ~SvxFontSubstTabPage();
114 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
115 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
116 virtual void Reset( const SfxItemSet
& rSet
);
120 #endif // _SVX_FONT_SUBSTITUTION_HXX