1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dispatcher.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #if ! defined INCLUDED_UNO_DISPATCHER_HXX
32 #define INCLUDED_UNO_DISPATCHER_HXX
34 #include "uno/dispatcher.h"
46 /** C++ holder reference for binary C uno_Interface. Not for public use, may be
53 class UnoInterfaceReference
56 uno_Interface
* m_pUnoI
;
58 inline bool is() const
59 { return m_pUnoI
!= 0; }
61 inline ~UnoInterfaceReference();
62 inline UnoInterfaceReference();
63 inline UnoInterfaceReference( uno_Interface
* pUnoI
, __sal_NoAcquire
);
64 inline UnoInterfaceReference( uno_Interface
* pUnoI
);
65 inline UnoInterfaceReference( UnoInterfaceReference
const & ref
);
67 inline uno_Interface
* get() const
70 inline UnoInterfaceReference
& set(
71 uno_Interface
* pUnoI
);
72 inline UnoInterfaceReference
& set(
73 uno_Interface
* pUnoI
, __sal_NoAcquire
);
76 inline UnoInterfaceReference
& operator = (
77 UnoInterfaceReference
const & ref
)
78 { return set( ref
.m_pUnoI
); }
79 inline UnoInterfaceReference
& operator = (
80 uno_Interface
* pUnoI
)
81 { return set( pUnoI
); }
84 struct _typelib_TypeDescription
const * pMemberType
,
85 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const;
88 inline bool operator == ( UnoInterfaceReference
const & ); // not impl
89 inline bool operator != ( UnoInterfaceReference
const & ); // not impl
90 inline bool operator == ( uno_Interface
* ); // not impl
91 inline bool operator != ( uno_Interface
* ); // not impl
94 //______________________________________________________________________________
95 inline UnoInterfaceReference::~UnoInterfaceReference()
98 (*m_pUnoI
->release
)( m_pUnoI
);
101 //______________________________________________________________________________
102 inline UnoInterfaceReference::UnoInterfaceReference()
107 //______________________________________________________________________________
108 inline UnoInterfaceReference::UnoInterfaceReference(
109 uno_Interface
* pUnoI
, __sal_NoAcquire
)
114 //______________________________________________________________________________
115 inline UnoInterfaceReference::UnoInterfaceReference( uno_Interface
* pUnoI
)
119 (*m_pUnoI
->acquire
)( m_pUnoI
);
122 //______________________________________________________________________________
123 inline UnoInterfaceReference::UnoInterfaceReference(
124 UnoInterfaceReference
const & ref
)
125 : m_pUnoI( ref
.m_pUnoI
)
128 (*m_pUnoI
->acquire
)( m_pUnoI
);
131 //______________________________________________________________________________
132 inline UnoInterfaceReference
& UnoInterfaceReference::set(
133 uno_Interface
* pUnoI
)
136 (*pUnoI
->acquire
)( pUnoI
);
138 (*m_pUnoI
->release
)( m_pUnoI
);
143 //______________________________________________________________________________
144 inline UnoInterfaceReference
& UnoInterfaceReference::set(
145 uno_Interface
* pUnoI
, __sal_NoAcquire
)
148 (*m_pUnoI
->release
)( m_pUnoI
);
153 //______________________________________________________________________________
154 inline void UnoInterfaceReference::clear()
158 (*m_pUnoI
->release
)( m_pUnoI
);
163 //______________________________________________________________________________
164 inline void UnoInterfaceReference::dispatch(
165 struct _typelib_TypeDescription
const * pMemberType
,
166 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const
168 (*m_pUnoI
->pDispatcher
)(
169 m_pUnoI
, pMemberType
, pReturn
, pArgs
, ppException
);