bump product version to 5.0.4.1
[LibreOffice.git] / UnoControls / source / inc / OConnectionPointHelper.hxx
blob638174eeb7948b5602e83e1b483f56473db67a8f
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 #ifndef INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
21 #define INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
23 #include <com/sun/star/lang/XConnectionPointContainer.hpp>
24 #include <com/sun/star/lang/XConnectionPoint.hpp>
25 #include <cppuhelper/weak.hxx>
26 #include <cppuhelper/weakref.hxx>
27 #include <cppuhelper/propshlp.hxx>
29 #include "OConnectionPointContainerHelper.hxx"
31 // namespaces
33 namespace unocontrols{
35 // class declaration OConnectionPointHelper
37 class OConnectionPointHelper : public ::com::sun::star::lang::XConnectionPoint
38 , public ::cppu::OWeakObject
41 // public methods
43 public:
45 // construct/destruct
47 /**_________________________________________________________________________________________________________
48 @short
49 @descr
51 @seealso
53 @param
55 @return
57 @onerror
60 OConnectionPointHelper( ::osl::Mutex& aMutex ,
61 OConnectionPointContainerHelper* pContainerImplementation ,
62 ::com::sun::star::uno::Type aType );
64 /**_________________________________________________________________________________________________________
65 @short
66 @descr
68 @seealso
70 @param
72 @return
74 @onerror
77 virtual ~OConnectionPointHelper();
79 // XInterface
81 /**_______________________________________________________________________________________________________
82 @short give answer, if interface is supported
83 @descr The interfaces are searched by type.
85 @seealso XInterface
87 @param "rType" is the type of searched interface.
89 @return Any information about found interface
91 @onerror A RuntimeException is thrown.
94 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
95 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
97 /**_______________________________________________________________________________________________________
98 @short increment refcount
99 @seealso XInterface
100 @seealso release()
101 @onerror A RuntimeException is thrown.
104 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
106 /**_______________________________________________________________________________________________________
107 @short decrement refcount
108 @seealso XInterface
109 @seealso acquire()
110 @onerror A RuntimeException is thrown.
113 virtual void SAL_CALL release() throw() SAL_OVERRIDE;
115 // XConnectionPoint
117 /**_________________________________________________________________________________________________________
118 @short
119 @descr
121 @seealso
123 @param
125 @return
127 @onerror
130 virtual ::com::sun::star::uno::Type SAL_CALL getConnectionType()
131 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
133 /**_________________________________________________________________________________________________________
134 @short
135 @descr
137 @seealso
139 @param
141 @return
143 @onerror
146 virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XConnectionPointContainer > SAL_CALL getConnectionPointContainer()
147 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
149 /**_________________________________________________________________________________________________________
150 @short
151 @descr
153 @seealso
155 @param
157 @return
159 @onerror
162 virtual void SAL_CALL advise(
163 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xListener
164 ) throw (
165 ::com::sun::star::lang::ListenerExistException,
166 ::com::sun::star::lang::InvalidListenerException ,
167 ::com::sun::star::uno::RuntimeException, std::exception
168 ) SAL_OVERRIDE;
170 /**_________________________________________________________________________________________________________
171 @short
172 @descr
174 @seealso
176 @param
178 @return
180 @onerror
183 virtual void SAL_CALL unadvise( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xListener )
184 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
186 /**_________________________________________________________________________________________________________
187 @short
188 @descr
190 @seealso
192 @param
194 @return
196 @onerror
199 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > SAL_CALL getConnections()
200 throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
202 // private methods
204 private:
206 /**_________________________________________________________________________________________________________
207 @short
208 @descr
210 @seealso
212 @param
214 @return
216 @onerror
219 bool impl_LockContainer();
221 /**_________________________________________________________________________________________________________
222 @short
223 @descr
225 @seealso
227 @param
229 @return
231 @onerror
234 void impl_UnlockContainer();
236 // private variables
238 private:
240 ::osl::Mutex& m_aSharedMutex;
241 ::com::sun::star::uno::WeakReference< ::com::sun::star::lang::XConnectionPointContainer > m_oContainerWeakReference; // Reference to container-class!. Don't use Reference<...>
242 // It is a ring-reference => and must be a wekreference!
243 OConnectionPointContainerHelper* m_pContainerImplementation;
244 ::com::sun::star::uno::Type m_aInterfaceType;
245 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xLock;
247 }; // class OConnectionPointHelper
249 } // namespace unocontrols
251 #endif // INCLUDED_UNOCONTROLS_SOURCE_INC_OCONNECTIONPOINTHELPER_HXX
253 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */