nsrootidl.idl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* -*- Mode: IDL; 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
  4. *
  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/
  9. *
  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.
  14. *
  15. * The Original Code is mozilla.org code.
  16. *
  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.
  21. *
  22. * Contributor(s):
  23. * Dan Rosen <[email protected]>
  24. *
  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.
  36. *
  37. * ***** END LICENSE BLOCK ***** */
  38. /**
  39. * Root idl declarations to be used by all.
  40. * @status FROZEN
  41. */
  42. %{C++
  43. #include "nscore.h"
  44. #include "prtime.h"
  45. /*
  46. * Forward declarations for new string types
  47. */
  48. class nsAString;
  49. class nsACString;
  50. /*
  51. * Start commenting out the C++ versions of the below in the output header
  52. */
  53. #if 0
  54. %}
  55. typedef boolean PRBool ;
  56. typedef octet PRUint8 ;
  57. typedef unsigned short PRUint16 ;
  58. typedef unsigned short PRUnichar;
  59. typedef unsigned long PRUint32 ;
  60. typedef unsigned long long PRUint64 ;
  61. typedef unsigned long long PRTime ;
  62. typedef short PRInt16 ;
  63. typedef long PRInt32 ;
  64. typedef long long PRInt64 ;
  65. typedef unsigned long nsrefcnt ;
  66. typedef unsigned long nsresult ;
  67. // XXX need this built into xpidl compiler so that it's really size_t or PRSize
  68. // and it's scriptable:
  69. typedef unsigned long size_t;
  70. [ptr] native voidPtr(void);
  71. [ptr] native charPtr(char);
  72. [ptr] native unicharPtr(PRUnichar);
  73. [ref, nsid] native nsIDRef(nsID);
  74. [ref, nsid] native nsIIDRef(nsIID);
  75. [ref, nsid] native nsCIDRef(nsCID);
  76. [ptr, nsid] native nsIDPtr(nsID);
  77. [ptr, nsid] native nsIIDPtr(nsIID);
  78. [ptr, nsid] native nsCIDPtr(nsCID);
  79. // NOTE: Be careful in using the following 3 types. The *Ref and *Ptr variants
  80. // are more commonly used (and better supported). Those variants require
  81. // nsMemory alloc'd copies when used as 'out' params while these types do not.
  82. // However, currently these types can not be used for 'in' params. And, methods
  83. // that use them as 'out' params *must* be declared [notxpcom] (with an explicit
  84. // return type of nsresult). This makes such methods implicitly not scriptable.
  85. // Use of these types in methods without a [notxpcom] declaration will cause
  86. // the xpidl compiler to raise an error.
  87. // See: http://bugzilla.mozilla.org/show_bug.cgi?id=93792
  88. [nsid] native nsIID(nsIID);
  89. [nsid] native nsID(nsID);
  90. [nsid] native nsCID(nsCID);
  91. [ptr] native nsQIResult(void);
  92. [ref, domstring] native DOMString(ignored);
  93. [ref, domstring] native DOMStringRef(ignored);
  94. [ptr, domstring] native DOMStringPtr(ignored);
  95. [ref, utf8string] native AUTF8String(ignored);
  96. [ref, utf8string] native AUTF8StringRef(ignored);
  97. [ptr, utf8string] native AUTF8StringPtr(ignored);
  98. [ref, cstring] native ACString(ignored);
  99. [ref, cstring] native ACStringRef(ignored);
  100. [ptr, cstring] native ACStringPtr(ignored);
  101. [ref, astring] native AString(ignored);
  102. [ref, astring] native AStringRef(ignored);
  103. [ptr, astring] native AStringPtr(ignored);
  104. %{C++
  105. /*
  106. * End commenting out the C++ versions of the above in the output header
  107. */
  108. #endif
  109. %}