1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/m-beta-lnx-codecoverage/build/netwerk/base/public/nsICryptoHash.idl
3 : */
4 :
5 : #ifndef __gen_nsICryptoHash_h__
6 : #define __gen_nsICryptoHash_h__
7 :
8 :
9 : #ifndef __gen_nsISupports_h__
10 : #include "nsISupports.h"
11 : #endif
12 :
13 : /* For IDL files that don't want to include root IDL files. */
14 : #ifndef NS_NO_VTABLE
15 : #define NS_NO_VTABLE
16 : #endif
17 : class nsIInputStream; /* forward declaration */
18 :
19 :
20 : /* starting interface: nsICryptoHash */
21 : #define NS_ICRYPTOHASH_IID_STR "1e5b7c43-4688-45ce-92e1-77ed931e3bbe"
22 :
23 : #define NS_ICRYPTOHASH_IID \
24 : {0x1e5b7c43, 0x4688, 0x45ce, \
25 : { 0x92, 0xe1, 0x77, 0xed, 0x93, 0x1e, 0x3b, 0xbe }}
26 :
27 1466 : class NS_NO_VTABLE NS_SCRIPTABLE nsICryptoHash : public nsISupports {
28 : public:
29 :
30 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICRYPTOHASH_IID)
31 :
32 : enum {
33 : MD2 = 1,
34 : MD5 = 2,
35 : SHA1 = 3,
36 : SHA256 = 4,
37 : SHA384 = 5,
38 : SHA512 = 6
39 : };
40 :
41 : /* void init (in unsigned long aAlgorithm); */
42 : NS_SCRIPTABLE NS_IMETHOD Init(PRUint32 aAlgorithm) = 0;
43 :
44 : /* void initWithString (in ACString aAlgorithm); */
45 : NS_SCRIPTABLE NS_IMETHOD InitWithString(const nsACString & aAlgorithm) = 0;
46 :
47 : /* void update ([array, size_is (aLen), const] in octet aData, in unsigned long aLen); */
48 : NS_SCRIPTABLE NS_IMETHOD Update(const PRUint8 *aData, PRUint32 aLen) = 0;
49 :
50 : /* void updateFromStream (in nsIInputStream aStream, in unsigned long aLen); */
51 : NS_SCRIPTABLE NS_IMETHOD UpdateFromStream(nsIInputStream *aStream, PRUint32 aLen) = 0;
52 :
53 : /* ACString finish (in boolean aASCII); */
54 : NS_SCRIPTABLE NS_IMETHOD Finish(bool aASCII, nsACString & _retval NS_OUTPARAM) = 0;
55 :
56 : };
57 :
58 : NS_DEFINE_STATIC_IID_ACCESSOR(nsICryptoHash, NS_ICRYPTOHASH_IID)
59 :
60 : /* Use this macro when declaring classes that implement this interface. */
61 : #define NS_DECL_NSICRYPTOHASH \
62 : NS_SCRIPTABLE NS_IMETHOD Init(PRUint32 aAlgorithm); \
63 : NS_SCRIPTABLE NS_IMETHOD InitWithString(const nsACString & aAlgorithm); \
64 : NS_SCRIPTABLE NS_IMETHOD Update(const PRUint8 *aData, PRUint32 aLen); \
65 : NS_SCRIPTABLE NS_IMETHOD UpdateFromStream(nsIInputStream *aStream, PRUint32 aLen); \
66 : NS_SCRIPTABLE NS_IMETHOD Finish(bool aASCII, nsACString & _retval NS_OUTPARAM);
67 :
68 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
69 : #define NS_FORWARD_NSICRYPTOHASH(_to) \
70 : NS_SCRIPTABLE NS_IMETHOD Init(PRUint32 aAlgorithm) { return _to Init(aAlgorithm); } \
71 : NS_SCRIPTABLE NS_IMETHOD InitWithString(const nsACString & aAlgorithm) { return _to InitWithString(aAlgorithm); } \
72 : NS_SCRIPTABLE NS_IMETHOD Update(const PRUint8 *aData, PRUint32 aLen) { return _to Update(aData, aLen); } \
73 : NS_SCRIPTABLE NS_IMETHOD UpdateFromStream(nsIInputStream *aStream, PRUint32 aLen) { return _to UpdateFromStream(aStream, aLen); } \
74 : NS_SCRIPTABLE NS_IMETHOD Finish(bool aASCII, nsACString & _retval NS_OUTPARAM) { return _to Finish(aASCII, _retval); }
75 :
76 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
77 : #define NS_FORWARD_SAFE_NSICRYPTOHASH(_to) \
78 : NS_SCRIPTABLE NS_IMETHOD Init(PRUint32 aAlgorithm) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aAlgorithm); } \
79 : NS_SCRIPTABLE NS_IMETHOD InitWithString(const nsACString & aAlgorithm) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithString(aAlgorithm); } \
80 : NS_SCRIPTABLE NS_IMETHOD Update(const PRUint8 *aData, PRUint32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->Update(aData, aLen); } \
81 : NS_SCRIPTABLE NS_IMETHOD UpdateFromStream(nsIInputStream *aStream, PRUint32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->UpdateFromStream(aStream, aLen); } \
82 : NS_SCRIPTABLE NS_IMETHOD Finish(bool aASCII, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Finish(aASCII, _retval); }
83 :
84 : #if 0
85 : /* Use the code below as a template for the implementation class for this interface. */
86 :
87 : /* Header file */
88 : class nsCryptoHash : public nsICryptoHash
89 : {
90 : public:
91 : NS_DECL_ISUPPORTS
92 : NS_DECL_NSICRYPTOHASH
93 :
94 : nsCryptoHash();
95 :
96 : private:
97 : ~nsCryptoHash();
98 :
99 : protected:
100 : /* additional members */
101 : };
102 :
103 : /* Implementation file */
104 : NS_IMPL_ISUPPORTS1(nsCryptoHash, nsICryptoHash)
105 :
106 : nsCryptoHash::nsCryptoHash()
107 : {
108 : /* member initializers and constructor code */
109 : }
110 :
111 : nsCryptoHash::~nsCryptoHash()
112 : {
113 : /* destructor code */
114 : }
115 :
116 : /* void init (in unsigned long aAlgorithm); */
117 : NS_IMETHODIMP nsCryptoHash::Init(PRUint32 aAlgorithm)
118 : {
119 : return NS_ERROR_NOT_IMPLEMENTED;
120 : }
121 :
122 : /* void initWithString (in ACString aAlgorithm); */
123 : NS_IMETHODIMP nsCryptoHash::InitWithString(const nsACString & aAlgorithm)
124 : {
125 : return NS_ERROR_NOT_IMPLEMENTED;
126 : }
127 :
128 : /* void update ([array, size_is (aLen), const] in octet aData, in unsigned long aLen); */
129 : NS_IMETHODIMP nsCryptoHash::Update(const PRUint8 *aData, PRUint32 aLen)
130 : {
131 : return NS_ERROR_NOT_IMPLEMENTED;
132 : }
133 :
134 : /* void updateFromStream (in nsIInputStream aStream, in unsigned long aLen); */
135 : NS_IMETHODIMP nsCryptoHash::UpdateFromStream(nsIInputStream *aStream, PRUint32 aLen)
136 : {
137 : return NS_ERROR_NOT_IMPLEMENTED;
138 : }
139 :
140 : /* ACString finish (in boolean aASCII); */
141 : NS_IMETHODIMP nsCryptoHash::Finish(bool aASCII, nsACString & _retval NS_OUTPARAM)
142 : {
143 : return NS_ERROR_NOT_IMPLEMENTED;
144 : }
145 :
146 : /* End of implementation class template. */
147 : #endif
148 :
149 :
150 : #endif /* __gen_nsICryptoHash_h__ */
|