1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsSupportsPrimitives_h__
8 #define nsSupportsPrimitives_h__
10 #include "mozilla/Attributes.h"
12 #include "nsISupportsPrimitives.h"
16 /***************************************************************************/
18 class nsSupportsCString final
: public nsISupportsCString
{
21 NS_DECL_NSISUPPORTSPRIMITIVE
22 NS_DECL_NSISUPPORTSCSTRING
24 nsSupportsCString() = default;
27 ~nsSupportsCString() = default;
32 /***************************************************************************/
34 class nsSupportsString final
: public nsISupportsString
{
37 NS_DECL_NSISUPPORTSPRIMITIVE
38 NS_DECL_NSISUPPORTSSTRING
40 nsSupportsString() = default;
43 ~nsSupportsString() = default;
48 /***************************************************************************/
50 class nsSupportsPRBool final
: public nsISupportsPRBool
{
52 NS_DECL_THREADSAFE_ISUPPORTS
53 NS_DECL_NSISUPPORTSPRIMITIVE
54 NS_DECL_NSISUPPORTSPRBOOL
59 ~nsSupportsPRBool() = default;
64 /***************************************************************************/
66 class nsSupportsPRUint8 final
: public nsISupportsPRUint8
{
69 NS_DECL_NSISUPPORTSPRIMITIVE
70 NS_DECL_NSISUPPORTSPRUINT8
75 ~nsSupportsPRUint8() = default;
80 /***************************************************************************/
82 class nsSupportsPRUint16 final
: public nsISupportsPRUint16
{
85 NS_DECL_NSISUPPORTSPRIMITIVE
86 NS_DECL_NSISUPPORTSPRUINT16
91 ~nsSupportsPRUint16() = default;
96 /***************************************************************************/
98 class nsSupportsPRUint32 final
: public nsISupportsPRUint32
{
101 NS_DECL_NSISUPPORTSPRIMITIVE
102 NS_DECL_NSISUPPORTSPRUINT32
104 nsSupportsPRUint32();
107 ~nsSupportsPRUint32() = default;
112 /***************************************************************************/
114 class nsSupportsPRUint64 final
: public nsISupportsPRUint64
{
117 NS_DECL_NSISUPPORTSPRIMITIVE
118 NS_DECL_NSISUPPORTSPRUINT64
120 nsSupportsPRUint64();
123 ~nsSupportsPRUint64() = default;
128 /***************************************************************************/
130 class nsSupportsPRTime final
: public nsISupportsPRTime
{
133 NS_DECL_NSISUPPORTSPRIMITIVE
134 NS_DECL_NSISUPPORTSPRTIME
139 ~nsSupportsPRTime() = default;
144 /***************************************************************************/
146 class nsSupportsChar final
: public nsISupportsChar
{
149 NS_DECL_NSISUPPORTSPRIMITIVE
150 NS_DECL_NSISUPPORTSCHAR
155 ~nsSupportsChar() = default;
160 /***************************************************************************/
162 class nsSupportsPRInt16 final
: public nsISupportsPRInt16
{
165 NS_DECL_NSISUPPORTSPRIMITIVE
166 NS_DECL_NSISUPPORTSPRINT16
171 ~nsSupportsPRInt16() = default;
176 /***************************************************************************/
178 class nsSupportsPRInt32 final
: public nsISupportsPRInt32
{
181 NS_DECL_NSISUPPORTSPRIMITIVE
182 NS_DECL_NSISUPPORTSPRINT32
187 ~nsSupportsPRInt32() = default;
192 /***************************************************************************/
194 class nsSupportsPRInt64 final
: public nsISupportsPRInt64
{
197 NS_DECL_NSISUPPORTSPRIMITIVE
198 NS_DECL_NSISUPPORTSPRINT64
203 ~nsSupportsPRInt64() = default;
208 /***************************************************************************/
210 class nsSupportsFloat final
: public nsISupportsFloat
{
213 NS_DECL_NSISUPPORTSPRIMITIVE
214 NS_DECL_NSISUPPORTSFLOAT
219 ~nsSupportsFloat() = default;
224 /***************************************************************************/
226 class nsSupportsDouble final
: public nsISupportsDouble
{
229 NS_DECL_NSISUPPORTSPRIMITIVE
230 NS_DECL_NSISUPPORTSDOUBLE
235 ~nsSupportsDouble() = default;
240 /***************************************************************************/
242 class nsSupportsInterfacePointer final
: public nsISupportsInterfacePointer
{
244 NS_DECL_THREADSAFE_ISUPPORTS
245 NS_DECL_NSISUPPORTSPRIMITIVE
246 NS_DECL_NSISUPPORTSINTERFACEPOINTER
248 nsSupportsInterfacePointer();
251 ~nsSupportsInterfacePointer();
253 nsCOMPtr
<nsISupports
> mData
;
257 /***************************************************************************/
260 * Wraps a static const char* buffer for use with nsISupportsCString
262 * Only use this class with static buffers, or arena-allocated buffers of
263 * permanent lifetime!
265 class nsSupportsDependentCString final
: public nsISupportsCString
{
268 NS_DECL_NSISUPPORTSPRIMITIVE
269 NS_DECL_NSISUPPORTSCSTRING
271 explicit nsSupportsDependentCString(const char* aStr
);
274 ~nsSupportsDependentCString() = default;
276 nsDependentCString mData
;
279 #endif /* nsSupportsPrimitives_h__ */