Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/unotools/source/misc/ServiceDocumenter.hxx
Line
Count
Source
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
#pragma once
10
11
#include <cppuhelper/implbase.hxx>
12
#include <com/sun/star/script/XServiceDocumenter.hpp>
13
#include <com/sun/star/lang/XServiceInfo.hpp>
14
#include <utility>
15
16
namespace com::sun::star::uno { class XComponentContext; }
17
18
namespace unotools::misc {
19
20
class ServiceDocumenter : public ::cppu::WeakImplHelper<
21
    css::script::XServiceDocumenter, css::lang::XServiceInfo>
22
{
23
    public:
24
        ServiceDocumenter(css::uno::Reference< css::uno::XComponentContext> xContext)
25
0
            : m_xContext(std::move(xContext))
26
0
            , m_sCoreBaseUrl(u"http://example.com"_ustr)
27
0
            , m_sServiceBaseUrl(u"https://api.libreoffice.org/docs/idl/ref"_ustr)
28
0
            {};
29
30
        //  XServiceInfo
31
        virtual sal_Bool SAL_CALL supportsService(const OUString& sServiceName) override;
32
        virtual OUString SAL_CALL getImplementationName() override;
33
        virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
34
35
        // XServiceDocumenter
36
        virtual OUString SAL_CALL getCoreBaseUrl() override
37
0
            { return m_sCoreBaseUrl; };
38
        virtual void SAL_CALL setCoreBaseUrl( const OUString& sCoreBaseUrl ) override
39
0
            { m_sCoreBaseUrl = sCoreBaseUrl; };
40
        virtual OUString SAL_CALL getServiceBaseUrl() override
41
0
            { return m_sServiceBaseUrl; };
42
        virtual void SAL_CALL setServiceBaseUrl( const OUString& sServiceBaseUrl ) override
43
0
            { m_sServiceBaseUrl = sServiceBaseUrl; };
44
        virtual void SAL_CALL showServiceDocs( const ::css::uno::Reference< ::css::lang::XServiceInfo >& xService) override;
45
        virtual void SAL_CALL showInterfaceDocs( const ::css::uno::Reference< ::css::lang::XTypeProvider >& xTypeProvider ) override;
46
        virtual void SAL_CALL showCoreDocs( const ::css::uno::Reference< ::css::lang::XServiceInfo >& xService) override;
47
    protected:
48
        virtual ~ServiceDocumenter() override
49
0
            {};
50
    private:
51
        css::uno::Reference< css::uno::XComponentContext> m_xContext;
52
        OUString m_sCoreBaseUrl;
53
        OUString m_sServiceBaseUrl;
54
};
55
56
}
57
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */