Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_CUI_SOURCE_OPTIONS_FONTSUBS_HXX
20 : #define INCLUDED_CUI_SOURCE_OPTIONS_FONTSUBS_HXX
21 :
22 : #include <sfx2/tabdlg.hxx>
23 : #include <svtools/ctrlbox.hxx>
24 : #include <svtools/simptabl.hxx>
25 : #include <svtools/treelistentry.hxx>
26 : #include <vcl/fixed.hxx>
27 : #include <vcl/toolbox.hxx>
28 :
29 : // class SvxFontSubstCheckListBox ------------------------------------------
30 :
31 0 : class SvxFontSubstCheckListBox : public SvSimpleTable
32 : {
33 : friend class SvxFontSubstTabPage;
34 : using SvSimpleTable::SetTabs;
35 : using SvTreeListBox::GetCheckButtonState;
36 : using SvTreeListBox::SetCheckButtonState;
37 :
38 : protected:
39 : virtual void SetTabs() SAL_OVERRIDE;
40 : virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
41 : virtual void Resize() SAL_OVERRIDE;
42 :
43 : public:
44 0 : SvxFontSubstCheckListBox(SvSimpleTableContainer& rParent, WinBits nBits)
45 0 : : SvSimpleTable(rParent, nBits)
46 : {
47 0 : }
48 :
49 : inline void *GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); }
50 : inline void SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
51 :
52 : sal_Bool IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0);
53 : sal_Bool IsChecked(SvTreeListEntry* pEntry, sal_uInt16 nCol = 0);
54 : void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked);
55 : void CheckEntry(SvTreeListEntry* pEntry, sal_uInt16 nCol, sal_Bool bChecked);
56 : SvButtonState GetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol ) const;
57 : void SetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol, SvButtonState );
58 :
59 : void setColSizes();
60 : };
61 :
62 : // class SvxFontSubstTabPage ----------------------------------------------------
63 : class SvtFontSubstConfig;
64 : class SvxFontSubstTabPage : public SfxTabPage
65 : {
66 : CheckBox* m_pUseTableCB;
67 : VclContainer* m_pReplacements;
68 : FontNameBox* m_pFont1CB;
69 : FontNameBox* m_pFont2CB;
70 : PushButton* m_pApply;
71 : PushButton* m_pDelete;
72 :
73 : SvxFontSubstCheckListBox* m_pCheckLB;
74 :
75 : ListBox* m_pFontNameLB;
76 : CheckBox* m_pNonPropFontsOnlyCB;
77 : ListBox* m_pFontHeightLB;
78 :
79 : OUString m_sAutomatic;
80 :
81 : SvtFontSubstConfig* pConfig;
82 :
83 : Color aTextColor;
84 :
85 : SvLBoxButtonData* pCheckButtonData;
86 :
87 : DECL_LINK(SelectHdl, Window *pWin = 0);
88 : DECL_LINK(NonPropFontsHdl, CheckBox* pBox);
89 :
90 : SvTreeListEntry* CreateEntry(OUString& rFont1, OUString& rFont2);
91 : void CheckEnable();
92 :
93 :
94 : SvxFontSubstTabPage( Window* pParent, const SfxItemSet& rSet );
95 : virtual ~SvxFontSubstTabPage();
96 :
97 : public:
98 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
99 : virtual bool FillItemSet( SfxItemSet& rSet ) SAL_OVERRIDE;
100 : virtual void Reset( const SfxItemSet& rSet ) SAL_OVERRIDE;
101 : };
102 :
103 :
104 : #endif // INCLUDED_CUI_SOURCE_OPTIONS_FONTSUBS_HXX
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|