LibreOffice Module UnoControls (master)  1
OConnectionPointContainerHelper.hxx
Go to the documentation of this file.
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>
25 
26 namespace com::sun::star::lang { class XConnectionPoint; }
27 
28 namespace unocontrols {
29 
30 class OConnectionPointContainerHelper final : public css::lang::XConnectionPointContainer
31  , public ::cppu::OWeakObject
32 {
33 public:
34  OConnectionPointContainerHelper( ::osl::Mutex& aMutex );
35 
36  virtual ~OConnectionPointContainerHelper() override;
37 
38  // XInterface
39 
53  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
54 
62  virtual void SAL_CALL acquire() throw() override;
63 
71  virtual void SAL_CALL release() throw() override;
72 
73  // XConnectionPointContainer
74 
75  virtual css::uno::Sequence< css::uno::Type > SAL_CALL getConnectionPointTypes() override;
76 
77  virtual css::uno::Reference< css::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(
78  const css::uno::Type& aType
79  ) override;
80 
81  virtual void SAL_CALL advise(
82  const css::uno::Type& aType ,
83  const css::uno::Reference< css::uno::XInterface >& xListener
84  ) override;
85 
86  virtual void SAL_CALL unadvise(
87  const css::uno::Type& aType ,
88  const css::uno::Reference< css::uno::XInterface >& xListener
89  ) override;
90 
91  // public but impl method!
92  // Is necessary to get container member at OConnectionPoint-instance.
93  // Impl methods are not threadsafe!
94  // "Parent" function must do this.
96 
97 private:
98  ::osl::Mutex& m_aSharedMutex;
100 };
101 
102 }
103 
104 
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::cppu::OMultiTypeInterfaceContainerHelper & impl_getMultiTypeContainer()
virtual void SAL_CALL advise(const css::uno::Type &aType, const css::uno::Reference< css::uno::XInterface > &xListener) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
give answer, if interface is supported The interfaces are searched by type.
virtual void SAL_CALL acquire() override
increment refcount XInterface release() A RuntimeException is thrown.
Mutex aMutex
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getConnectionPointTypes() override
virtual void SAL_CALL unadvise(const css::uno::Type &aType, const css::uno::Reference< css::uno::XInterface > &xListener) override
virtual css::uno::Reference< css::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(const css::uno::Type &aType) override
::cppu::OMultiTypeInterfaceContainerHelper m_aMultiTypeContainer
virtual void SAL_CALL release() override
decrement refcount XInterface acquire() A RuntimeException is thrown.