1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SVX_FONT_SUBSTITUTION_HXX
20 #define _SVX_FONT_SUBSTITUTION_HXX
22 #include <sfx2/tabdlg.hxx>
23 #include <vcl/fixed.hxx>
24 #include <svx/simptabl.hxx>
25 #include <vcl/toolbox.hxx>
26 #include <svtools/ctrlbox.hxx>
27 #include "svtools/treelistentry.hxx"
29 // class SvxFontSubstCheckListBox ------------------------------------------
31 class SvxFontSubstCheckListBox
: public SvxSimpleTable
33 friend class SvxFontSubstTabPage
;
34 using SvxSimpleTable::SetTabs
;
35 using SvTreeListBox::GetCheckButtonState
;
36 using SvTreeListBox::SetCheckButtonState
;
39 virtual void SetTabs();
40 virtual void KeyInput( const KeyEvent
& rKEvt
);
43 SvxFontSubstCheckListBox(SvxSimpleTableContainer
& rParent
, WinBits nBits
= WB_BORDER
)
44 : SvxSimpleTable(rParent
, nBits
)
48 inline void *GetUserData(sal_uLong nPos
) { return GetEntry(nPos
)->GetUserData(); }
49 inline void SetUserData(sal_uLong nPos
, void *pData
) { GetEntry(nPos
)->SetUserData(pData
); }
51 sal_Bool
IsChecked(sal_uLong nPos
, sal_uInt16 nCol
= 0);
52 sal_Bool
IsChecked(SvTreeListEntry
* pEntry
, sal_uInt16 nCol
= 0);
53 void CheckEntryPos(sal_uLong nPos
, sal_uInt16 nCol
, sal_Bool bChecked
);
54 void CheckEntry(SvTreeListEntry
* pEntry
, sal_uInt16 nCol
, sal_Bool bChecked
);
55 SvButtonState
GetCheckButtonState( SvTreeListEntry
*, sal_uInt16 nCol
) const;
56 void SetCheckButtonState( SvTreeListEntry
*, sal_uInt16 nCol
, SvButtonState
);
59 // class SvxFontSubstTabPage ----------------------------------------------------
60 class SvtFontSubstConfig
;
61 class SvxFontSubstTabPage
: public SfxTabPage
69 SvxSimpleTableContainer m_aCheckLBContainer
;
70 SvxFontSubstCheckListBox aCheckLB
;
72 FixedLine aSourceViewFontsFL
;
73 FixedText aFontNameFT
;
75 CheckBox aNonPropFontsOnlyCB
;
76 FixedText aFontHeightFT
;
77 ListBox aFontHeightLB
;
82 SvtFontSubstConfig
* pConfig
;
91 SvLBoxButtonData
* pCheckButtonData
;
93 DECL_LINK(SelectHdl
, Window
*pWin
= 0);
94 DECL_LINK(NonPropFontsHdl
, CheckBox
* pBox
);
96 SvTreeListEntry
* CreateEntry(String
& rFont1
, String
& rFont2
);
100 SvxFontSubstTabPage( Window
* pParent
, const SfxItemSet
& rSet
);
101 ~SvxFontSubstTabPage();
104 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
105 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
106 virtual void Reset( const SfxItemSet
& rSet
);
110 #endif // _SVX_FONT_SUBSTITUTION_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */