xref: /trunk/main/cui/source/inc/optlingu.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SVX_OPTLINGU_HXX
28 #define _SVX_OPTLINGU_HXX
29 
30 // include ---------------------------------------------------------------
31 
32 #include <vcl/group.hxx>
33 #include <vcl/fixed.hxx>
34 #include <vcl/toolbox.hxx>
35 #include <vcl/field.hxx>
36 #include <svtools/fixedhyper.hxx>
37 #include <sfx2/tabdlg.hxx>
38 #include <svx/checklbx.hxx>
39 #include <svx/langbox.hxx>
40 #include <com/sun/star/uno/Reference.hxx>
41 #include <com/sun/star/uno/Sequence.hxx>
42 #include <com/sun/star/beans/XPropertySet.hpp>
43 
44 namespace com{namespace sun{namespace star{
45 namespace beans{
46 	class XPropertySet;
47 }
48 namespace linguistic2{
49 	class XDictionary;
50 	class XDictionaryList;
51     class XSpellChecker;
52 }}}}
53 
54 class SvLBoxEntry;
55 class SvxLinguData_Impl;
56 
57 // define ----------------------------------------------------------------
58 
59 #define GROUP_MODULES	((sal_uInt16)0x0008)
60 
61 // forward ---------------------------------------------------------------
62 
63 class SvxEditModulesDlg : public ModalDialog
64 {
65     FixedLine           aModulesFL;
66 	FixedText			aLanguageFT;
67 	SvxLanguageBox		aLanguageLB;
68 
69 	SvxCheckListBox		aModulesCLB;
70 	PushButton			aPrioUpPB;
71 	PushButton			aPrioDownPB;
72 	PushButton			aBackPB;
73     svt::FixedHyperlink aMoreDictsLink;
74 
75     FixedLine           aButtonsFL;
76     HelpButton          aHelpPB;
77     OKButton            aClosePB;
78 
79 	String 				sSpell;
80 	String 				sHyph;
81 	String 				sThes;
82     String              sGrammar;
83 
84     SvxLinguData_Impl*  pDefaultLinguData;
85 	SvxLinguData_Impl& 	rLinguData;
86 
87 	SvLBoxButtonData*	pCheckButtonData;
88 
89     SvLBoxEntry*    CreateEntry(String& rTxt, sal_uInt16 nCol);
90 
91 #ifdef _SVX_OPTLINGU_CXX
92 	DECL_LINK( SelectHdl_Impl, SvxCheckListBox * );
93 	DECL_LINK( UpDownHdl_Impl, PushButton * );
94 	DECL_LINK( ClickHdl_Impl, PushButton * );
95 	DECL_LINK( BackHdl_Impl, PushButton * );
96 	DECL_LINK( SelectHdlLB_Impl, ListBox * );
97     DECL_LINK( LangSelectHdl_Impl, ListBox* );
98     DECL_LINK( BoxCheckButtonHdl_Impl, SvTreeListBox * );
99     DECL_LINK( OpenURLHdl_Impl, svt::FixedHyperlink* );
100 #endif
101 
102 public:
103 	SvxEditModulesDlg(Window* pParent, SvxLinguData_Impl& rData);
104 	virtual	~SvxEditModulesDlg();
105 };
106 
107 // class SvxLinguTabPage -------------------------------------------------
108 
109 class SvxLinguTabPage : public SfxTabPage
110 {
111 private:
112     FixedLine           aLinguisticFL;
113 	FixedText			aLinguModulesFT;
114 	SvxCheckListBox		aLinguModulesCLB;
115 	PushButton			aLinguModulesEditPB;
116     FixedText           aLinguDicsFT;
117     SvxCheckListBox     aLinguDicsCLB;
118     PushButton          aLinguDicsNewPB;
119     PushButton          aLinguDicsEditPB;
120     PushButton          aLinguDicsDelPB;
121 	FixedText			aLinguOptionsFT;
122 	SvxCheckListBox		aLinguOptionsCLB;
123 	PushButton			aLinguOptionsEditPB;
124     svt::FixedHyperlink aMoreDictsLink;
125 
126 	String				sCapitalWords;
127 	String				sWordsWithDigits;
128 	String				sCapitalization;
129 	String				sSpellSpecial;
130 	String				sSpellAuto;
131     String              sGrammarAuto;
132 	String				sNumMinWordlen;
133 	String				sNumPreBreak;
134 	String				sNumPostBreak;
135 	String				sHyphAuto;
136 	String				sHyphSpecial;
137 
138 	com::sun::star::uno::Reference<
139 		com::sun::star::beans::XPropertySet >	xProp;
140 
141 	com::sun::star::uno::Reference<
142 		com::sun::star::linguistic2::XDictionaryList >		xDicList;
143 	com::sun::star::uno::Sequence<
144 		com::sun::star::uno::Reference<
145 			com::sun::star::linguistic2::XDictionary > >	aDics;
146 
147 	SvLBoxButtonData*	pCheckButtonData;
148 
149 	SvxLinguData_Impl* 	pLinguData;
150 
151 	SvxLinguTabPage( Window* pParent, const SfxItemSet& rCoreSet );
152 	SvLBoxEntry*	CreateEntry(String& rTxt, sal_uInt16 nCol);
153 
154     void    AddDicBoxEntry( const com::sun::star::uno::Reference< com::sun::star::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
155     sal_uLong   GetDicUserData( const com::sun::star::uno::Reference< com::sun::star::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
156 
157 #ifdef _SVX_OPTLINGU_CXX
158 	DECL_LINK( SelectHdl_Impl, SvxCheckListBox * );
159     DECL_LINK( ClickHdl_Impl, PushButton * );
160     DECL_LINK( BoxDoubleClickHdl_Impl, SvTreeListBox * );
161     DECL_LINK( BoxCheckButtonHdl_Impl, SvTreeListBox * );
162     DECL_LINK( PostDblClickHdl_Impl, SvTreeListBox * );
163     DECL_LINK( OpenURLHdl_Impl, svt::FixedHyperlink* );
164 
165     void                UpdateModulesBox_Impl();
166     void                UpdateDicBox_Impl();
167 #endif
168 
169 public:
170 	virtual				~SvxLinguTabPage();
171 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rSet );
172 	static sal_uInt16*	GetRanges();
173 
174 	virtual	sal_Bool 	FillItemSet( SfxItemSet& rSet );
175 	virtual	void 		Reset( const SfxItemSet& rSet );
176 
177 	void				HideGroups( sal_uInt16 nGrp );
178 };
179 
180 #endif
181 
182