1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_UNO_DISPATCHER_HXX
21 #define INCLUDED_UNO_DISPATCHER_HXX
23 #include <sal/config.h>
27 #include <uno/dispatcher.h>
40 /** C++ holder reference for binary C uno_Interface. Not for public use, may be
47 class UnoInterfaceReference
50 uno_Interface
* m_pUnoI
;
52 inline bool is() const
53 { return m_pUnoI
!= NULL
; }
55 inline ~UnoInterfaceReference();
56 inline UnoInterfaceReference();
57 inline UnoInterfaceReference( uno_Interface
* pUnoI
, __sal_NoAcquire
);
58 inline UnoInterfaceReference( uno_Interface
* pUnoI
);
59 inline UnoInterfaceReference( UnoInterfaceReference
const & ref
);
61 inline uno_Interface
* get() const
64 inline UnoInterfaceReference
& set(
65 uno_Interface
* pUnoI
);
66 inline UnoInterfaceReference
& set(
67 uno_Interface
* pUnoI
, __sal_NoAcquire
);
70 inline UnoInterfaceReference
& operator = (
71 UnoInterfaceReference
const & ref
)
72 { return set( ref
.m_pUnoI
); }
73 inline UnoInterfaceReference
& operator = (
74 uno_Interface
* pUnoI
)
75 { return set( pUnoI
); }
78 struct _typelib_TypeDescription
const * pMemberType
,
79 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const;
82 inline bool operator == ( UnoInterfaceReference
const & ); // not impl
83 inline bool operator != ( UnoInterfaceReference
const & ); // not impl
84 inline bool operator == ( uno_Interface
* ); // not impl
85 inline bool operator != ( uno_Interface
* ); // not impl
89 inline UnoInterfaceReference::~UnoInterfaceReference()
92 (*m_pUnoI
->release
)( m_pUnoI
);
96 inline UnoInterfaceReference::UnoInterfaceReference()
102 inline UnoInterfaceReference::UnoInterfaceReference(
103 uno_Interface
* pUnoI
, __sal_NoAcquire
)
109 inline UnoInterfaceReference::UnoInterfaceReference( uno_Interface
* pUnoI
)
113 (*m_pUnoI
->acquire
)( m_pUnoI
);
117 inline UnoInterfaceReference::UnoInterfaceReference(
118 UnoInterfaceReference
const & ref
)
119 : m_pUnoI( ref
.m_pUnoI
)
122 (*m_pUnoI
->acquire
)( m_pUnoI
);
126 inline UnoInterfaceReference
& UnoInterfaceReference::set(
127 uno_Interface
* pUnoI
)
130 (*pUnoI
->acquire
)( pUnoI
);
132 (*m_pUnoI
->release
)( m_pUnoI
);
138 inline UnoInterfaceReference
& UnoInterfaceReference::set(
139 uno_Interface
* pUnoI
, __sal_NoAcquire
)
142 (*m_pUnoI
->release
)( m_pUnoI
);
148 inline void UnoInterfaceReference::clear()
152 (*m_pUnoI
->release
)( m_pUnoI
);
158 inline void UnoInterfaceReference::dispatch(
159 struct _typelib_TypeDescription
const * pMemberType
,
160 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const
162 (*m_pUnoI
->pDispatcher
)(
163 m_pUnoI
, pMemberType
, pReturn
, pArgs
, ppException
);
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */