poppler: Upgrade 24.05.0
[LibreOffice.git] / cui / source / factory / cuiexp.cxx
blob788304de2e3e29c11b8a940c202247f150898a4d
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 "dlgfact.hxx"
21 #include <sal/types.h>
22 #include <cppuhelper/supportsservice.hxx>
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
25 /// anonymous implementation namespace
26 namespace
28 class GetCreateDialogFactoryService
29 : public ::cppu::WeakImplHelper<css::lang::XServiceInfo, css::lang::XUnoTunnel>
31 public:
32 // css::lang::XServiceInfo:
33 virtual OUString SAL_CALL getImplementationName() override
35 return u"com.sun.star.cui.GetCreateDialogFactoryService"_ustr;
37 virtual sal_Bool SAL_CALL supportsService(const OUString& serviceName) override
39 return cppu::supportsService(this, serviceName);
41 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
43 return { u"com.sun.star.cui.GetCreateDialogFactoryService"_ustr };
46 // XUnoTunnel
47 virtual sal_Int64 SAL_CALL
48 getSomething(const ::css::uno::Sequence<::sal_Int8>& /*aIdentifier*/) override
50 // Noting that we have to return a pointer to **VclAbstractDialogFactory** otherwise
51 // the dynamic_casting on the other end will fail on Windows (possibly because of the virtual base involved).
52 static VclAbstractDialogFactory* pFactory = new AbstractDialogFactory_Impl;
53 return reinterpret_cast<sal_Int64>(pFactory);
57 } // closing anonymous implementation namespace
59 extern "C" {
60 SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
61 com_sun_star_cui_GetCreateDialogFactoryService(css::uno::XComponentContext*,
62 css::uno::Sequence<css::uno::Any> const&)
64 return cppu::acquire(new GetCreateDialogFactoryService);
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */