On x86 compilers without fastcall, simulate it when invoking traces and un-simulate...
[wine-gecko.git] / xpcom / ds / nsSupportsPrimitives.h
blob81e83fa3a227ce4a88a7e1a5883f927bba7c02a0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Dan Rosen <dr@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #ifndef nsSupportsPrimitives_h__
40 #define nsSupportsPrimitives_h__
42 #include "nsISupportsPrimitives.h"
43 #include "nsCOMPtr.h"
44 #include "nsString.h"
45 #include "nsDependentString.h"
47 class nsSupportsIDImpl : public nsISupportsID
49 public:
50 NS_DECL_ISUPPORTS
51 NS_DECL_NSISUPPORTSPRIMITIVE
52 NS_DECL_NSISUPPORTSID
54 nsSupportsIDImpl();
56 private:
57 ~nsSupportsIDImpl() { }
59 nsID *mData;
62 /***************************************************************************/
64 class nsSupportsCStringImpl : public nsISupportsCString
66 public:
67 NS_DECL_ISUPPORTS
68 NS_DECL_NSISUPPORTSPRIMITIVE
69 NS_DECL_NSISUPPORTSCSTRING
71 nsSupportsCStringImpl() {}
73 private:
74 ~nsSupportsCStringImpl() {}
76 nsCString mData;
79 /***************************************************************************/
81 class nsSupportsStringImpl : public nsISupportsString
83 public:
84 NS_DECL_ISUPPORTS
85 NS_DECL_NSISUPPORTSPRIMITIVE
86 NS_DECL_NSISUPPORTSSTRING
88 nsSupportsStringImpl() {}
90 private:
91 ~nsSupportsStringImpl() {}
93 nsString mData;
96 /***************************************************************************/
98 class nsSupportsPRBoolImpl : public nsISupportsPRBool
100 public:
101 NS_DECL_ISUPPORTS
102 NS_DECL_NSISUPPORTSPRIMITIVE
103 NS_DECL_NSISUPPORTSPRBOOL
105 nsSupportsPRBoolImpl();
107 private:
108 ~nsSupportsPRBoolImpl() {}
110 PRBool mData;
113 /***************************************************************************/
115 class nsSupportsPRUint8Impl : public nsISupportsPRUint8
117 public:
118 NS_DECL_ISUPPORTS
119 NS_DECL_NSISUPPORTSPRIMITIVE
120 NS_DECL_NSISUPPORTSPRUINT8
122 nsSupportsPRUint8Impl();
124 private:
125 ~nsSupportsPRUint8Impl() {}
127 PRUint8 mData;
130 /***************************************************************************/
132 class nsSupportsPRUint16Impl : public nsISupportsPRUint16
134 public:
135 NS_DECL_ISUPPORTS
136 NS_DECL_NSISUPPORTSPRIMITIVE
137 NS_DECL_NSISUPPORTSPRUINT16
139 nsSupportsPRUint16Impl();
141 private:
142 ~nsSupportsPRUint16Impl() {}
144 PRUint16 mData;
147 /***************************************************************************/
149 class nsSupportsPRUint32Impl : public nsISupportsPRUint32
151 public:
152 NS_DECL_ISUPPORTS
153 NS_DECL_NSISUPPORTSPRIMITIVE
154 NS_DECL_NSISUPPORTSPRUINT32
156 nsSupportsPRUint32Impl();
158 private:
159 ~nsSupportsPRUint32Impl() {}
161 PRUint32 mData;
164 /***************************************************************************/
166 class nsSupportsPRUint64Impl : public nsISupportsPRUint64
168 public:
169 NS_DECL_ISUPPORTS
170 NS_DECL_NSISUPPORTSPRIMITIVE
171 NS_DECL_NSISUPPORTSPRUINT64
173 nsSupportsPRUint64Impl();
175 private:
176 ~nsSupportsPRUint64Impl() {}
178 PRUint64 mData;
181 /***************************************************************************/
183 class nsSupportsPRTimeImpl : public nsISupportsPRTime
185 public:
186 NS_DECL_ISUPPORTS
187 NS_DECL_NSISUPPORTSPRIMITIVE
188 NS_DECL_NSISUPPORTSPRTIME
190 nsSupportsPRTimeImpl();
192 private:
193 ~nsSupportsPRTimeImpl() {}
195 PRTime mData;
198 /***************************************************************************/
200 class nsSupportsCharImpl : public nsISupportsChar
202 public:
203 NS_DECL_ISUPPORTS
204 NS_DECL_NSISUPPORTSPRIMITIVE
205 NS_DECL_NSISUPPORTSCHAR
207 nsSupportsCharImpl();
209 private:
210 ~nsSupportsCharImpl() {}
212 char mData;
215 /***************************************************************************/
217 class nsSupportsPRInt16Impl : public nsISupportsPRInt16
219 public:
220 NS_DECL_ISUPPORTS
221 NS_DECL_NSISUPPORTSPRIMITIVE
222 NS_DECL_NSISUPPORTSPRINT16
224 nsSupportsPRInt16Impl();
226 private:
227 ~nsSupportsPRInt16Impl() {}
229 PRInt16 mData;
232 /***************************************************************************/
234 class nsSupportsPRInt32Impl : public nsISupportsPRInt32
236 public:
237 NS_DECL_ISUPPORTS
238 NS_DECL_NSISUPPORTSPRIMITIVE
239 NS_DECL_NSISUPPORTSPRINT32
241 nsSupportsPRInt32Impl();
243 private:
244 ~nsSupportsPRInt32Impl() {}
246 PRInt32 mData;
249 /***************************************************************************/
251 class nsSupportsPRInt64Impl : public nsISupportsPRInt64
253 public:
254 NS_DECL_ISUPPORTS
255 NS_DECL_NSISUPPORTSPRIMITIVE
256 NS_DECL_NSISUPPORTSPRINT64
258 nsSupportsPRInt64Impl();
260 private:
261 ~nsSupportsPRInt64Impl() {}
263 PRInt64 mData;
266 /***************************************************************************/
268 class nsSupportsFloatImpl : public nsISupportsFloat
270 public:
271 NS_DECL_ISUPPORTS
272 NS_DECL_NSISUPPORTSPRIMITIVE
273 NS_DECL_NSISUPPORTSFLOAT
275 nsSupportsFloatImpl();
277 private:
278 ~nsSupportsFloatImpl() {}
280 float mData;
283 /***************************************************************************/
285 class nsSupportsDoubleImpl : public nsISupportsDouble
287 public:
288 NS_DECL_ISUPPORTS
289 NS_DECL_NSISUPPORTSPRIMITIVE
290 NS_DECL_NSISUPPORTSDOUBLE
292 nsSupportsDoubleImpl();
294 private:
295 ~nsSupportsDoubleImpl() {}
297 double mData;
300 /***************************************************************************/
302 class nsSupportsVoidImpl : public nsISupportsVoid
304 public:
305 NS_DECL_ISUPPORTS
306 NS_DECL_NSISUPPORTSPRIMITIVE
307 NS_DECL_NSISUPPORTSVOID
309 nsSupportsVoidImpl();
311 private:
312 ~nsSupportsVoidImpl() {}
314 void* mData;
317 /***************************************************************************/
319 class nsSupportsInterfacePointerImpl : public nsISupportsInterfacePointer
321 public:
322 NS_DECL_ISUPPORTS
323 NS_DECL_NSISUPPORTSPRIMITIVE
324 NS_DECL_NSISUPPORTSINTERFACEPOINTER
326 nsSupportsInterfacePointerImpl();
328 private:
329 ~nsSupportsInterfacePointerImpl();
331 nsCOMPtr<nsISupports> mData;
332 nsID *mIID;
335 /***************************************************************************/
338 * Wraps a static const char* buffer for use with nsISupportsCString
340 * Only use this class with static buffers, or arena-allocated buffers of
341 * permanent lifetime!
343 class nsSupportsDependentCString : public nsISupportsCString
345 public:
346 NS_DECL_ISUPPORTS
347 NS_DECL_NSISUPPORTSPRIMITIVE
348 NS_DECL_NSISUPPORTSCSTRING
350 nsSupportsDependentCString(const char* aStr);
352 private:
353 ~nsSupportsDependentCString() {}
355 nsDependentCString mData;
358 #endif /* nsSupportsPrimitives_h__ */