1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #if ! defined INCLUDED_UNO_DISPATCHER_HXX
30 #define INCLUDED_UNO_DISPATCHER_HXX
32 #include "uno/dispatcher.h"
45 /** C++ holder reference for binary C uno_Interface. Not for public use, may be
52 class UnoInterfaceReference
55 uno_Interface
* m_pUnoI
;
57 inline bool is() const
58 { return m_pUnoI
!= 0; }
60 inline ~UnoInterfaceReference();
61 inline UnoInterfaceReference();
62 inline UnoInterfaceReference( uno_Interface
* pUnoI
, __sal_NoAcquire
);
63 inline UnoInterfaceReference( uno_Interface
* pUnoI
);
64 inline UnoInterfaceReference( UnoInterfaceReference
const & ref
);
66 inline uno_Interface
* get() const
69 inline UnoInterfaceReference
& set(
70 uno_Interface
* pUnoI
);
71 inline UnoInterfaceReference
& set(
72 uno_Interface
* pUnoI
, __sal_NoAcquire
);
75 inline UnoInterfaceReference
& operator = (
76 UnoInterfaceReference
const & ref
)
77 { return set( ref
.m_pUnoI
); }
78 inline UnoInterfaceReference
& operator = (
79 uno_Interface
* pUnoI
)
80 { return set( pUnoI
); }
83 struct _typelib_TypeDescription
const * pMemberType
,
84 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const;
87 inline bool operator == ( UnoInterfaceReference
const & ); // not impl
88 inline bool operator != ( UnoInterfaceReference
const & ); // not impl
89 inline bool operator == ( uno_Interface
* ); // not impl
90 inline bool operator != ( uno_Interface
* ); // not impl
93 //______________________________________________________________________________
94 inline UnoInterfaceReference::~UnoInterfaceReference()
97 (*m_pUnoI
->release
)( m_pUnoI
);
100 //______________________________________________________________________________
101 inline UnoInterfaceReference::UnoInterfaceReference()
106 //______________________________________________________________________________
107 inline UnoInterfaceReference::UnoInterfaceReference(
108 uno_Interface
* pUnoI
, __sal_NoAcquire
)
113 //______________________________________________________________________________
114 inline UnoInterfaceReference::UnoInterfaceReference( uno_Interface
* pUnoI
)
118 (*m_pUnoI
->acquire
)( m_pUnoI
);
121 //______________________________________________________________________________
122 inline UnoInterfaceReference::UnoInterfaceReference(
123 UnoInterfaceReference
const & ref
)
124 : m_pUnoI( ref
.m_pUnoI
)
127 (*m_pUnoI
->acquire
)( m_pUnoI
);
130 //______________________________________________________________________________
131 inline UnoInterfaceReference
& UnoInterfaceReference::set(
132 uno_Interface
* pUnoI
)
135 (*pUnoI
->acquire
)( pUnoI
);
137 (*m_pUnoI
->release
)( m_pUnoI
);
142 //______________________________________________________________________________
143 inline UnoInterfaceReference
& UnoInterfaceReference::set(
144 uno_Interface
* pUnoI
, __sal_NoAcquire
)
147 (*m_pUnoI
->release
)( m_pUnoI
);
152 //______________________________________________________________________________
153 inline void UnoInterfaceReference::clear()
157 (*m_pUnoI
->release
)( m_pUnoI
);
162 //______________________________________________________________________________
163 inline void UnoInterfaceReference::dispatch(
164 struct _typelib_TypeDescription
const * pMemberType
,
165 void * pReturn
, void * pArgs
[], uno_Any
** ppException
) const
167 (*m_pUnoI
->pDispatcher
)(
168 m_pUnoI
, pMemberType
, pReturn
, pArgs
, ppException
);
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */