xref: /aoo41x/main/oox/source/core/services.cxx (revision ca5ec200)
1*ca5ec200SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ca5ec200SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ca5ec200SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ca5ec200SAndrew Rist  * distributed with this work for additional information
6*ca5ec200SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ca5ec200SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ca5ec200SAndrew Rist  * "License"); you may not use this file except in compliance
9*ca5ec200SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ca5ec200SAndrew Rist  *
11*ca5ec200SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ca5ec200SAndrew Rist  *
13*ca5ec200SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ca5ec200SAndrew Rist  * software distributed under the License is distributed on an
15*ca5ec200SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ca5ec200SAndrew Rist  * KIND, either express or implied.  See the License for the
17*ca5ec200SAndrew Rist  * specific language governing permissions and limitations
18*ca5ec200SAndrew Rist  * under the License.
19*ca5ec200SAndrew Rist  *
20*ca5ec200SAndrew Rist  *************************************************************/
21*ca5ec200SAndrew Rist 
22*ca5ec200SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <cppuhelper/implementationentry.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir using ::rtl::OUString;
27cdf0e10cSrcweir using namespace ::com::sun::star::uno;
28cdf0e10cSrcweir 
29cdf0e10cSrcweir // Declare static functions providing service information =====================
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #define DECLARE_FUNCTIONS( className )                                                  \
32cdf0e10cSrcweir extern OUString SAL_CALL className##_getImplementationName() throw();                   \
33cdf0e10cSrcweir extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw();    \
34cdf0e10cSrcweir extern Reference< XInterface > SAL_CALL className##_createInstance(                     \
35cdf0e10cSrcweir     const Reference< XComponentContext >& rxContext ) throw (Exception)
36cdf0e10cSrcweir 
37cdf0e10cSrcweir namespace oox {
38cdf0e10cSrcweir     namespace core {    DECLARE_FUNCTIONS( FastTokenHandler );          }
39cdf0e10cSrcweir     namespace core {    DECLARE_FUNCTIONS( FilterDetect );              }
40cdf0e10cSrcweir     namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport );  }
41cdf0e10cSrcweir     namespace ole {     DECLARE_FUNCTIONS( WordVbaProjectFilter );      }
42cdf0e10cSrcweir     namespace ppt {     DECLARE_FUNCTIONS( PowerPointImport );          }
43cdf0e10cSrcweir     namespace shape {   DECLARE_FUNCTIONS( ShapeContextHandler );       }
44cdf0e10cSrcweir     namespace xls {     DECLARE_FUNCTIONS( BiffDetector );              }
45cdf0e10cSrcweir     namespace xls {     DECLARE_FUNCTIONS( ExcelFilter );               }
46cdf0e10cSrcweir     namespace xls {     DECLARE_FUNCTIONS( ExcelBiffFilter );           }
47cdf0e10cSrcweir     namespace xls {     DECLARE_FUNCTIONS( ExcelVbaProjectFilter );     }
48cdf0e10cSrcweir     namespace xls {     DECLARE_FUNCTIONS( OOXMLFormulaParser );        }
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir #undef DECLARE_FUNCTIONS
52cdf0e10cSrcweir 
53cdf0e10cSrcweir // ============================================================================
54cdf0e10cSrcweir 
55cdf0e10cSrcweir namespace {
56cdf0e10cSrcweir 
57cdf0e10cSrcweir #define IMPLEMENTATION_ENTRY( className ) \
58cdf0e10cSrcweir     { &className##_createInstance, &className##_getImplementationName, &className##_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir static ::cppu::ImplementationEntry const spServices[] =
61cdf0e10cSrcweir {
62cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::core::FastTokenHandler ),
63cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::core::FilterDetect ),
64cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::docprop::DocumentPropertiesImport ),
65cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::ole::WordVbaProjectFilter ),
66cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::ppt::PowerPointImport ),
67cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::shape::ShapeContextHandler ),
68cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::xls::BiffDetector ),
69cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::xls::ExcelFilter ),
70cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::xls::ExcelBiffFilter ),
71cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::xls::ExcelVbaProjectFilter ),
72cdf0e10cSrcweir     IMPLEMENTATION_ENTRY( ::oox::xls::OOXMLFormulaParser ),
73cdf0e10cSrcweir     { 0, 0, 0, 0, 0, 0 }
74cdf0e10cSrcweir };
75cdf0e10cSrcweir 
76cdf0e10cSrcweir #undef IMPLEMENTATION_ENTRY
77cdf0e10cSrcweir 
78cdf0e10cSrcweir } // namespace
79cdf0e10cSrcweir 
80cdf0e10cSrcweir // ----------------------------------------------------------------------------
81cdf0e10cSrcweir 
component_getImplementationEnvironment(const sal_Char ** ppEnvironmentTypeName,uno_Environment **)82cdf0e10cSrcweir extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
83cdf0e10cSrcweir         const sal_Char** ppEnvironmentTypeName, uno_Environment** /*ppEnvironment*/ )
84cdf0e10cSrcweir {
85cdf0e10cSrcweir     *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
86cdf0e10cSrcweir }
87cdf0e10cSrcweir 
component_getFactory(const char * pImplName,void * pServiceManager,void * pRegistryKey)88cdf0e10cSrcweir extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const char* pImplName, void* pServiceManager, void* pRegistryKey )
89cdf0e10cSrcweir {
90cdf0e10cSrcweir     return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, spServices );
91cdf0e10cSrcweir }
92cdf0e10cSrcweir 
93cdf0e10cSrcweir // ============================================================================
94