xref: /AOO42X/main/svgio/source/svguno/svguno.cxx (revision b1c5455db1639c48e26c568e4fa7ee78ca5d60ee)
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 // MARKER(update_precomp.py): autogen include statement, do not remove
23 #include "precompiled_svgio.hxx"
24 
25 #include <svgio/svgiodllapi.h>
26 #include <com/sun/star/uno/Reference.h>
27 #include <com/sun/star/uno/RuntimeException.hpp>
28 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 #include <com/sun/star/lang/XComponent.hpp>
30 #include <com/sun/star/registry/XRegistryKey.hpp>
31 #include <com/sun/star/lang/XComponent.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
34 #include <uno/environment.h>
35 #include <cppuhelper/factory.hxx>
36 #include <cppuhelper/implementationentry.hxx>
37 
38 //////////////////////////////////////////////////////////////////////////////
39 
40 using namespace ::com::sun::star;
41 
42 //////////////////////////////////////////////////////////////////////////////
43 // predefines
44 
45 namespace svgio
46 {
47     namespace svgreader
48     {
49         extern uno::Sequence< rtl::OUString > SAL_CALL XSvgParser_getSupportedServiceNames();
50         extern rtl::OUString SAL_CALL XSvgParser_getImplementationName();
51         extern uno::Reference< uno::XInterface > SAL_CALL XSvgParser_createInstance( const uno::Reference< uno::XComponentContext > & );
52     } // end of namespace svgreader
53 } // end of namespace svgio
54 
55 //////////////////////////////////////////////////////////////////////////////
56 // component_getImplementationEnvironment
57 
58 extern "C"
59 {
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)60     SVGIO_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
61     {
62         *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
63     }
64 }
65 
66 //////////////////////////////////////////////////////////////////////////////
67 // component_getFactory
68 
69 static struct ::cppu::ImplementationEntry g_component_entries[] =
70 {
71     {
72         svgio::svgreader::XSvgParser_createInstance,
73         svgio::svgreader::XSvgParser_getImplementationName,
74         svgio::svgreader::XSvgParser_getSupportedServiceNames,
75         ::cppu::createSingleComponentFactory,
76         0,
77         0
78     },
79     { 0, 0, 0, 0, 0, 0 }
80 };
81 
82 extern "C"
83 {
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void * pRegistryKey)84     SVGIO_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
85     {
86         return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, g_component_entries );
87     }
88 }
89 
90 //////////////////////////////////////////////////////////////////////////////
91 // eof
92