xref: /aoo4110/main/sc/source/ui/vba/service.cxx (revision b1cdbd2c)
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 #include "cppuhelper/implementationentry.hxx"
24 #include "com/sun/star/lang/XMultiServiceFactory.hpp"
25 #include "com/sun/star/registry/XRegistryKey.hpp"
26 #include "comphelper/servicedecl.hxx"
27 
28 // =============================================================================
29 // component exports
30 // =============================================================================
31 using namespace ::com::sun::star;
32 using namespace ::com::sun::star::uno;
33 
34 namespace sdecl = comphelper::service_decl;
35 
36 // reference service helper(s)
37 namespace  range
38 {
39 extern sdecl::ServiceDecl const serviceDecl;
40 }
41 namespace  workbook
42 {
43 extern sdecl::ServiceDecl const serviceDecl;
44 }
45 namespace  worksheet
46 {
47 extern sdecl::ServiceDecl const serviceDecl;
48 }
49 namespace window
50 {
51 extern sdecl::ServiceDecl const serviceDecl;
52 }
53 namespace globals
54 {
55 extern sdecl::ServiceDecl const serviceDecl;
56 }
57 namespace hyperlink
58 {
59 extern sdecl::ServiceDecl const serviceDecl;
60 }
61 namespace application
62 {
63 extern sdecl::ServiceDecl const serviceDecl;
64 }
65 namespace vbaeventshelper
66 {
67 extern sdecl::ServiceDecl const serviceDecl;
68 }
69 namespace textframe
70 {
71 extern sdecl::ServiceDecl const serviceDecl;
72 }
73 
74 extern "C"
75 {
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)76     SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
77         const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
78     {
79 		OSL_TRACE("In component_getImplementationEnv");
80         *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
81     }
82 
component_getFactory(const sal_Char * pImplName,lang::XMultiServiceFactory * pServiceManager,registry::XRegistryKey * pRegistryKey)83     SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
84         const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
85         registry::XRegistryKey * pRegistryKey )
86     {
87 		OSL_TRACE("In component_getFactory for %s", pImplName );
88 	void* pRet =  component_getFactoryHelper(
89         	pImplName, pServiceManager, pRegistryKey, range::serviceDecl, workbook::serviceDecl, worksheet::serviceDecl, globals::serviceDecl, window::serviceDecl, hyperlink::serviceDecl, application::serviceDecl );
90     if( !pRet )
91         pRet = component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, vbaeventshelper::serviceDecl, textframe::serviceDecl );
92 	OSL_TRACE("Ret is 0x%x", pRet);
93 	return pRet;
94     }
95 }
96