Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / unolingu.hxx
blob65174886f36c24db473a259a02ffeaf397fee95e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unolingu.hxx,v $
10 * $Revision: 1.9 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _UNO_LINGU_HXX
32 #define _UNO_LINGU_HXX
34 #ifndef INCLUDED_I18NPOOL_LANG_H
35 #include <i18npool/lang.h>
36 #endif
37 #ifndef _STRING_HXX
38 #include <tools/string.hxx>
39 #endif
41 #ifndef _COM_SUN_STAR_LINGUISTIC2_XLINGUSERVICEMANAGER_HPP_
42 #include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
43 #endif
44 #ifndef _COM_SUN_STAR_LINGUISTIC2_XSPELLCHECKER1_HPP_
45 #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
46 #endif
47 #ifndef _COM_SUN_STAR_LINGUISTIC2_XDICTIONARYLIST_HPP_
48 #include <com/sun/star/linguistic2/XDictionaryList.hpp>
49 #endif
50 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
51 #include <com/sun/star/beans/XPropertySet.hpp>
52 #endif
53 #ifndef _COM_SUN_STAR_LINGUISTIC2_XDICTIONARY1_HPP_
54 #include <com/sun/star/linguistic2/XDictionary1.hpp>
55 #endif
56 class Window;
57 namespace binfilter {
59 class LinguMgrExitLstnr;
62 // SvxAddEntryToDic return values
63 #define DIC_ERR_NONE 0
64 #define DIC_ERR_FULL 1
65 #define DIC_ERR_READONLY 2
66 #define DIC_ERR_UNKNOWN 3
67 #define DIC_ERR_NOT_EXISTS 4
68 //#define DIC_ERR_ENTRY_EXISTS 5
69 //#define DIC_ERR_ENTRY_NOTEXISTS 6
71 ///////////////////////////////////////////////////////////////////////////
72 // SvxLinguConfigUpdate
73 // class to update configuration items when (before!) the linguistic is used.
75 // This class is called by all the dummy implementations to update all of the
76 // configuration (list of used/available services) when the linguistic is
77 // accessed for the first time.
79 class SvxLinguConfigUpdate
81 static BOOL bUpdated;
83 public:
85 static BOOL IsUpdated() { return bUpdated; }
86 static void UpdateAll();
89 ///////////////////////////////////////////////////////////////////////////
91 class LinguMgr
93 friend class LinguMgrExitLstnr;
95 //static ::VOS::ORefCount aRefCount;
97 static ::com::sun::star::uno::Reference<
98 ::com::sun::star::linguistic2::XLinguServiceManager > xLngSvcMgr;
99 static ::com::sun::star::uno::Reference<
100 ::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
101 static ::com::sun::star::uno::Reference<
102 ::com::sun::star::linguistic2::XHyphenator > xHyph;
103 static ::com::sun::star::uno::Reference<
104 ::com::sun::star::linguistic2::XThesaurus > xThes;
105 static ::com::sun::star::uno::Reference<
106 ::com::sun::star::linguistic2::XDictionaryList > xDicList;
107 static ::com::sun::star::uno::Reference<
108 ::com::sun::star::beans::XPropertySet > xProp;
110 static ::com::sun::star::uno::Reference<
111 ::com::sun::star::linguistic2::XDictionary1 > xIgnoreAll;
112 static ::com::sun::star::uno::Reference<
113 ::com::sun::star::linguistic2::XDictionary1 > xChangeAll;
115 static LinguMgrExitLstnr *pExitLstnr;
116 static sal_Bool bExiting;
118 static ::com::sun::star::uno::Reference<
119 ::com::sun::star::linguistic2::XHyphenator > GetHyph();
120 static ::com::sun::star::uno::Reference<
121 ::com::sun::star::linguistic2::XDictionaryList > GetDicList();
123 // disallow access to copy-constructor and assignment-operator
124 LinguMgr(const LinguMgr &);
125 LinguMgr & operator = (const LinguMgr &);
127 public:
129 static ::com::sun::star::uno::Reference<
130 ::com::sun::star::linguistic2::XHyphenator > GetHyphenator();
131 static ::com::sun::star::uno::Reference<
132 ::com::sun::star::linguistic2::XDictionaryList > GetDictionaryList();
133 static ::com::sun::star::uno::Reference<
134 ::com::sun::star::beans::XPropertySet > GetLinguPropertySet();
137 // update all configuration entries
138 static void UpdateAll();
141 ///////////////////////////////////////////////////////////////////////////
142 }//end of namespace binfilter
143 namespace com { namespace sun { namespace star { namespace linguistic2 {
144 class XHyphenatedWord;
145 }}}}
146 namespace binfilter {
147 struct SvxAlternativeSpelling
149 String aReplacement;
150 ::com::sun::star::uno::Reference<
151 ::com::sun::star::linguistic2::XHyphenatedWord > xHyphWord;
152 INT16 nChangedPos,
153 nChangedLength;
154 BOOL bIsAltSpelling;
156 inline SvxAlternativeSpelling();
159 inline SvxAlternativeSpelling::SvxAlternativeSpelling() :
160 nChangedPos(-1), nChangedLength(-1), bIsAltSpelling(FALSE)
165 ///////////////////////////////////////////////////////////////////////////
168 ///////////////////////////////////////////////////////////////////////////
170 //TL:TODO: remove those functions or make them inline
171 //TL:TODO: remove argument or provide SvxGetIgnoreAllList with the same one
173 ///////////////////////////////////////////////////////////////////////////
174 // misc functions
177 LanguageType SvxLocaleToLanguage(
178 const ::com::sun::star::lang::Locale& rLocale );
179 ::com::sun::star::lang::Locale& SvxLanguageToLocale(
180 ::com::sun::star::lang::Locale& rLocale, LanguageType eLang );
181 ::com::sun::star::lang::Locale SvxCreateLocale( LanguageType eLang );
184 //TL:TODO: soll mal den rictigen Rückgabetyp bekommen!
187 }//end of namespace binfilter
188 #endif