nsIClassInfo.idl 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * ***** BEGIN LICENSE BLOCK *****
  4. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. *
  6. * The contents of this file are subject to the Mozilla Public License Version
  7. * 1.1 (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. * http://www.mozilla.org/MPL/
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. *
  16. * The Original Code is Mozilla Communicator client code, released
  17. * March 31, 1998.
  18. *
  19. * The Initial Developer of the Original Code is
  20. * Netscape Communications Corporation.
  21. * Portions created by the Initial Developer are Copyright (C) 1998
  22. * the Initial Developer. All Rights Reserved.
  23. *
  24. * Contributor(s):
  25. * John Bandhauer <[email protected]>
  26. *
  27. * Alternatively, the contents of this file may be used under the terms of
  28. * either of the GNU General Public License Version 2 or later (the "GPL"),
  29. * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30. * in which case the provisions of the GPL or the LGPL are applicable instead
  31. * of those above. If you wish to allow use of your version of this file only
  32. * under the terms of either the GPL or the LGPL, and not to allow others to
  33. * use your version of this file under the terms of the MPL, indicate your
  34. * decision by deleting the provisions above and replace them with the notice
  35. * and other provisions required by the GPL or the LGPL. If you do not delete
  36. * the provisions above, a recipient may use your version of this file under
  37. * the terms of any one of the MPL, the GPL or the LGPL.
  38. *
  39. * ***** END LICENSE BLOCK ***** */
  40. #include "nsISupports.idl"
  41. #include "nsIProgrammingLanguage.idl"
  42. /**
  43. * Provides information about a specific implementation class
  44. * @status FROZEN
  45. */
  46. [scriptable, uuid(986c11d0-f340-11d4-9075-0010a4e73d9a)]
  47. interface nsIClassInfo : nsISupports
  48. {
  49. /**
  50. * Get an ordered list of the interface ids that instances of the class
  51. * promise to implement. Note that nsISupports is an implicit member
  52. * of any such list and need not be included.
  53. *
  54. * Should set *count = 0 and *array = null and return NS_OK if getting the
  55. * list is not supported.
  56. */
  57. void getInterfaces(out PRUint32 count,
  58. [array, size_is(count), retval] out nsIIDPtr array);
  59. /**
  60. * Get a language mapping specific helper object that may assist in using
  61. * objects of this class in a specific lanaguage. For instance, if asked
  62. * for the helper for nsIProgrammingLanguage::JAVASCRIPT this might return
  63. * an object that can be QI'd into the nsIXPCScriptable interface to assist
  64. * XPConnect in supplying JavaScript specific behavior to callers of the
  65. * instance object.
  66. *
  67. * see: nsIProgrammingLanguage.idl
  68. *
  69. * Should return null if no helper available for given language.
  70. */
  71. nsISupports getHelperForLanguage(in PRUint32 language);
  72. /**
  73. * A contract ID through which an instance of this class can be created
  74. * (or accessed as a service, if |flags & SINGLETON|), or null.
  75. */
  76. readonly attribute string contractID;
  77. /**
  78. * A human readable string naming the class, or null.
  79. */
  80. readonly attribute string classDescription;
  81. /**
  82. * A class ID through which an instance of this class can be created
  83. * (or accessed as a service, if |flags & SINGLETON|), or null.
  84. */
  85. readonly attribute nsCIDPtr classID;
  86. /**
  87. * Return language type from list in nsIProgrammingLanguage
  88. */
  89. readonly attribute PRUint32 implementationLanguage;
  90. /**
  91. * Bitflags for 'flags' attribute.
  92. */
  93. const PRUint32 SINGLETON = 1 << 0;
  94. const PRUint32 THREADSAFE = 1 << 1;
  95. const PRUint32 MAIN_THREAD_ONLY = 1 << 2;
  96. const PRUint32 DOM_OBJECT = 1 << 3;
  97. const PRUint32 PLUGIN_OBJECT = 1 << 4;
  98. const PRUint32 EAGER_CLASSINFO = 1 << 5;
  99. /**
  100. * 'flags' attribute bitflag: whether objects of this type implement
  101. * nsIContent.
  102. */
  103. const PRUint32 CONTENT_NODE = 1 << 6;
  104. // The high order bit is RESERVED for consumers of these flags.
  105. // No implementor of this interface should ever return flags
  106. // with this bit set.
  107. const PRUint32 RESERVED = 1 << 31;
  108. readonly attribute PRUint32 flags;
  109. /**
  110. * Also a class ID through which an instance of this class can be created
  111. * (or accessed as a service, if |flags & SINGLETON|). If the class does
  112. * not have a CID, it should return NS_ERROR_NOT_AVAILABLE. This attribute
  113. * exists so C++ callers can avoid allocating and freeing a CID, as would
  114. * happen if they used classID.
  115. */
  116. [notxpcom] readonly attribute nsCID classIDNoAlloc;
  117. };