xref: /aoo4110/main/oox/source/core/services.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 
24 #include <cppuhelper/implementationentry.hxx>
25 
26 using ::rtl::OUString;
27 using namespace ::com::sun::star::uno;
28 
29 // Declare static functions providing service information =====================
30 
31 #define DECLARE_FUNCTIONS( className )                                                  \
32 extern OUString SAL_CALL className##_getImplementationName() throw();                   \
33 extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();    \
34 extern Reference< XInterface > SAL_CALL className##_createInstance(                     \
35     const Reference< XComponentContext >& rxContext ) throw (Exception)
36 
37 namespace oox {
38     namespace core {    DECLARE_FUNCTIONS( FastTokenHandler );          }
39     namespace core {    DECLARE_FUNCTIONS( FilterDetect );              }
40     namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport );  }
41     namespace ole {     DECLARE_FUNCTIONS( WordVbaProjectFilter );      }
42     namespace ppt {     DECLARE_FUNCTIONS( PowerPointImport );          }
43     namespace shape {   DECLARE_FUNCTIONS( ShapeContextHandler );       }
44     namespace xls {     DECLARE_FUNCTIONS( BiffDetector );              }
45     namespace xls {     DECLARE_FUNCTIONS( ExcelFilter );               }
46     namespace xls {     DECLARE_FUNCTIONS( ExcelBiffFilter );           }
47     namespace xls {     DECLARE_FUNCTIONS( ExcelVbaProjectFilter );     }
48     namespace xls {     DECLARE_FUNCTIONS( OOXMLFormulaParser );        }
49 }
50 
51 #undef DECLARE_FUNCTIONS
52 
53 // ============================================================================
54 
55 namespace {
56 
57 #define IMPLEMENTATION_ENTRY( className ) \
58     { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }
59 
60 static ::cppu::ImplementationEntry const spServices[] =
61 {
62     IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ),
63     IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
64     IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
65     IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ),
66     IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
67     IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ),
68     IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ),
69     IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ),
70     IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ),
71     IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ),
72     IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ),
73     { 0, 0, 0, 0, 0, 0 }
74 };
75 
76 #undef IMPLEMENTATION_ENTRY
77 
78 } // namespace
79 
80 // ----------------------------------------------------------------------------
81 
component_getImplementationEnvironment(const sal_Char ** ppEnvironmentTypeName,uno_Environment **)82 extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
83         const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ )
84 {
85     *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
86 }
87 
component_getFactory(const char * pImplName,void * pServiceManager,void * pRegistryKey)88 extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey )
89 {
90     return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices );
91 }
92 
93 // ============================================================================
94