xpcom/ds/nsSupportsPrimitives.h
author L10n Bumper Bot <release+l10nbumper@mozilla.com>
Thu, 08 Nov 2018 03:00:11 -0800
changeset 501100 1cd4f2d571554c4dc89cf1be1d98683c0d14f797
parent 376140 bd533dd0ca2a44161eba477f33c6b99873e52ce6
child 508163 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
no bug - Bumping Fennec l10n changesets r=release a=l10n-bump DONTBUILD an -> 336e061995b9 ar -> f6834a7d7374 as -> d2c76e616a66 ast -> fcb8f3455237 az -> c4caf3b07cf2 be -> 697eb1022498 bg -> 7bf1f448f743 bn-BD -> 5f7a87adee06 bn-IN -> 49ce3195c4c2 br -> 41cf35b7c5b5 bs -> 4a14aee27904 ca -> 9373e8ce86d4 cak -> a40d767541ba cs -> 4b99defb0525 cy -> 4c948fed2584 de -> 017a7e7a267a dsb -> aadebeccf5ba el -> 2d28a78dcef5 en-CA -> 55ad9171a9f0 en-GB -> 296422b495e9 en-ZA -> c1b5d2128914 eo -> c68e87667d9f es-AR -> bff0a788c711 es-CL -> 1d3efd2532ea es-ES -> 4d1feb70b0e2 es-MX -> fceda607d0f4 et -> 58a8262a0cc7 eu -> 7cebfd46208b fa -> cbc040d58476 ff -> 46f5aec275ea fi -> 235ab13d261e fr -> 8ee417b64f99

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsSupportsPrimitives_h__
#define nsSupportsPrimitives_h__

#include "mozilla/Attributes.h"

#include "nsISupportsPrimitives.h"
#include "nsCOMPtr.h"
#include "nsString.h"

class nsSupportsID final : public nsISupportsID
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSID

  nsSupportsID();

private:
  ~nsSupportsID() {}

  nsID* mData;
};

/***************************************************************************/

class nsSupportsCString final : public nsISupportsCString
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSCSTRING

  nsSupportsCString() {}

private:
  ~nsSupportsCString() {}

  nsCString mData;
};

/***************************************************************************/

class nsSupportsString final : public nsISupportsString
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSSTRING

  nsSupportsString() {}

private:
  ~nsSupportsString() {}

  nsString mData;
};

/***************************************************************************/

class nsSupportsPRBool final : public nsISupportsPRBool
{
public:
  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRBOOL

  nsSupportsPRBool();

private:
  ~nsSupportsPRBool() {}

  bool mData;
};

/***************************************************************************/

class nsSupportsPRUint8 final : public nsISupportsPRUint8
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRUINT8

  nsSupportsPRUint8();

private:
  ~nsSupportsPRUint8() {}

  uint8_t mData;
};

/***************************************************************************/

class nsSupportsPRUint16 final : public nsISupportsPRUint16
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRUINT16

  nsSupportsPRUint16();

private:
  ~nsSupportsPRUint16() {}

  uint16_t mData;
};

/***************************************************************************/

class nsSupportsPRUint32 final : public nsISupportsPRUint32
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRUINT32

  nsSupportsPRUint32();

private:
  ~nsSupportsPRUint32() {}

  uint32_t mData;
};

/***************************************************************************/

class nsSupportsPRUint64 final : public nsISupportsPRUint64
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRUINT64

  nsSupportsPRUint64();

private:
  ~nsSupportsPRUint64() {}

  uint64_t mData;
};

/***************************************************************************/

class nsSupportsPRTime final : public nsISupportsPRTime
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRTIME

  nsSupportsPRTime();

private:
  ~nsSupportsPRTime() {}

  PRTime mData;
};

/***************************************************************************/

class nsSupportsChar final : public nsISupportsChar
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSCHAR

  nsSupportsChar();

private:
  ~nsSupportsChar() {}

  char mData;
};

/***************************************************************************/

class nsSupportsPRInt16 final : public nsISupportsPRInt16
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRINT16

  nsSupportsPRInt16();

private:
  ~nsSupportsPRInt16() {}

  int16_t mData;
};

/***************************************************************************/

class nsSupportsPRInt32 final : public nsISupportsPRInt32
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRINT32

  nsSupportsPRInt32();

private:
  ~nsSupportsPRInt32() {}

  int32_t mData;
};

/***************************************************************************/

class nsSupportsPRInt64 final : public nsISupportsPRInt64
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSPRINT64

  nsSupportsPRInt64();

private:
  ~nsSupportsPRInt64() {}

  int64_t mData;
};

/***************************************************************************/

class nsSupportsFloat final : public nsISupportsFloat
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSFLOAT

  nsSupportsFloat();

private:
  ~nsSupportsFloat() {}

  float mData;
};

/***************************************************************************/

class nsSupportsDouble final : public nsISupportsDouble
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSDOUBLE

  nsSupportsDouble();

private:
  ~nsSupportsDouble() {}

  double mData;
};

/***************************************************************************/

class nsSupportsInterfacePointer final : public nsISupportsInterfacePointer
{
public:
  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSINTERFACEPOINTER

  nsSupportsInterfacePointer();

private:
  ~nsSupportsInterfacePointer();

  nsCOMPtr<nsISupports> mData;
  nsID* mIID;
};

/***************************************************************************/

/**
 * Wraps a static const char* buffer for use with nsISupportsCString
 *
 * Only use this class with static buffers, or arena-allocated buffers of
 * permanent lifetime!
 */
class nsSupportsDependentCString final : public nsISupportsCString
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIMITIVE
  NS_DECL_NSISUPPORTSCSTRING

  explicit nsSupportsDependentCString(const char* aStr);

private:
  ~nsSupportsDependentCString() {}

  nsDependentCString mData;
};

#endif /* nsSupportsPrimitives_h__ */