merge the formfield patch from ooo-build
[ooovba.git] / linguistic / source / lngreg.cxx
blob6bf6f2021f34585a793641a663ec43e2a42dfc74
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: lngreg.cxx,v $
10 * $Revision: 1.8 $
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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_linguistic.hxx"
35 #include <cppuhelper/factory.hxx> // helper for factories
36 #include <rtl/string.hxx>
38 #include <com/sun/star/registry/XRegistryKey.hpp>
40 using namespace com::sun::star::lang;
42 using namespace com::sun::star::registry;
44 ////////////////////////////////////////
45 // declaration of external RegEntry-functions defined by the service objects
48 extern sal_Bool SAL_CALL LngSvcMgr_writeInfo
50 void * /*pServiceManager*/,
51 XRegistryKey * pRegistryKey
54 extern sal_Bool SAL_CALL DicList_writeInfo
56 void * /*pServiceManager*/, XRegistryKey * pRegistryKey
59 extern sal_Bool SAL_CALL LinguProps_writeInfo
61 void * /*pServiceManager*/,
62 XRegistryKey * pRegistryKey
65 extern sal_Bool SAL_CALL ConvDicList_writeInfo
67 void * /*pServiceManager*/, XRegistryKey * pRegistryKey
70 extern sal_Bool SAL_CALL GrammarCheckingIterator_writeInfo
72 void * /*pServiceManager*/, XRegistryKey * pRegistryKey
75 //extern sal_Bool SAL_CALL GrammarChecker_writeInfo
76 //(
77 // void * /*pServiceManager*/, XRegistryKey * pRegistryKey
78 //);
80 extern void * SAL_CALL LngSvcMgr_getFactory
82 const sal_Char * pImplName,
83 XMultiServiceFactory * pServiceManager,
84 void * /*pRegistryKey*/
87 extern void * SAL_CALL DicList_getFactory
89 const sal_Char * pImplName,
90 XMultiServiceFactory * pServiceManager,
91 void *
94 void * SAL_CALL LinguProps_getFactory
96 const sal_Char * pImplName,
97 XMultiServiceFactory * pServiceManager,
98 void *
101 extern void * SAL_CALL ConvDicList_getFactory
103 const sal_Char * pImplName,
104 XMultiServiceFactory * pServiceManager,
105 void *
108 extern void * SAL_CALL GrammarCheckingIterator_getFactory
110 const sal_Char * pImplName,
111 XMultiServiceFactory * pServiceManager,
112 void *
115 //extern void * SAL_CALL GrammarChecker_getFactory
117 // const sal_Char * pImplName,
118 // XMultiServiceFactory * pServiceManager,
119 // void *
120 //);
122 ////////////////////////////////////////
123 // definition of the two functions that are used to provide the services
126 extern "C"
129 void SAL_CALL component_getImplementationEnvironment(
130 const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
132 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
135 sal_Bool SAL_CALL component_writeInfo
137 void * pServiceManager,
138 XRegistryKey * pRegistryKey
141 sal_Bool bRet = LngSvcMgr_writeInfo( pServiceManager, pRegistryKey );
142 if(bRet)
143 bRet = LinguProps_writeInfo( pServiceManager, pRegistryKey );
144 if(bRet)
145 bRet = DicList_writeInfo( pServiceManager, pRegistryKey );
146 if(bRet)
147 bRet = ConvDicList_writeInfo( pServiceManager, pRegistryKey );
148 if(bRet)
149 bRet = GrammarCheckingIterator_writeInfo( pServiceManager, pRegistryKey );
151 if(bRet)
152 bRet = GrammarChecker_writeInfo( pServiceManager, pRegistryKey );
154 return bRet;
157 void * SAL_CALL component_getFactory(
158 const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
160 void * pRet =
161 LngSvcMgr_getFactory(
162 pImplName,
163 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
164 pRegistryKey );
166 if(!pRet)
167 pRet = LinguProps_getFactory(
168 pImplName,
169 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
170 pRegistryKey );
172 if(!pRet)
173 pRet = DicList_getFactory(
174 pImplName,
175 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
176 pRegistryKey );
178 if(!pRet)
179 pRet = ConvDicList_getFactory(
180 pImplName,
181 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
182 pRegistryKey );
184 if(!pRet)
185 pRet = GrammarCheckingIterator_getFactory(
186 pImplName,
187 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
188 pRegistryKey );
190 if(!pRet)
191 pRet = GrammarChecker_getFactory(
192 pImplName,
193 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
194 pRegistryKey );
196 return pRet;
200 ///////////////////////////////////////////////////////////////////////////