bump product version to 5.0.4.1
[LibreOffice.git] / UnoControls / source / base / registercontrols.cxx
blobe3ecfa4907048e99b0220be9340ba28e8e5afd33
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sal/config.h>
22 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
23 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
24 #include <comphelper/processfactory.hxx>
25 #include <cppuhelper/factory.hxx>
27 #include <framecontrol.hxx>
28 #include <progressbar.hxx>
29 #include <progressmonitor.hxx>
30 #include <statusindicator.hxx>
32 namespace {
34 css::uno::Reference<css::uno::XInterface> SAL_CALL FrameControl_createInstance(
35 css::uno::Reference<css::lang::XMultiServiceFactory> const &
36 rServiceManager)
37 throw (css::uno::Exception)
39 return static_cast<cppu::OWeakObject *>(
40 new unocontrols::FrameControl(
41 comphelper::getComponentContext(rServiceManager)));
44 css::uno::Reference<css::uno::XInterface> SAL_CALL ProgressBar_createInstance(
45 css::uno::Reference<css::lang::XMultiServiceFactory> const &
46 rServiceManager)
47 throw (css::uno::Exception)
49 return static_cast<cppu::OWeakObject *>(
50 new unocontrols::ProgressBar(
51 comphelper::getComponentContext(rServiceManager)));
54 css::uno::Reference<css::uno::XInterface> SAL_CALL
55 ProgressMonitor_createInstance(
56 css::uno::Reference<css::lang::XMultiServiceFactory> const &
57 rServiceManager)
58 throw (css::uno::Exception)
60 return static_cast<cppu::OWeakObject *>(
61 new unocontrols::ProgressMonitor(
62 comphelper::getComponentContext(rServiceManager)));
65 css::uno::Reference<css::uno::XInterface> SAL_CALL
66 StatusIndicator_createInstance(
67 css::uno::Reference<css::lang::XMultiServiceFactory> const &
68 rServiceManager)
69 throw (css::uno::Exception)
71 return static_cast<cppu::OWeakObject *>(
72 new unocontrols::StatusIndicator(
73 comphelper::getComponentContext(rServiceManager)));
78 extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL ctl_component_getFactory(
79 char const * pImplName, void * pServiceManager, SAL_UNUSED_PARAMETER void *)
81 css::uno::Reference<css::lang::XMultiServiceFactory > smgr(
82 static_cast<css::lang::XMultiServiceFactory *>(pServiceManager));
83 css::uno::Reference<css::lang::XSingleServiceFactory> fac;
84 if (unocontrols::FrameControl::impl_getStaticImplementationName()
85 .equalsAscii(pImplName))
87 fac = cppu::createSingleFactory(
88 smgr, unocontrols::FrameControl::impl_getStaticImplementationName(),
89 &FrameControl_createInstance,
90 unocontrols::FrameControl::impl_getStaticSupportedServiceNames());
91 } else if (unocontrols::ProgressBar::impl_getStaticImplementationName()
92 .equalsAscii(pImplName))
94 fac = cppu::createSingleFactory(
95 smgr, unocontrols::ProgressBar::impl_getStaticImplementationName(),
96 &ProgressBar_createInstance,
97 unocontrols::ProgressBar::impl_getStaticSupportedServiceNames());
98 } else if (unocontrols::ProgressMonitor::impl_getStaticImplementationName()
99 .equalsAscii(pImplName))
101 fac = cppu::createSingleFactory(
102 smgr,
103 unocontrols::ProgressMonitor::impl_getStaticImplementationName(),
104 &ProgressMonitor_createInstance,
105 unocontrols::ProgressMonitor::impl_getStaticSupportedServiceNames());
106 } else if (unocontrols::StatusIndicator::impl_getStaticImplementationName()
107 .equalsAscii(pImplName))
109 fac = cppu::createSingleFactory(
110 smgr,
111 unocontrols::StatusIndicator::impl_getStaticImplementationName(),
112 &StatusIndicator_createInstance,
113 unocontrols::StatusIndicator::impl_getStaticSupportedServiceNames());
115 if (fac.is()) {
116 fac->acquire();
118 return fac.get();
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */