Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _UNO_LINGU_HXX
30 : : #define _UNO_LINGU_HXX
31 : :
32 : : #include <i18npool/lang.h>
33 : : #include <tools/string.hxx>
34 : : #include <com/sun/star/util/Language.hpp>
35 : : #include <com/sun/star/lang/Locale.hpp>
36 : : #include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
37 : : #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
38 : : #include <com/sun/star/linguistic2/XHyphenator.hpp>
39 : : #include <com/sun/star/linguistic2/XThesaurus.hpp>
40 : : #include <com/sun/star/linguistic2/XDictionaryList.hpp>
41 : : #include <com/sun/star/beans/XPropertySet.hpp>
42 : : #include "editeng/editengdllapi.h"
43 : :
44 : : class LinguMgrExitLstnr;
45 : :
46 : : class Window;
47 : :
48 : : ///////////////////////////////////////////////////////////////////////////
49 : :
50 : : class EDITENG_DLLPUBLIC LinguMgr
51 : : {
52 : : friend class LinguMgrExitLstnr;
53 : :
54 : : static ::com::sun::star::uno::Reference<
55 : : ::com::sun::star::linguistic2::XLinguServiceManager > xLngSvcMgr;
56 : : static ::com::sun::star::uno::Reference<
57 : : ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
58 : : static ::com::sun::star::uno::Reference<
59 : : ::com::sun::star::linguistic2::XHyphenator > xHyph;
60 : : static ::com::sun::star::uno::Reference<
61 : : ::com::sun::star::linguistic2::XThesaurus > xThes;
62 : : static ::com::sun::star::uno::Reference<
63 : : ::com::sun::star::linguistic2::XDictionaryList > xDicList;
64 : : static ::com::sun::star::uno::Reference<
65 : : ::com::sun::star::beans::XPropertySet > xProp;
66 : :
67 : : static ::com::sun::star::uno::Reference<
68 : : ::com::sun::star::linguistic2::XDictionary > xIgnoreAll;
69 : : static ::com::sun::star::uno::Reference<
70 : : ::com::sun::star::linguistic2::XDictionary > xChangeAll;
71 : :
72 : : static LinguMgrExitLstnr *pExitLstnr;
73 : : static sal_Bool bExiting;
74 : :
75 : : static ::com::sun::star::uno::Reference<
76 : : ::com::sun::star::linguistic2::XSpellChecker1 > GetSpell();
77 : : static ::com::sun::star::uno::Reference<
78 : : ::com::sun::star::linguistic2::XHyphenator > GetHyph();
79 : : static ::com::sun::star::uno::Reference<
80 : : ::com::sun::star::linguistic2::XThesaurus > GetThes();
81 : : static ::com::sun::star::uno::Reference<
82 : : ::com::sun::star::linguistic2::XDictionaryList > GetDicList();
83 : : static ::com::sun::star::uno::Reference<
84 : : ::com::sun::star::beans::XPropertySet > GetProp();
85 : : static ::com::sun::star::uno::Reference<
86 : : ::com::sun::star::linguistic2::XDictionary > GetStandard();
87 : : static ::com::sun::star::uno::Reference<
88 : : ::com::sun::star::linguistic2::XDictionary > GetIgnoreAll();
89 : : static ::com::sun::star::uno::Reference<
90 : : ::com::sun::star::linguistic2::XDictionary > GetChangeAll();
91 : :
92 : : // disallow access to copy-constructor and assignment-operator
93 : : LinguMgr(const LinguMgr &);
94 : : LinguMgr & operator = (const LinguMgr &);
95 : :
96 : : public:
97 : :
98 : : static ::com::sun::star::uno::Reference<
99 : : ::com::sun::star::linguistic2::XSpellChecker1 > GetSpellChecker();
100 : : static ::com::sun::star::uno::Reference<
101 : : ::com::sun::star::linguistic2::XHyphenator > GetHyphenator();
102 : : static ::com::sun::star::uno::Reference<
103 : : ::com::sun::star::linguistic2::XThesaurus > GetThesaurus();
104 : : static ::com::sun::star::uno::Reference<
105 : : ::com::sun::star::linguistic2::XDictionaryList > GetDictionaryList();
106 : : static ::com::sun::star::uno::Reference<
107 : : ::com::sun::star::beans::XPropertySet > GetLinguPropertySet();
108 : :
109 : : static ::com::sun::star::uno::Reference<
110 : : ::com::sun::star::linguistic2::XLinguServiceManager > GetLngSvcMgr();
111 : :
112 : : static ::com::sun::star::uno::Reference<
113 : : ::com::sun::star::linguistic2::XDictionary > GetStandardDic();
114 : : static ::com::sun::star::uno::Reference<
115 : : ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList();
116 : : static ::com::sun::star::uno::Reference<
117 : : ::com::sun::star::linguistic2::XDictionary > GetChangeAllList();
118 : : };
119 : :
120 : : ///////////////////////////////////////////////////////////////////////////
121 : :
122 : : namespace com { namespace sun { namespace star { namespace linguistic2 {
123 : : class XHyphenatedWord;
124 : : }}}}
125 : :
126 : :
127 : 0 : struct SvxAlternativeSpelling
128 : : {
129 : : String aReplacement;
130 : : ::com::sun::star::uno::Reference<
131 : : ::com::sun::star::linguistic2::XHyphenatedWord > xHyphWord;
132 : : sal_Int16 nChangedPos,
133 : : nChangedLength;
134 : : sal_Bool bIsAltSpelling;
135 : :
136 : : inline SvxAlternativeSpelling();
137 : : };
138 : :
139 : 0 : inline SvxAlternativeSpelling::SvxAlternativeSpelling() :
140 : 0 : nChangedPos(-1), nChangedLength(-1), bIsAltSpelling(sal_False)
141 : : {
142 : 0 : }
143 : :
144 : :
145 : : EDITENG_DLLPUBLIC SvxAlternativeSpelling SvxGetAltSpelling(
146 : : const ::com::sun::star::uno::Reference<
147 : : ::com::sun::star::linguistic2::XHyphenatedWord > & rHyphWord );
148 : :
149 : :
150 : : ///////////////////////////////////////////////////////////////////////////
151 : :
152 : : class EDITENG_DLLPUBLIC SvxDicListChgClamp
153 : : {
154 : : private:
155 : : ::com::sun::star::uno::Reference<
156 : : ::com::sun::star::linguistic2::XDictionaryList > xDicList;
157 : :
158 : : // disallow access to copy-constructor and assignment-operator
159 : : EDITENG_DLLPRIVATE SvxDicListChgClamp(const SvxDicListChgClamp &);
160 : : EDITENG_DLLPRIVATE SvxDicListChgClamp & operator = (const SvxDicListChgClamp &);
161 : :
162 : : public:
163 : : SvxDicListChgClamp( ::com::sun::star::uno::Reference<
164 : : ::com::sun::star::linguistic2::XDictionaryList > &rxDicList );
165 : : ~SvxDicListChgClamp();
166 : : };
167 : :
168 : : ///////////////////////////////////////////////////////////////////////////
169 : :
170 : : //TODO: remove those functions or make them inline
171 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
172 : : ::com::sun::star::linguistic2::XSpellChecker1 > SvxGetSpellChecker();
173 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
174 : : ::com::sun::star::linguistic2::XHyphenator > SvxGetHyphenator();
175 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
176 : : ::com::sun::star::linguistic2::XThesaurus > SvxGetThesaurus();
177 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
178 : : ::com::sun::star::linguistic2::XDictionaryList > SvxGetDictionaryList();
179 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
180 : : ::com::sun::star::beans::XPropertySet > SvxGetLinguPropertySet();
181 : : //TODO: remove argument or provide SvxGetIgnoreAllList with the same one
182 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
183 : : ::com::sun::star::linguistic2::XDictionary > SvxGetOrCreatePosDic(
184 : : ::com::sun::star::uno::Reference<
185 : : ::com::sun::star::linguistic2::XDictionaryList > xDicList );
186 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
187 : : ::com::sun::star::linguistic2::XDictionary > SvxGetIgnoreAllList();
188 : : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
189 : : ::com::sun::star::linguistic2::XDictionary > SvxGetChangeAllList();
190 : :
191 : : ///////////////////////////////////////////////////////////////////////////
192 : : // misc functions
193 : : //
194 : :
195 : : EDITENG_DLLPUBLIC LanguageType SvxLocaleToLanguage(
196 : : const ::com::sun::star::lang::Locale& rLocale );
197 : : EDITENG_DLLPUBLIC ::com::sun::star::lang::Locale& SvxLanguageToLocale(
198 : : ::com::sun::star::lang::Locale& rLocale, LanguageType eLang );
199 : : EDITENG_DLLPUBLIC ::com::sun::star::lang::Locale SvxCreateLocale( LanguageType eLang );
200 : :
201 : :
202 : : EDITENG_DLLPUBLIC short SvxDicError( Window *pParent, sal_Int16 nError );
203 : :
204 : :
205 : : #endif
206 : :
207 : :
208 : :
209 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|