michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsSupportsPrimitives_h__ michael@0: #define nsSupportsPrimitives_h__ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #include "nsISupportsPrimitives.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: michael@0: class nsSupportsIDImpl MOZ_FINAL : public nsISupportsID michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSID michael@0: michael@0: nsSupportsIDImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsIDImpl() { } michael@0: michael@0: nsID *mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsCStringImpl MOZ_FINAL : public nsISupportsCString michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSCSTRING michael@0: michael@0: nsSupportsCStringImpl() {} michael@0: michael@0: private: michael@0: ~nsSupportsCStringImpl() {} michael@0: michael@0: nsCString mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsStringImpl MOZ_FINAL : public nsISupportsString michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSSTRING michael@0: michael@0: nsSupportsStringImpl() {} michael@0: michael@0: private: michael@0: ~nsSupportsStringImpl() {} michael@0: michael@0: nsString mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRBoolImpl MOZ_FINAL : public nsISupportsPRBool michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRBOOL michael@0: michael@0: nsSupportsPRBoolImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRBoolImpl() {} michael@0: michael@0: bool mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRUint8Impl MOZ_FINAL : public nsISupportsPRUint8 michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRUINT8 michael@0: michael@0: nsSupportsPRUint8Impl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRUint8Impl() {} michael@0: michael@0: uint8_t mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRUint16Impl MOZ_FINAL : public nsISupportsPRUint16 michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRUINT16 michael@0: michael@0: nsSupportsPRUint16Impl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRUint16Impl() {} michael@0: michael@0: uint16_t mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRUint32Impl MOZ_FINAL : public nsISupportsPRUint32 michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRUINT32 michael@0: michael@0: nsSupportsPRUint32Impl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRUint32Impl() {} michael@0: michael@0: uint32_t mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRUint64Impl MOZ_FINAL : public nsISupportsPRUint64 michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRUINT64 michael@0: michael@0: nsSupportsPRUint64Impl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRUint64Impl() {} michael@0: michael@0: uint64_t mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRTimeImpl MOZ_FINAL : public nsISupportsPRTime michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRTIME michael@0: michael@0: nsSupportsPRTimeImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRTimeImpl() {} michael@0: michael@0: PRTime mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsCharImpl MOZ_FINAL : public nsISupportsChar michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSCHAR michael@0: michael@0: nsSupportsCharImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsCharImpl() {} michael@0: michael@0: char mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRInt16Impl MOZ_FINAL : public nsISupportsPRInt16 michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRINT16 michael@0: michael@0: nsSupportsPRInt16Impl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRInt16Impl() {} michael@0: michael@0: int16_t mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRInt32Impl MOZ_FINAL : public nsISupportsPRInt32 michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRINT32 michael@0: michael@0: nsSupportsPRInt32Impl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRInt32Impl() {} michael@0: michael@0: int32_t mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsPRInt64Impl MOZ_FINAL : public nsISupportsPRInt64 michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSPRINT64 michael@0: michael@0: nsSupportsPRInt64Impl(); michael@0: michael@0: private: michael@0: ~nsSupportsPRInt64Impl() {} michael@0: michael@0: int64_t mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsFloatImpl MOZ_FINAL : public nsISupportsFloat michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSFLOAT michael@0: michael@0: nsSupportsFloatImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsFloatImpl() {} michael@0: michael@0: float mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsDoubleImpl MOZ_FINAL : public nsISupportsDouble michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSDOUBLE michael@0: michael@0: nsSupportsDoubleImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsDoubleImpl() {} michael@0: michael@0: double mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsVoidImpl MOZ_FINAL : public nsISupportsVoid michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSVOID michael@0: michael@0: nsSupportsVoidImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsVoidImpl() {} michael@0: michael@0: void* mData; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: class nsSupportsInterfacePointerImpl MOZ_FINAL : public nsISupportsInterfacePointer michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSINTERFACEPOINTER michael@0: michael@0: nsSupportsInterfacePointerImpl(); michael@0: michael@0: private: michael@0: ~nsSupportsInterfacePointerImpl(); michael@0: michael@0: nsCOMPtr mData; michael@0: nsID *mIID; michael@0: }; michael@0: michael@0: /***************************************************************************/ michael@0: michael@0: /** michael@0: * Wraps a static const char* buffer for use with nsISupportsCString michael@0: * michael@0: * Only use this class with static buffers, or arena-allocated buffers of michael@0: * permanent lifetime! michael@0: */ michael@0: class nsSupportsDependentCString MOZ_FINAL : public nsISupportsCString michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISUPPORTSPRIMITIVE michael@0: NS_DECL_NSISUPPORTSCSTRING michael@0: michael@0: nsSupportsDependentCString(const char* aStr); michael@0: michael@0: private: michael@0: ~nsSupportsDependentCString() {} michael@0: michael@0: nsDependentCString mData; michael@0: }; michael@0: michael@0: #endif /* nsSupportsPrimitives_h__ */