bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / options / fontsubs.hxx
blobf89b173245d9ebaa205161d861c96d39c2c0874b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_CUI_SOURCE_OPTIONS_FONTSUBS_HXX
20 #define INCLUDED_CUI_SOURCE_OPTIONS_FONTSUBS_HXX
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>
29 // class SvxFontSubstCheckListBox ------------------------------------------
31 class SvxFontSubstCheckListBox : public SvSimpleTable
33 friend class SvxFontSubstTabPage;
34 using SvSimpleTable::SetTabs;
35 using SvTreeListBox::GetCheckButtonState;
36 using SvTreeListBox::SetCheckButtonState;
38 protected:
39 virtual void SetTabs() SAL_OVERRIDE;
40 virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
41 virtual void Resize() SAL_OVERRIDE;
43 public:
44 SvxFontSubstCheckListBox(SvSimpleTableContainer& rParent, WinBits nBits)
45 : SvSimpleTable(rParent, nBits)
49 inline void *GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); }
50 inline void SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
52 bool IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0);
53 static bool IsChecked(SvTreeListEntry* pEntry, sal_uInt16 nCol = 0);
54 void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked);
55 void CheckEntry(SvTreeListEntry* pEntry, sal_uInt16 nCol, bool bChecked);
56 static SvButtonState GetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol );
57 void SetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol, SvButtonState );
59 void setColSizes();
62 // class SvxFontSubstTabPage ----------------------------------------------------
63 class SvtFontSubstConfig;
64 class SvxFontSubstTabPage : public SfxTabPage
66 VclPtr<CheckBox> m_pUseTableCB;
67 VclPtr<VclContainer> m_pReplacements;
68 VclPtr<FontNameBox> m_pFont1CB;
69 VclPtr<FontNameBox> m_pFont2CB;
70 VclPtr<PushButton> m_pApply;
71 VclPtr<PushButton> m_pDelete;
73 VclPtr<SvxFontSubstCheckListBox> m_pCheckLB;
75 VclPtr<ListBox> m_pFontNameLB;
76 VclPtr<CheckBox> m_pNonPropFontsOnlyCB;
77 VclPtr<ListBox> m_pFontHeightLB;
79 OUString m_sAutomatic;
81 SvtFontSubstConfig* pConfig;
83 Color aTextColor;
85 SvLBoxButtonData* pCheckButtonData;
87 DECL_LINK(SelectHdl, vcl::Window *pWin = 0);
88 DECL_LINK(NonPropFontsHdl, CheckBox* pBox);
90 SvTreeListEntry* CreateEntry(OUString& rFont1, OUString& rFont2);
91 void CheckEnable();
94 virtual ~SvxFontSubstTabPage();
95 virtual void dispose() SAL_OVERRIDE;
97 public:
98 SvxFontSubstTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
99 static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
100 virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
101 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
105 #endif // INCLUDED_CUI_SOURCE_OPTIONS_FONTSUBS_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */