xref: /aoo4110/main/cui/source/options/fontsubs.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SVX_FONT_SUBSTITUTION_HXX
24 #define _SVX_FONT_SUBSTITUTION_HXX
25 
26 #include <sfx2/tabdlg.hxx>
27 #include <vcl/fixed.hxx>
28 #include <svx/simptabl.hxx>
29 #include <vcl/toolbox.hxx>
30 #include <svtools/ctrlbox.hxx>
31 
32 namespace utl
33 {
34     class SourceViewConfig;
35 }
36 
37 // class SvxFontSubstCheckListBox ------------------------------------------
38 
39 class SvxFontSubstCheckListBox : public SvxSimpleTable
40 {
41 	friend class SvxFontSubstTabPage;
42 	using SvxSimpleTable::SetTabs;
43 	using SvTreeListBox::GetCheckButtonState;
44 	using SvTreeListBox::SetCheckButtonState;
45 
46 	protected:
47 		virtual void	SetTabs();
48         virtual void    KeyInput( const KeyEvent& rKEvt );
49 
50 	public:
SvxFontSubstCheckListBox(Window * pParent,const ResId & rResId)51 		SvxFontSubstCheckListBox(Window* pParent, const ResId& rResId ) :
52 			SvxSimpleTable( pParent, rResId ){}
53 
GetUserData(sal_uLong nPos)54 		inline void 	*GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); }
SetUserData(sal_uLong nPos,void * pData)55 		inline void		SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
56 
57 		sal_Bool			IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0);
58 		sal_Bool			IsChecked(SvLBoxEntry* pEntry, sal_uInt16 nCol = 0);
59 		void			CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked);
60 		void			CheckEntry(SvLBoxEntry* pEntry, sal_uInt16 nCol, sal_Bool bChecked);
61 		SvButtonState	GetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol ) const;
62 		void			SetCheckButtonState( SvLBoxEntry*, sal_uInt16 nCol, SvButtonState );
63 };
64 
65 // class SvxFontSubstTabPage ----------------------------------------------------
66 class SvtFontSubstConfig;
67 namespace svt {class SourceViewConfig;}
68 class SvxFontSubstTabPage : public SfxTabPage
69 {
70 	CheckBox					aUseTableCB;
71     FixedText                   aFont1FT;
72 	FontNameBox					aFont1CB;
73 	FixedText					aFont2FT;
74 	FontNameBox					aFont2CB;
75 	ToolBox						aNewDelTBX;
76     SvxFontSubstCheckListBox    aCheckLB;
77 
78     FixedLine                   aSourceViewFontsFL;
79     FixedText                   aFontNameFT;
80     ListBox                     aFontNameLB;
81     CheckBox                    aNonPropFontsOnlyCB;
82     FixedText                   aFontHeightFT;
83     ListBox                     aFontHeightLB;
84 
85     ImageList                   aImageList;
86     String                      sAutomatic;
87 
88 	SvtFontSubstConfig*			pConfig;
89     utl::SourceViewConfig*      pSourceViewConfig;
90 
91 	String			sHeader1;
92 	String			sHeader2;
93 	String			sHeader3;
94 	String			sHeader4;
95 
96 	Color			aTextColor;
97 	ByteString		sFontGroup;
98 
99 	SvLBoxButtonData*	pCheckButtonData;
100 
101 	DECL_LINK(SelectHdl, Window *pWin = 0);
102     DECL_LINK(NonPropFontsHdl, CheckBox* pBox);
103 
104 	SvLBoxEntry*	CreateEntry(String& rFont1, String& rFont2);
105 	void			CheckEnable();
106 
107 
108 	SvxFontSubstTabPage( Window* pParent, const SfxItemSet& rSet );
109 	~SvxFontSubstTabPage();
110 
111 public:
112 	static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rAttrSet);
113 	virtual sal_Bool        FillItemSet( SfxItemSet& rSet );
114 	virtual void        Reset( const SfxItemSet& rSet );
115 };
116 
117 
118 #endif // _SVX_FONT_SUBSTITUTION_HXX
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131