Coverage Report

Created: 2026-07-10 11:04

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/UnoControls/source/inc/OConnectionPointContainerHelper.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
 * 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
#pragma once
21
22
#include <com/sun/star/lang/XConnectionPointContainer.hpp>
23
#include <cppuhelper/weak.hxx>
24
#include <comphelper/multicontainer2.hxx>
25
26
namespace unocontrols {
27
28
class OConnectionPointContainerHelper final :   public  css::lang::XConnectionPointContainer
29
                                        ,   public  ::cppu::OWeakObject
30
{
31
public:
32
    OConnectionPointContainerHelper( ::osl::Mutex& aMutex );
33
34
    virtual ~OConnectionPointContainerHelper() override;
35
36
    //  XInterface
37
38
    /**
39
        @short      give answer, if interface is supported
40
        @descr      The interfaces are searched by type.
41
42
        @seealso    XInterface
43
44
        @param      "rType" is the type of searched interface.
45
46
        @return     Any     information about found interface
47
48
        @onerror    A RuntimeException is thrown.
49
    */
50
51
    virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
52
53
    /**
54
        @short      increment refcount
55
        @seealso    XInterface
56
        @seealso    release()
57
        @onerror    A RuntimeException is thrown.
58
    */
59
60
    virtual void SAL_CALL acquire() noexcept override;
61
62
    /**
63
        @short      decrement refcount
64
        @seealso    XInterface
65
        @seealso    acquire()
66
        @onerror    A RuntimeException is thrown.
67
    */
68
69
    virtual void SAL_CALL release() noexcept override;
70
71
    //  XConnectionPointContainer
72
73
    virtual css::uno::Sequence< css::uno::Type > SAL_CALL getConnectionPointTypes() override;
74
75
    virtual css::uno::Reference< css::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(
76
        const css::uno::Type& aType
77
    ) override;
78
79
    virtual void SAL_CALL advise(
80
        const   css::uno::Type&                              aType ,
81
        const   css::uno::Reference< css::uno::XInterface >&  xListener
82
    ) override;
83
84
    virtual void SAL_CALL unadvise(
85
        const   css::uno::Type&                              aType       ,
86
        const   css::uno::Reference< css::uno::XInterface >&  xListener
87
    ) override;
88
89
    //  public but impl method!
90
    //  Is necessary to get container member at OConnectionPoint-instance.
91
    // Impl methods are not threadsafe!
92
    // "Parent" function must do this.
93
0
    comphelper::OMultiTypeInterfaceContainerHelper2& impl_getMultiTypeContainer() { return m_aMultiTypeContainer; }
94
95
private:
96
    ::osl::Mutex&                                   m_aSharedMutex;
97
    comphelper::OMultiTypeInterfaceContainerHelper2 m_aMultiTypeContainer;   // Container to hold listener
98
};
99
100
}
101
102
103
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */