2010-10-14 08:30:07 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-12-05 11:46:50 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-10-23 19:17:00 +02:00
|
|
|
#ifndef INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
|
|
|
|
#define INCLUDED_CPPUHELPER_TYPEPROVIDER_HXX
|
2000-09-18 14:29:57 +00:00
|
|
|
|
|
|
|
#include <rtl/alloc.h>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
2013-11-09 15:10:54 -06:00
|
|
|
#include <cppuhelper/cppuhelperdllapi.h>
|
2000-09-18 14:29:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace cppu
|
|
|
|
{
|
|
|
|
|
2012-01-05 19:40:38 +01:00
|
|
|
/** Helper class to implement com::sun::star::lang::XTypeProvider. Construct a static object
|
2001-11-09 12:49:16 +00:00
|
|
|
of this class with your UNO object's supported types.
|
|
|
|
*/
|
2011-08-23 14:47:42 +02:00
|
|
|
class CPPUHELPER_DLLPUBLIC OTypeCollection
|
2000-09-18 14:29:57 +00:00
|
|
|
{
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > _aTypes;
|
|
|
|
|
|
|
|
public:
|
2012-01-05 19:40:38 +01:00
|
|
|
/// @cond INTERNAL
|
2001-03-09 11:15:28 +00:00
|
|
|
// these are here to force memory de/allocation to sal lib.
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void * SAL_CALL operator new( size_t nSize )
|
2001-03-09 11:15:28 +00:00
|
|
|
{ return ::rtl_allocateMemory( nSize ); }
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void SAL_CALL operator delete( void * pMem )
|
2001-03-09 11:15:28 +00:00
|
|
|
{ ::rtl_freeMemory( pMem ); }
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void * SAL_CALL operator new( size_t, void * pMem )
|
2001-03-09 11:15:28 +00:00
|
|
|
{ return pMem; }
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void SAL_CALL operator delete( void *, void * )
|
2001-03-09 11:15:28 +00:00
|
|
|
{}
|
2012-01-05 19:40:38 +01:00
|
|
|
/// @endcond
|
2001-03-09 11:15:28 +00:00
|
|
|
|
2001-11-09 12:49:16 +00:00
|
|
|
inline OTypeCollection( const OTypeCollection & rCollection )
|
2000-09-18 14:29:57 +00:00
|
|
|
: _aTypes( rCollection._aTypes )
|
|
|
|
{}
|
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
|
|
|
const ::com::sun::star::uno::Type & rType6,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
|
|
|
const ::com::sun::star::uno::Type & rType6,
|
|
|
|
const ::com::sun::star::uno::Type & rType7,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
|
|
|
const ::com::sun::star::uno::Type & rType6,
|
|
|
|
const ::com::sun::star::uno::Type & rType7,
|
|
|
|
const ::com::sun::star::uno::Type & rType8,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
|
|
|
const ::com::sun::star::uno::Type & rType6,
|
|
|
|
const ::com::sun::star::uno::Type & rType7,
|
|
|
|
const ::com::sun::star::uno::Type & rType8,
|
|
|
|
const ::com::sun::star::uno::Type & rType9,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
|
|
|
const ::com::sun::star::uno::Type & rType6,
|
|
|
|
const ::com::sun::star::uno::Type & rType7,
|
|
|
|
const ::com::sun::star::uno::Type & rType8,
|
|
|
|
const ::com::sun::star::uno::Type & rType9,
|
|
|
|
const ::com::sun::star::uno::Type & rType10,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
|
|
|
const ::com::sun::star::uno::Type & rType6,
|
|
|
|
const ::com::sun::star::uno::Type & rType7,
|
|
|
|
const ::com::sun::star::uno::Type & rType8,
|
|
|
|
const ::com::sun::star::uno::Type & rType9,
|
|
|
|
const ::com::sun::star::uno::Type & rType10,
|
|
|
|
const ::com::sun::star::uno::Type & rType11,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
OTypeCollection(
|
|
|
|
const ::com::sun::star::uno::Type & rType1,
|
|
|
|
const ::com::sun::star::uno::Type & rType2,
|
|
|
|
const ::com::sun::star::uno::Type & rType3,
|
|
|
|
const ::com::sun::star::uno::Type & rType4,
|
|
|
|
const ::com::sun::star::uno::Type & rType5,
|
|
|
|
const ::com::sun::star::uno::Type & rType6,
|
|
|
|
const ::com::sun::star::uno::Type & rType7,
|
|
|
|
const ::com::sun::star::uno::Type & rType8,
|
|
|
|
const ::com::sun::star::uno::Type & rType9,
|
|
|
|
const ::com::sun::star::uno::Type & rType10,
|
|
|
|
const ::com::sun::star::uno::Type & rType11,
|
|
|
|
const ::com::sun::star::uno::Type & rType12,
|
2014-06-05 08:08:06 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > & rAddTypes = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >() );
|
2000-09-18 14:29:57 +00:00
|
|
|
|
2001-11-09 12:49:16 +00:00
|
|
|
/** Called upon XTypeProvider::getTypes().
|
|
|
|
|
|
|
|
@return type collection
|
|
|
|
*/
|
2014-06-05 08:08:06 +02:00
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
|
2000-09-18 14:29:57 +00:00
|
|
|
{ return _aTypes; }
|
|
|
|
};
|
|
|
|
|
2014-03-10 12:16:40 +01:00
|
|
|
/** Helper class to implement IDs for XUnoTunnel. Construct a static object
|
2001-11-09 12:49:16 +00:00
|
|
|
of this class for your UNO object's implementation id.
|
|
|
|
*/
|
2011-08-23 14:47:42 +02:00
|
|
|
class CPPUHELPER_DLLPUBLIC OImplementationId
|
2000-09-18 14:29:57 +00:00
|
|
|
{
|
|
|
|
mutable ::com::sun::star::uno::Sequence< sal_Int8 > * _pSeq;
|
|
|
|
sal_Bool _bUseEthernetAddress;
|
|
|
|
|
|
|
|
public:
|
2012-01-05 19:40:38 +01:00
|
|
|
/// @cond INTERNAL
|
|
|
|
|
2000-09-18 14:29:57 +00:00
|
|
|
// these are here to force memory de/allocation to sal lib.
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void * SAL_CALL operator new( size_t nSize )
|
2000-09-18 14:29:57 +00:00
|
|
|
{ return ::rtl_allocateMemory( nSize ); }
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void SAL_CALL operator delete( void * pMem )
|
2000-09-18 14:29:57 +00:00
|
|
|
{ ::rtl_freeMemory( pMem ); }
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void * SAL_CALL operator new( size_t, void * pMem )
|
2001-03-09 11:15:28 +00:00
|
|
|
{ return pMem; }
|
2014-06-05 08:08:06 +02:00
|
|
|
inline static void SAL_CALL operator delete( void *, void * )
|
2001-03-09 11:15:28 +00:00
|
|
|
{}
|
2000-09-18 14:29:57 +00:00
|
|
|
|
2014-06-05 08:08:06 +02:00
|
|
|
~OImplementationId();
|
2012-01-05 19:40:38 +01:00
|
|
|
|
|
|
|
/// @endcond
|
|
|
|
|
2001-11-09 12:49:16 +00:00
|
|
|
/** Constructor.
|
|
|
|
|
|
|
|
@param bUseEthernetAddress whether an ethernet mac address should be taken into account
|
|
|
|
*/
|
2014-06-05 08:08:06 +02:00
|
|
|
inline OImplementationId( bool bUseEthernetAddress = true )
|
2000-09-18 14:29:57 +00:00
|
|
|
: _pSeq( 0 )
|
|
|
|
, _bUseEthernetAddress( bUseEthernetAddress )
|
|
|
|
{}
|
2001-11-09 12:49:16 +00:00
|
|
|
/** Constructor giving implementation id.
|
|
|
|
|
|
|
|
@param rSeq implementation id
|
|
|
|
*/
|
2014-06-05 08:08:06 +02:00
|
|
|
inline OImplementationId( const ::com::sun::star::uno::Sequence< sal_Int8 > & rSeq )
|
2000-09-18 14:29:57 +00:00
|
|
|
: _pSeq( new ::com::sun::star::uno::Sequence< sal_Int8 >( rSeq ) )
|
2014-03-22 20:53:48 +00:00
|
|
|
, _bUseEthernetAddress( false )
|
2000-09-18 14:29:57 +00:00
|
|
|
{}
|
2014-06-05 08:08:06 +02:00
|
|
|
inline OImplementationId( const OImplementationId & rId )
|
2000-09-18 14:29:57 +00:00
|
|
|
: _pSeq( new ::com::sun::star::uno::Sequence< sal_Int8 >( rId.getImplementationId() ) )
|
2014-03-22 20:53:48 +00:00
|
|
|
, _bUseEthernetAddress( false )
|
2000-09-18 14:29:57 +00:00
|
|
|
{}
|
|
|
|
|
2014-03-10 12:16:40 +01:00
|
|
|
/** Get implementation id.
|
2001-11-09 12:49:16 +00:00
|
|
|
|
|
|
|
@return implementation id
|
|
|
|
*/
|
2014-06-05 08:08:06 +02:00
|
|
|
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() const;
|
2000-09-18 14:29:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:07 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|