xref: /aoo4110/main/cui/source/inc/optlingu.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_OPTLINGU_HXX
24 #define _SVX_OPTLINGU_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <vcl/group.hxx>
29 #include <vcl/fixed.hxx>
30 #include <vcl/toolbox.hxx>
31 #include <vcl/field.hxx>
32 #include <svtools/fixedhyper.hxx>
33 #include <sfx2/tabdlg.hxx>
34 #include <svx/checklbx.hxx>
35 #include <svx/langbox.hxx>
36 #include <com/sun/star/uno/Reference.hxx>
37 #include <com/sun/star/uno/Sequence.hxx>
38 #include <com/sun/star/beans/XPropertySet.hpp>
39 
40 namespace com{namespace sun{namespace star{
41 namespace beans{
42 	class XPropertySet;
43 }
44 namespace linguistic2{
45 	class XDictionary;
46 	class XDictionaryList;
47     class XSpellChecker;
48 }}}}
49 
50 class SvLBoxEntry;
51 class SvxLinguData_Impl;
52 
53 // define ----------------------------------------------------------------
54 
55 #define GROUP_MODULES	((sal_uInt16)0x0008)
56 
57 // forward ---------------------------------------------------------------
58 
59 class SvxEditModulesDlg : public ModalDialog
60 {
61     FixedLine           aModulesFL;
62 	FixedText			aLanguageFT;
63 	SvxLanguageBox		aLanguageLB;
64 
65 	SvxCheckListBox		aModulesCLB;
66 	PushButton			aPrioUpPB;
67 	PushButton			aPrioDownPB;
68 	PushButton			aBackPB;
69     svt::FixedHyperlink aMoreDictsLink;
70 
71     FixedLine           aButtonsFL;
72     HelpButton          aHelpPB;
73     OKButton            aClosePB;
74 
75 	String 				sSpell;
76 	String 				sHyph;
77 	String 				sThes;
78     String              sGrammar;
79 
80     SvxLinguData_Impl*  pDefaultLinguData;
81 	SvxLinguData_Impl& 	rLinguData;
82 
83 	SvLBoxButtonData*	pCheckButtonData;
84 
85     SvLBoxEntry*    CreateEntry(String& rTxt, sal_uInt16 nCol);
86 
87 #ifdef _SVX_OPTLINGU_CXX
88 	DECL_LINK( SelectHdl_Impl, SvxCheckListBox * );
89 	DECL_LINK( UpDownHdl_Impl, PushButton * );
90 	DECL_LINK( ClickHdl_Impl, PushButton * );
91 	DECL_LINK( BackHdl_Impl, PushButton * );
92 	DECL_LINK( SelectHdlLB_Impl, ListBox * );
93     DECL_LINK( LangSelectHdl_Impl, ListBox* );
94     DECL_LINK( BoxCheckButtonHdl_Impl, SvTreeListBox * );
95     DECL_LINK( OpenURLHdl_Impl, svt::FixedHyperlink* );
96 #endif
97 
98 public:
99 	SvxEditModulesDlg(Window* pParent, SvxLinguData_Impl& rData);
100 	virtual	~SvxEditModulesDlg();
101 };
102 
103 // class SvxLinguTabPage -------------------------------------------------
104 
105 class SvxLinguTabPage : public SfxTabPage
106 {
107 private:
108     FixedLine           aLinguisticFL;
109 	FixedText			aLinguModulesFT;
110 	SvxCheckListBox		aLinguModulesCLB;
111 	PushButton			aLinguModulesEditPB;
112     FixedText           aLinguDicsFT;
113     SvxCheckListBox     aLinguDicsCLB;
114     PushButton          aLinguDicsNewPB;
115     PushButton          aLinguDicsEditPB;
116     PushButton          aLinguDicsDelPB;
117 	FixedText			aLinguOptionsFT;
118 	SvxCheckListBox		aLinguOptionsCLB;
119 	PushButton			aLinguOptionsEditPB;
120     svt::FixedHyperlink aMoreDictsLink;
121 
122 	String				sCapitalWords;
123 	String				sWordsWithDigits;
124 	String				sCapitalization;
125 	String				sSpellSpecial;
126 	String				sSpellAuto;
127     String              sGrammarAuto;
128 	String				sNumMinWordlen;
129 	String				sNumPreBreak;
130 	String				sNumPostBreak;
131 	String				sHyphAuto;
132 	String				sHyphSpecial;
133 
134 	com::sun::star::uno::Reference<
135 		com::sun::star::beans::XPropertySet >	xProp;
136 
137 	com::sun::star::uno::Reference<
138 		com::sun::star::linguistic2::XDictionaryList >		xDicList;
139 	com::sun::star::uno::Sequence<
140 		com::sun::star::uno::Reference<
141 			com::sun::star::linguistic2::XDictionary > >	aDics;
142 
143 	SvLBoxButtonData*	pCheckButtonData;
144 
145 	SvxLinguData_Impl* 	pLinguData;
146 
147 	SvxLinguTabPage( Window* pParent, const SfxItemSet& rCoreSet );
148 	SvLBoxEntry*	CreateEntry(String& rTxt, sal_uInt16 nCol);
149 
150     void    AddDicBoxEntry( const com::sun::star::uno::Reference< com::sun::star::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
151     sal_uLong   GetDicUserData( const com::sun::star::uno::Reference< com::sun::star::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
152 
153 #ifdef _SVX_OPTLINGU_CXX
154 	DECL_LINK( SelectHdl_Impl, SvxCheckListBox * );
155     DECL_LINK( ClickHdl_Impl, PushButton * );
156     DECL_LINK( BoxDoubleClickHdl_Impl, SvTreeListBox * );
157     DECL_LINK( BoxCheckButtonHdl_Impl, SvTreeListBox * );
158     DECL_LINK( PostDblClickHdl_Impl, SvTreeListBox * );
159     DECL_LINK( OpenURLHdl_Impl, svt::FixedHyperlink* );
160 
161     void                UpdateModulesBox_Impl();
162     void                UpdateDicBox_Impl();
163 #endif
164 
165 public:
166 	virtual				~SvxLinguTabPage();
167 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rSet );
168 	static sal_uInt16*	GetRanges();
169 
170 	virtual	sal_Bool 	FillItemSet( SfxItemSet& rSet );
171 	virtual	void 		Reset( const SfxItemSet& rSet );
172 
173 	void				HideGroups( sal_uInt16 nGrp );
174 };
175 
176 #endif
177 
178