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 "uno/dispatcher.h"
36 /** C++ holder reference for binary C uno_Interface. Not for public use, may be
43 class UnoInterfaceReference
46 uno_Interface
* m_pUnoI
;
48 inline bool is() const
49 { return m_pUnoI
!= 0; }
51 inline ~UnoInterfaceReference();
52 inline UnoInterfaceReference();
53 inline UnoInterfaceReference( uno_Interface
* pUnoI
, __sal_NoAcquire
);
54 inline UnoInterfaceReference( uno_Interface
* pUnoI
);
55 inline UnoInterfaceReference( UnoInterfaceReference
const & ref
);
57 inline uno_Interface
* get() const
60 inline UnoInterfaceReference
& set(
61 uno_Interface
* pUnoI
);
62 inline UnoInterfaceReference
& set(
63 uno_Interface
* pUnoI
, __sal_NoAcquire
);
66 inline UnoInterfaceReference
& operator = (
67 UnoInterfaceReference
const & ref
)
68 { return set( ref
.m_pUnoI
); }
69 inline UnoInterfaceReference
& operator = (
70 uno_Interface
* pUnoI
)
71 { return set( pUnoI
); }
74 struct _typelib_TypeDescription
const * pMemberType
,
75 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const;
78 inline bool operator == ( UnoInterfaceReference
const & ); // not impl
79 inline bool operator != ( UnoInterfaceReference
const & ); // not impl
80 inline bool operator == ( uno_Interface
* ); // not impl
81 inline bool operator != ( uno_Interface
* ); // not impl
84 //______________________________________________________________________________
85 inline UnoInterfaceReference::~UnoInterfaceReference()
88 (*m_pUnoI
->release
)( m_pUnoI
);
91 //______________________________________________________________________________
92 inline UnoInterfaceReference::UnoInterfaceReference()
97 //______________________________________________________________________________
98 inline UnoInterfaceReference::UnoInterfaceReference(
99 uno_Interface
* pUnoI
, __sal_NoAcquire
)
104 //______________________________________________________________________________
105 inline UnoInterfaceReference::UnoInterfaceReference( uno_Interface
* pUnoI
)
109 (*m_pUnoI
->acquire
)( m_pUnoI
);
112 //______________________________________________________________________________
113 inline UnoInterfaceReference::UnoInterfaceReference(
114 UnoInterfaceReference
const & ref
)
115 : m_pUnoI( ref
.m_pUnoI
)
118 (*m_pUnoI
->acquire
)( m_pUnoI
);
121 //______________________________________________________________________________
122 inline UnoInterfaceReference
& UnoInterfaceReference::set(
123 uno_Interface
* pUnoI
)
126 (*pUnoI
->acquire
)( pUnoI
);
128 (*m_pUnoI
->release
)( m_pUnoI
);
133 //______________________________________________________________________________
134 inline UnoInterfaceReference
& UnoInterfaceReference::set(
135 uno_Interface
* pUnoI
, __sal_NoAcquire
)
138 (*m_pUnoI
->release
)( m_pUnoI
);
143 //______________________________________________________________________________
144 inline void UnoInterfaceReference::clear()
148 (*m_pUnoI
->release
)( m_pUnoI
);
153 //______________________________________________________________________________
154 inline void UnoInterfaceReference::dispatch(
155 struct _typelib_TypeDescription
const * pMemberType
,
156 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const
158 (*m_pUnoI
->pDispatcher
)(
159 m_pUnoI
, pMemberType
, pReturn
, pArgs
, ppException
);
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */