Back to index

lightning-sunbird  0.9+nobinonly
nsSupportsPrimitives.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Dan Rosen <dr@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #ifndef nsSupportsPrimitives_h__
00040 #define nsSupportsPrimitives_h__
00041 
00042 #include "nsISupportsPrimitives.h"
00043 #include "nsCOMPtr.h"
00044 #include "nsString.h"
00045 #include "nsDependentString.h"
00046 
00047 class nsSupportsIDImpl : public nsISupportsID
00048 {
00049 public:
00050     NS_DECL_ISUPPORTS
00051     NS_DECL_NSISUPPORTSPRIMITIVE
00052     NS_DECL_NSISUPPORTSID
00053 
00054     nsSupportsIDImpl();
00055 
00056 private:
00057     ~nsSupportsIDImpl() { }
00058 
00059     nsID *mData;
00060 };
00061 
00062 /***************************************************************************/
00063 
00064 class nsSupportsCStringImpl : public nsISupportsCString
00065 {
00066 public:
00067     NS_DECL_ISUPPORTS
00068     NS_DECL_NSISUPPORTSPRIMITIVE
00069     NS_DECL_NSISUPPORTSCSTRING
00070 
00071     nsSupportsCStringImpl() {}
00072 
00073 private:
00074     ~nsSupportsCStringImpl() {}
00075     
00076     nsCString mData;
00077 };
00078 
00079 /***************************************************************************/
00080 
00081 class nsSupportsStringImpl : public nsISupportsString
00082 {
00083 public:
00084     NS_DECL_ISUPPORTS
00085     NS_DECL_NSISUPPORTSPRIMITIVE
00086     NS_DECL_NSISUPPORTSSTRING
00087 
00088     nsSupportsStringImpl() {}
00089 
00090 private:
00091     ~nsSupportsStringImpl() {}
00092     
00093     nsString mData;
00094 };
00095 
00096 /***************************************************************************/
00097 
00098 class nsSupportsPRBoolImpl : public nsISupportsPRBool
00099 {
00100 public:
00101     NS_DECL_ISUPPORTS
00102     NS_DECL_NSISUPPORTSPRIMITIVE
00103     NS_DECL_NSISUPPORTSPRBOOL
00104 
00105     nsSupportsPRBoolImpl();
00106 
00107 private:
00108     ~nsSupportsPRBoolImpl() {}
00109 
00110     PRBool mData;
00111 };
00112 
00113 /***************************************************************************/
00114 
00115 class nsSupportsPRUint8Impl : public nsISupportsPRUint8
00116 {
00117 public:
00118     NS_DECL_ISUPPORTS
00119     NS_DECL_NSISUPPORTSPRIMITIVE
00120     NS_DECL_NSISUPPORTSPRUINT8
00121 
00122     nsSupportsPRUint8Impl();
00123 
00124 private:
00125     ~nsSupportsPRUint8Impl() {}
00126 
00127     PRUint8 mData;
00128 };
00129 
00130 /***************************************************************************/
00131 
00132 class nsSupportsPRUint16Impl : public nsISupportsPRUint16
00133 {
00134 public:
00135     NS_DECL_ISUPPORTS
00136     NS_DECL_NSISUPPORTSPRIMITIVE
00137     NS_DECL_NSISUPPORTSPRUINT16
00138 
00139     nsSupportsPRUint16Impl();
00140 
00141 private:
00142     ~nsSupportsPRUint16Impl() {}
00143 
00144     PRUint16 mData;
00145 };
00146 
00147 /***************************************************************************/
00148 
00149 class nsSupportsPRUint32Impl : public nsISupportsPRUint32
00150 {
00151 public:
00152     NS_DECL_ISUPPORTS
00153     NS_DECL_NSISUPPORTSPRIMITIVE
00154     NS_DECL_NSISUPPORTSPRUINT32
00155 
00156     nsSupportsPRUint32Impl();
00157 
00158 private:
00159     ~nsSupportsPRUint32Impl() {}
00160 
00161     PRUint32 mData;
00162 };
00163 
00164 /***************************************************************************/
00165 
00166 class nsSupportsPRUint64Impl : public nsISupportsPRUint64
00167 {
00168 public:
00169     NS_DECL_ISUPPORTS
00170     NS_DECL_NSISUPPORTSPRIMITIVE
00171     NS_DECL_NSISUPPORTSPRUINT64
00172 
00173     nsSupportsPRUint64Impl();
00174 
00175 private:
00176     ~nsSupportsPRUint64Impl() {}
00177 
00178     PRUint64 mData;
00179 };
00180 
00181 /***************************************************************************/
00182 
00183 class nsSupportsPRTimeImpl : public nsISupportsPRTime
00184 {
00185 public:
00186     NS_DECL_ISUPPORTS
00187     NS_DECL_NSISUPPORTSPRIMITIVE
00188     NS_DECL_NSISUPPORTSPRTIME
00189 
00190     nsSupportsPRTimeImpl();
00191 
00192 private:
00193     ~nsSupportsPRTimeImpl() {}
00194 
00195     PRTime mData;
00196 };
00197 
00198 /***************************************************************************/
00199 
00200 class nsSupportsCharImpl : public nsISupportsChar
00201 {
00202 public:
00203     NS_DECL_ISUPPORTS
00204     NS_DECL_NSISUPPORTSPRIMITIVE
00205     NS_DECL_NSISUPPORTSCHAR
00206 
00207     nsSupportsCharImpl();
00208 
00209 private:
00210     ~nsSupportsCharImpl() {}
00211 
00212     char mData;
00213 };
00214 
00215 /***************************************************************************/
00216 
00217 class nsSupportsPRInt16Impl : public nsISupportsPRInt16
00218 {
00219 public:
00220     NS_DECL_ISUPPORTS
00221     NS_DECL_NSISUPPORTSPRIMITIVE
00222     NS_DECL_NSISUPPORTSPRINT16
00223 
00224     nsSupportsPRInt16Impl();
00225 
00226 private:
00227     ~nsSupportsPRInt16Impl() {}
00228 
00229     PRInt16 mData;
00230 };
00231 
00232 /***************************************************************************/
00233 
00234 class nsSupportsPRInt32Impl : public nsISupportsPRInt32
00235 {
00236 public:
00237     NS_DECL_ISUPPORTS
00238     NS_DECL_NSISUPPORTSPRIMITIVE
00239     NS_DECL_NSISUPPORTSPRINT32
00240 
00241     nsSupportsPRInt32Impl();
00242 
00243 private:
00244     ~nsSupportsPRInt32Impl() {}
00245 
00246     PRInt32 mData;
00247 };
00248 
00249 /***************************************************************************/
00250 
00251 class nsSupportsPRInt64Impl : public nsISupportsPRInt64
00252 {
00253 public:
00254     NS_DECL_ISUPPORTS
00255     NS_DECL_NSISUPPORTSPRIMITIVE
00256     NS_DECL_NSISUPPORTSPRINT64
00257 
00258     nsSupportsPRInt64Impl();
00259 
00260 private:
00261     ~nsSupportsPRInt64Impl() {}
00262 
00263     PRInt64 mData;
00264 };
00265 
00266 /***************************************************************************/
00267 
00268 class nsSupportsFloatImpl : public nsISupportsFloat
00269 {
00270 public:
00271     NS_DECL_ISUPPORTS
00272     NS_DECL_NSISUPPORTSPRIMITIVE
00273     NS_DECL_NSISUPPORTSFLOAT
00274 
00275     nsSupportsFloatImpl();
00276 
00277 private:
00278     ~nsSupportsFloatImpl() {}
00279 
00280     float mData;
00281 };
00282 
00283 /***************************************************************************/
00284 
00285 class nsSupportsDoubleImpl : public nsISupportsDouble
00286 {
00287 public:
00288     NS_DECL_ISUPPORTS
00289     NS_DECL_NSISUPPORTSPRIMITIVE
00290     NS_DECL_NSISUPPORTSDOUBLE
00291 
00292     nsSupportsDoubleImpl();
00293 
00294 private:
00295     ~nsSupportsDoubleImpl() {}
00296 
00297     double mData;
00298 };
00299 
00300 /***************************************************************************/
00301 
00302 class nsSupportsVoidImpl : public nsISupportsVoid
00303 {
00304 public:
00305     NS_DECL_ISUPPORTS
00306     NS_DECL_NSISUPPORTSPRIMITIVE
00307     NS_DECL_NSISUPPORTSVOID
00308 
00309     nsSupportsVoidImpl();
00310 
00311 private:
00312     ~nsSupportsVoidImpl() {}
00313 
00314     void* mData;
00315 };
00316 
00317 /***************************************************************************/
00318 
00319 class nsSupportsInterfacePointerImpl : public nsISupportsInterfacePointer
00320 {
00321 public:
00322     NS_DECL_ISUPPORTS
00323     NS_DECL_NSISUPPORTSPRIMITIVE
00324     NS_DECL_NSISUPPORTSINTERFACEPOINTER
00325 
00326     nsSupportsInterfacePointerImpl();
00327 
00328 private:
00329     ~nsSupportsInterfacePointerImpl();
00330 
00331     nsCOMPtr<nsISupports> mData;
00332     nsID *mIID;
00333 };
00334 
00335 /***************************************************************************/
00336 
00343 class nsSupportsDependentCString : public nsISupportsCString
00344 {
00345 public:
00346   NS_DECL_ISUPPORTS
00347   NS_DECL_NSISUPPORTSPRIMITIVE
00348   NS_DECL_NSISUPPORTSCSTRING
00349 
00350   nsSupportsDependentCString(const char* aStr);
00351 
00352 private:
00353   ~nsSupportsDependentCString() {}
00354 
00355   nsDependentCString mData;
00356 };
00357 
00358 #endif /* nsSupportsPrimitives_h__ */