Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_EDITENG_UNOLINGU_HXX
21 : #define INCLUDED_EDITENG_UNOLINGU_HXX
22 :
23 : #include <i18nlangtag/lang.h>
24 : #include <rtl/ustring.hxx>
25 : #include <com/sun/star/util/Language.hpp>
26 : #include <com/sun/star/linguistic2/XLinguServiceManager2.hpp>
27 : #include <com/sun/star/linguistic2/XLinguProperties.hpp>
28 : #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
29 : #include <com/sun/star/linguistic2/XHyphenator.hpp>
30 : #include <com/sun/star/linguistic2/XThesaurus.hpp>
31 : #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
32 : #include <com/sun/star/beans/XPropertySet.hpp>
33 : #include <editeng/editengdllapi.h>
34 :
35 : class LinguMgrExitLstnr;
36 :
37 : namespace vcl { class Window; }
38 : namespace linguistic { enum class DictionaryError; }
39 :
40 :
41 :
42 : class EDITENG_DLLPUBLIC LinguMgr
43 : {
44 : friend class LinguMgrExitLstnr;
45 :
46 : static ::com::sun::star::uno::Reference<
47 : ::com::sun::star::linguistic2::XLinguServiceManager2 > xLngSvcMgr;
48 : static ::com::sun::star::uno::Reference<
49 : ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
50 : static ::com::sun::star::uno::Reference<
51 : ::com::sun::star::linguistic2::XHyphenator > xHyph;
52 : static ::com::sun::star::uno::Reference<
53 : ::com::sun::star::linguistic2::XThesaurus > xThes;
54 : static ::com::sun::star::uno::Reference<
55 : ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList;
56 : static ::com::sun::star::uno::Reference<
57 : ::com::sun::star::linguistic2::XLinguProperties > xProp;
58 :
59 : static ::com::sun::star::uno::Reference<
60 : ::com::sun::star::linguistic2::XDictionary > xIgnoreAll;
61 : static ::com::sun::star::uno::Reference<
62 : ::com::sun::star::linguistic2::XDictionary > xChangeAll;
63 :
64 : static LinguMgrExitLstnr *pExitLstnr;
65 : static bool bExiting;
66 :
67 : static ::com::sun::star::uno::Reference<
68 : ::com::sun::star::linguistic2::XSpellChecker1 > GetSpell();
69 : static ::com::sun::star::uno::Reference<
70 : ::com::sun::star::linguistic2::XHyphenator > GetHyph();
71 : static ::com::sun::star::uno::Reference<
72 : ::com::sun::star::linguistic2::XThesaurus > GetThes();
73 : static ::com::sun::star::uno::Reference<
74 : ::com::sun::star::linguistic2::XSearchableDictionaryList > GetDicList();
75 : static ::com::sun::star::uno::Reference<
76 : ::com::sun::star::linguistic2::XLinguProperties > GetProp();
77 : static ::com::sun::star::uno::Reference<
78 : ::com::sun::star::linguistic2::XDictionary > GetStandard();
79 : static ::com::sun::star::uno::Reference<
80 : ::com::sun::star::linguistic2::XDictionary > GetIgnoreAll();
81 : static ::com::sun::star::uno::Reference<
82 : ::com::sun::star::linguistic2::XDictionary > GetChangeAll();
83 :
84 : LinguMgr(const LinguMgr &) SAL_DELETED_FUNCTION;
85 : LinguMgr & operator = (const LinguMgr &) SAL_DELETED_FUNCTION;
86 :
87 : public:
88 :
89 : static ::com::sun::star::uno::Reference<
90 : ::com::sun::star::linguistic2::XSpellChecker1 > GetSpellChecker();
91 : static ::com::sun::star::uno::Reference<
92 : ::com::sun::star::linguistic2::XHyphenator > GetHyphenator();
93 : static ::com::sun::star::uno::Reference<
94 : ::com::sun::star::linguistic2::XThesaurus > GetThesaurus();
95 : static ::com::sun::star::uno::Reference<
96 : ::com::sun::star::linguistic2::XSearchableDictionaryList > GetDictionaryList();
97 : static ::com::sun::star::uno::Reference<
98 : ::com::sun::star::linguistic2::XLinguProperties > GetLinguPropertySet();
99 :
100 : static ::com::sun::star::uno::Reference<
101 : ::com::sun::star::linguistic2::XLinguServiceManager2 > GetLngSvcMgr();
102 :
103 : static ::com::sun::star::uno::Reference<
104 : ::com::sun::star::linguistic2::XDictionary > GetStandardDic();
105 : static ::com::sun::star::uno::Reference<
106 : ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList();
107 : static ::com::sun::star::uno::Reference<
108 : ::com::sun::star::linguistic2::XDictionary > GetChangeAllList();
109 : };
110 :
111 :
112 :
113 : namespace com { namespace sun { namespace star { namespace linguistic2 {
114 : class XHyphenatedWord;
115 : }}}}
116 :
117 :
118 0 : struct SvxAlternativeSpelling
119 : {
120 : OUString aReplacement;
121 : css::uno::Reference< css::linguistic2::XHyphenatedWord >
122 : xHyphWord;
123 : sal_Int16 nChangedPos,
124 : nChangedLength;
125 : bool bIsAltSpelling;
126 :
127 : inline SvxAlternativeSpelling();
128 : };
129 :
130 0 : inline SvxAlternativeSpelling::SvxAlternativeSpelling() :
131 0 : nChangedPos(-1), nChangedLength(-1), bIsAltSpelling(false)
132 : {
133 0 : }
134 :
135 :
136 : EDITENG_DLLPUBLIC SvxAlternativeSpelling SvxGetAltSpelling(
137 : const ::com::sun::star::uno::Reference<
138 : ::com::sun::star::linguistic2::XHyphenatedWord > & rHyphWord );
139 :
140 :
141 :
142 :
143 : class EDITENG_DLLPUBLIC SvxDicListChgClamp
144 : {
145 : private:
146 : ::com::sun::star::uno::Reference<
147 : ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList;
148 :
149 : SvxDicListChgClamp(const SvxDicListChgClamp &) SAL_DELETED_FUNCTION;
150 : SvxDicListChgClamp & operator = (const SvxDicListChgClamp &) SAL_DELETED_FUNCTION;
151 :
152 : public:
153 : SvxDicListChgClamp( ::com::sun::star::uno::Reference<
154 : ::com::sun::star::linguistic2::XSearchableDictionaryList > &rxDicList );
155 : ~SvxDicListChgClamp();
156 : };
157 :
158 :
159 :
160 : //TODO: remove those functions or make them inline
161 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
162 : ::com::sun::star::linguistic2::XSpellChecker1 > SvxGetSpellChecker();
163 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
164 : ::com::sun::star::linguistic2::XHyphenator > SvxGetHyphenator();
165 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
166 : ::com::sun::star::linguistic2::XThesaurus > SvxGetThesaurus();
167 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
168 : ::com::sun::star::linguistic2::XSearchableDictionaryList > SvxGetDictionaryList();
169 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
170 : ::com::sun::star::linguistic2::XLinguProperties > SvxGetLinguPropertySet();
171 : //TODO: remove argument or provide SvxGetIgnoreAllList with the same one
172 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
173 : ::com::sun::star::linguistic2::XDictionary > SvxGetOrCreatePosDic(
174 : ::com::sun::star::uno::Reference<
175 : ::com::sun::star::linguistic2::XSearchableDictionaryList > xDicList );
176 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
177 : ::com::sun::star::linguistic2::XDictionary > SvxGetIgnoreAllList();
178 : EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference<
179 : ::com::sun::star::linguistic2::XDictionary > SvxGetChangeAllList();
180 :
181 :
182 : // misc functions
183 :
184 :
185 : EDITENG_DLLPUBLIC short SvxDicError( vcl::Window *pParent, linguistic::DictionaryError nError );
186 :
187 :
188 : #endif
189 :
190 :
191 :
192 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|