office-gobmx/UnoControls/source/inc/OConnectionPointContainerHelper.hxx
2010-11-01 00:16:13 -05:00

265 lines
8.4 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef _OCONNECTIONPOINTCONTAINERHELPER_HXX
#define _OCONNECTIONPOINTCONTAINERHELPER_HXX
//______________________________________________________________________________________________________________
// includes of other projects
//______________________________________________________________________________________________________________
#include <com/sun/star/lang/XConnectionPointContainer.hpp>
#include <com/sun/star/lang/XConnectionPoint.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/propshlp.hxx>
//______________________________________________________________________________________________________________
// includes of my own project
//______________________________________________________________________________________________________________
//______________________________________________________________________________________________________________
// namespaces
//______________________________________________________________________________________________________________
namespace unocontrols{
#define CSS_UNO ::com::sun::star::uno
#define CSS_LANG ::com::sun::star::lang
//______________________________________________________________________________________________________________
// defines
//______________________________________________________________________________________________________________
//______________________________________________________________________________________________________________
// class declaration OConnectionPointContainerHelper
//______________________________________________________________________________________________________________
class OConnectionPointContainerHelper : public CSS_LANG::XConnectionPointContainer
, public ::cppu::OWeakObject
{
//______________________________________________________________________________________________________________
// public methods
//______________________________________________________________________________________________________________
public:
//__________________________________________________________________________________________________________
// construct/destruct
//__________________________________________________________________________________________________________
/**_________________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
OConnectionPointContainerHelper( ::osl::Mutex& aMutex );
/**_________________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
virtual ~OConnectionPointContainerHelper();
//________________________________________________________________________________________________________
// XInterface
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short give answer, if interface is supported
@descr The interfaces are searched by type.
@seealso XInterface
@param "rType" is the type of searched interface.
@return Any information about found interface
@onerror A RuntimeException is thrown.
*/
virtual CSS_UNO::Any SAL_CALL queryInterface( const CSS_UNO::Type& aType )
throw( CSS_UNO::RuntimeException );
/**_______________________________________________________________________________________________________
@short increment refcount
@descr -
@seealso XInterface
@seealso release()
@param -
@return -
@onerror A RuntimeException is thrown.
*/
virtual void SAL_CALL acquire() throw();
/**_______________________________________________________________________________________________________
@short decrement refcount
@descr -
@seealso XInterface
@seealso acquire()
@param -
@return -
@onerror A RuntimeException is thrown.
*/
virtual void SAL_CALL release() throw();
//__________________________________________________________________________________________________________
// XConnectionPointContainer
//__________________________________________________________________________________________________________
/**_________________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
virtual CSS_UNO::Sequence< CSS_UNO::Type > SAL_CALL getConnectionPointTypes()
throw( CSS_UNO::RuntimeException );
/**_________________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
virtual CSS_UNO::Reference< CSS_LANG::XConnectionPoint > SAL_CALL queryConnectionPoint(
const CSS_UNO::Type& aType
) throw( CSS_UNO::RuntimeException );
/**_________________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
virtual void SAL_CALL advise(
const CSS_UNO::Type& aType ,
const CSS_UNO::Reference< CSS_UNO::XInterface >& xListener
) throw( CSS_UNO::RuntimeException );
/**_________________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
virtual void SAL_CALL unadvise(
const CSS_UNO::Type& aType ,
const CSS_UNO::Reference< CSS_UNO::XInterface >& xListener
) throw( CSS_UNO::RuntimeException );
/**_________________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
::cppu::OMultiTypeInterfaceContainerHelper& impl_getMultiTypeContainer();
//______________________________________________________________________________________________________________
// private variables
//______________________________________________________________________________________________________________
private:
::osl::Mutex& m_aSharedMutex ;
::cppu::OMultiTypeInterfaceContainerHelper m_aMultiTypeContainer ; // Container to hold listener
}; // class OConnectionPointContainerHelper
// The namespace aliases are only used in this header
#undef CSS_UNO
#undef CSS_LANG
} // namespace unocontrols
#endif // #ifndef _OCONNECTIONPOINTCONTAINERHELPER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */