Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include "stocservices.hxx"
22 :
23 : #include "cppuhelper/factory.hxx"
24 : #include "cppuhelper/implementationentry.hxx"
25 : #include "sal/types.h"
26 : #include "uno/environment.h"
27 : #include "uno/lbnames.h"
28 :
29 : using namespace com::sun::star;
30 : using namespace com::sun::star::uno;
31 : using namespace cppu;
32 : using namespace osl;
33 : using namespace stoc_services;
34 :
35 : #ifdef DISABLE_DYNLOADING
36 :
37 : // Do we really to have non-static global variable with the same name
38 : // g_moduleCount in *all* (more or less, it seems) modules even in the
39 : // normal dynamic loading case? Weird. Anyway, in the DISABLE_DYNLOADING
40 : // case we have no use for these, and they can't be the same name.
41 :
42 : #define g_moduleCount g_stocservices_moduleCount
43 :
44 : #endif
45 :
46 : rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
47 :
48 : static struct ImplementationEntry g_entries[] =
49 : {
50 : // typeconv
51 : {
52 : TypeConverter_Impl_CreateInstance, tcv_getImplementationName,
53 : tcv_getSupportedServiceNames, createSingleComponentFactory,
54 : &g_moduleCount.modCnt , 0
55 : },
56 : // uriproc
57 : {
58 : ExternalUriReferenceTranslator::create,
59 : ExternalUriReferenceTranslator::getImplementationName,
60 : ExternalUriReferenceTranslator::getSupportedServiceNames,
61 : createSingleComponentFactory, 0, 0
62 : },
63 : {
64 : UriReferenceFactory::create,
65 : UriReferenceFactory::getImplementationName,
66 : UriReferenceFactory::getSupportedServiceNames,
67 : createSingleComponentFactory, 0, 0
68 : },
69 : {
70 : UriSchemeParser_vndDOTsunDOTstarDOTexpand::create,
71 : UriSchemeParser_vndDOTsunDOTstarDOTexpand::getImplementationName,
72 : UriSchemeParser_vndDOTsunDOTstarDOTexpand::getSupportedServiceNames,
73 : createSingleComponentFactory, 0, 0
74 : },
75 : {
76 : UriSchemeParser_vndDOTsunDOTstarDOTscript::create,
77 : UriSchemeParser_vndDOTsunDOTstarDOTscript::getImplementationName,
78 : UriSchemeParser_vndDOTsunDOTstarDOTscript::getSupportedServiceNames,
79 : createSingleComponentFactory, 0, 0
80 : },
81 : {
82 : VndSunStarPkgUrlReferenceFactory::create,
83 : VndSunStarPkgUrlReferenceFactory::getImplementationName,
84 : VndSunStarPkgUrlReferenceFactory::getSupportedServiceNames,
85 : createSingleComponentFactory, 0, 0
86 : },
87 : { 0, 0, 0, 0, 0, 0 }
88 : };
89 :
90 : extern "C"
91 : {
92 :
93 : #ifndef DISABLE_DYNLOADING
94 :
95 0 : SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_canUnload( TimeValue *pTime )
96 : {
97 0 : return g_moduleCount.canUnload( &g_moduleCount , pTime );
98 : }
99 :
100 : #endif
101 :
102 28 : SAL_DLLPUBLIC_EXPORT void * SAL_CALL stocservices_component_getFactory(
103 : const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
104 : {
105 28 : return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
106 : }
107 :
108 : }
109 :
110 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|