xref: /trunk/main/linguistic/source/lngreg.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
13b8558fdSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
33b8558fdSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
43b8558fdSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
53b8558fdSAndrew Rist  * distributed with this work for additional information
63b8558fdSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
73b8558fdSAndrew Rist  * to you under the Apache License, Version 2.0 (the
83b8558fdSAndrew Rist  * "License"); you may not use this file except in compliance
93b8558fdSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
113b8558fdSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
133b8558fdSAndrew Rist  * Unless required by applicable law or agreed to in writing,
143b8558fdSAndrew Rist  * software distributed under the License is distributed on an
153b8558fdSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
163b8558fdSAndrew Rist  * KIND, either express or implied.  See the License for the
173b8558fdSAndrew Rist  * specific language governing permissions and limitations
183b8558fdSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
203b8558fdSAndrew Rist  *************************************************************/
213b8558fdSAndrew Rist 
223b8558fdSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_linguistic.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <cppuhelper/factory.hxx>   // helper for factories
29cdf0e10cSrcweir #include <rtl/string.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <com/sun/star/registry/XRegistryKey.hpp>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir using namespace com::sun::star::lang;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir using namespace com::sun::star::registry;
36cdf0e10cSrcweir 
37*8d2617bbSDamjan Jovanovic extern void * SAL_CALL LngSvcMgr_getFactory
38*8d2617bbSDamjan Jovanovic (
39*8d2617bbSDamjan Jovanovic     const sal_Char * pImplName,
40*8d2617bbSDamjan Jovanovic     XMultiServiceFactory * pServiceManager,
41*8d2617bbSDamjan Jovanovic     void * /*pRegistryKey*/
42*8d2617bbSDamjan Jovanovic );
43cdf0e10cSrcweir 
44*8d2617bbSDamjan Jovanovic extern void * SAL_CALL DicList_getFactory
45*8d2617bbSDamjan Jovanovic (
46*8d2617bbSDamjan Jovanovic     const sal_Char * pImplName,
47*8d2617bbSDamjan Jovanovic     XMultiServiceFactory * pServiceManager,
48*8d2617bbSDamjan Jovanovic     void *
49*8d2617bbSDamjan Jovanovic );
50cdf0e10cSrcweir 
51*8d2617bbSDamjan Jovanovic void * SAL_CALL LinguProps_getFactory
52*8d2617bbSDamjan Jovanovic (
53*8d2617bbSDamjan Jovanovic     const sal_Char * pImplName,
54*8d2617bbSDamjan Jovanovic     XMultiServiceFactory * pServiceManager,
55*8d2617bbSDamjan Jovanovic     void *
56*8d2617bbSDamjan Jovanovic );
57cdf0e10cSrcweir 
58*8d2617bbSDamjan Jovanovic extern void * SAL_CALL ConvDicList_getFactory
59*8d2617bbSDamjan Jovanovic (
60*8d2617bbSDamjan Jovanovic     const sal_Char * pImplName,
61*8d2617bbSDamjan Jovanovic     XMultiServiceFactory * pServiceManager,
62*8d2617bbSDamjan Jovanovic     void *
63*8d2617bbSDamjan Jovanovic );
64cdf0e10cSrcweir 
65*8d2617bbSDamjan Jovanovic extern void * SAL_CALL GrammarCheckingIterator_getFactory
66*8d2617bbSDamjan Jovanovic (
67*8d2617bbSDamjan Jovanovic     const sal_Char * pImplName,
68*8d2617bbSDamjan Jovanovic     XMultiServiceFactory * pServiceManager,
69*8d2617bbSDamjan Jovanovic     void *
70*8d2617bbSDamjan Jovanovic );
71cdf0e10cSrcweir 
72*8d2617bbSDamjan Jovanovic //extern void * SAL_CALL GrammarChecker_getFactory
73*8d2617bbSDamjan Jovanovic //(
74*8d2617bbSDamjan Jovanovic //    const sal_Char * pImplName,
75*8d2617bbSDamjan Jovanovic //    XMultiServiceFactory * pServiceManager,
76*8d2617bbSDamjan Jovanovic //    void *
77*8d2617bbSDamjan Jovanovic //);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir ////////////////////////////////////////
80cdf0e10cSrcweir // definition of the two functions that are used to provide the services
81cdf0e10cSrcweir //
82cdf0e10cSrcweir 
83cdf0e10cSrcweir extern "C"
84cdf0e10cSrcweir {
85cdf0e10cSrcweir 
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)86b63233d8Sdamjan SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
87cdf0e10cSrcweir     const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
88cdf0e10cSrcweir {
89cdf0e10cSrcweir     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
90cdf0e10cSrcweir }
91cdf0e10cSrcweir 
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void * pRegistryKey)92b63233d8Sdamjan SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
93cdf0e10cSrcweir     const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
94cdf0e10cSrcweir {
95*8d2617bbSDamjan Jovanovic     void * pRet =
96*8d2617bbSDamjan Jovanovic         LngSvcMgr_getFactory(
97*8d2617bbSDamjan Jovanovic             pImplName,
98*8d2617bbSDamjan Jovanovic             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
99*8d2617bbSDamjan Jovanovic             pRegistryKey );
100*8d2617bbSDamjan Jovanovic 
101*8d2617bbSDamjan Jovanovic     if(!pRet)
102*8d2617bbSDamjan Jovanovic         pRet = LinguProps_getFactory(
103*8d2617bbSDamjan Jovanovic             pImplName,
104*8d2617bbSDamjan Jovanovic             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
105*8d2617bbSDamjan Jovanovic             pRegistryKey );
106*8d2617bbSDamjan Jovanovic 
107*8d2617bbSDamjan Jovanovic     if(!pRet)
108*8d2617bbSDamjan Jovanovic         pRet =  DicList_getFactory(
109*8d2617bbSDamjan Jovanovic             pImplName,
110*8d2617bbSDamjan Jovanovic             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
111*8d2617bbSDamjan Jovanovic             pRegistryKey );
112*8d2617bbSDamjan Jovanovic 
113*8d2617bbSDamjan Jovanovic     if(!pRet)
114*8d2617bbSDamjan Jovanovic         pRet =  ConvDicList_getFactory(
115*8d2617bbSDamjan Jovanovic             pImplName,
116*8d2617bbSDamjan Jovanovic             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
117*8d2617bbSDamjan Jovanovic             pRegistryKey );
118*8d2617bbSDamjan Jovanovic 
119*8d2617bbSDamjan Jovanovic     if(!pRet)
120*8d2617bbSDamjan Jovanovic         pRet =  GrammarCheckingIterator_getFactory(
121*8d2617bbSDamjan Jovanovic             pImplName,
122*8d2617bbSDamjan Jovanovic             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
123*8d2617bbSDamjan Jovanovic             pRegistryKey );
124*8d2617bbSDamjan Jovanovic /*
125*8d2617bbSDamjan Jovanovic     if(!pRet)
126*8d2617bbSDamjan Jovanovic         pRet =  GrammarChecker_getFactory(
127*8d2617bbSDamjan Jovanovic             pImplName,
128*8d2617bbSDamjan Jovanovic             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
129*8d2617bbSDamjan Jovanovic             pRegistryKey );
130*8d2617bbSDamjan Jovanovic */
131*8d2617bbSDamjan Jovanovic     return pRet;
132cdf0e10cSrcweir }
133cdf0e10cSrcweir }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir ///////////////////////////////////////////////////////////////////////////
136