xref: /aoo41x/main/linguistic/source/lngreg.cxx (revision 3b8558fd)
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 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_linguistic.hxx"
26 
27 
28 #include <cppuhelper/factory.hxx>	// helper for factories
29 #include <rtl/string.hxx>
30 
31 #include <com/sun/star/registry/XRegistryKey.hpp>
32 
33 using namespace com::sun::star::lang;
34 
35 using namespace com::sun::star::registry;
36 
37 extern void * SAL_CALL LngSvcMgr_getFactory
38 (
39 	const sal_Char * pImplName,
40 	XMultiServiceFactory * pServiceManager,
41 	void * /*pRegistryKey*/
42 );
43 
44 extern void * SAL_CALL DicList_getFactory
45 (
46 	const sal_Char * pImplName,
47 	XMultiServiceFactory * pServiceManager,
48 	void *
49 );
50 
51 void * SAL_CALL LinguProps_getFactory
52 (
53 	const sal_Char * pImplName,
54 	XMultiServiceFactory * pServiceManager,
55 	void *
56 );
57 
58 extern void * SAL_CALL ConvDicList_getFactory
59 (
60     const sal_Char * pImplName,
61     XMultiServiceFactory * pServiceManager,
62     void *
63 );
64 
65 extern void * SAL_CALL GrammarCheckingIterator_getFactory
66 (
67     const sal_Char * pImplName,
68     XMultiServiceFactory * pServiceManager,
69     void *
70 );
71 
72 //extern void * SAL_CALL GrammarChecker_getFactory
73 //(
74 //    const sal_Char * pImplName,
75 //    XMultiServiceFactory * pServiceManager,
76 //    void *
77 //);
78 
79 ////////////////////////////////////////
80 // definition of the two functions that are used to provide the services
81 //
82 
83 extern "C"
84 {
85 
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)86 void SAL_CALL component_getImplementationEnvironment(
87     const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
88 {
89     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
90 }
91 
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void * pRegistryKey)92 void * SAL_CALL component_getFactory(
93 	const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
94 {
95 	void * pRet =
96 		LngSvcMgr_getFactory(
97 			pImplName,
98 			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
99 			pRegistryKey );
100 
101 	if(!pRet)
102 		pRet = LinguProps_getFactory(
103 			pImplName,
104 			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
105 			pRegistryKey );
106 
107 	if(!pRet)
108 		pRet = 	DicList_getFactory(
109 			pImplName,
110 			reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
111 			pRegistryKey );
112 
113     if(!pRet)
114         pRet =  ConvDicList_getFactory(
115             pImplName,
116             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
117             pRegistryKey );
118 
119 	if(!pRet)
120         pRet =  GrammarCheckingIterator_getFactory(
121             pImplName,
122             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
123             pRegistryKey );
124 /*
125 	if(!pRet)
126         pRet =  GrammarChecker_getFactory(
127             pImplName,
128             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
129             pRegistryKey );
130 */
131 	return pRet;
132 }
133 }
134 
135 ///////////////////////////////////////////////////////////////////////////
136 
137