Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIObjectOutputStream.idl
3 : */
4 :
5 : #ifndef __gen_nsIObjectOutputStream_h__
6 : #define __gen_nsIObjectOutputStream_h__
7 :
8 :
9 : #ifndef __gen_nsIBinaryOutputStream_h__
10 : #include "nsIBinaryOutputStream.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 :
18 : /* starting interface: nsIObjectOutputStream */
19 : #define NS_IOBJECTOUTPUTSTREAM_IID_STR "92c898ac-5fde-4b99-87b3-5d486422094b"
20 :
21 : #define NS_IOBJECTOUTPUTSTREAM_IID \
22 : {0x92c898ac, 0x5fde, 0x4b99, \
23 : { 0x87, 0xb3, 0x5d, 0x48, 0x64, 0x22, 0x09, 0x4b }}
24 :
25 4 : class NS_NO_VTABLE nsIObjectOutputStream : public nsIBinaryOutputStream {
26 : public:
27 :
28 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBJECTOUTPUTSTREAM_IID)
29 :
30 : /* void writeObject (in nsISupports aObject, in boolean aIsStrongRef); */
31 : NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) = 0;
32 :
33 : /* void writeSingleRefObject (in nsISupports aObject); */
34 : NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) = 0;
35 :
36 : /* void writeCompoundObject (in nsISupports aObject, in nsIIDRef aIID, in boolean aIsStrongRef); */
37 : NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) = 0;
38 :
39 : /* void writeID (in nsIDRef aID); */
40 : NS_IMETHOD WriteID(const nsID & aID) = 0;
41 :
42 : /* [notxpcom] charPtr getBuffer (in uint32_t aLength, in uint32_t aAlignMask); */
43 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) = 0;
44 :
45 : /* [notxpcom] void putBuffer (in charPtr aBuffer, in uint32_t aLength); */
46 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) = 0;
47 :
48 : };
49 :
50 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIObjectOutputStream, NS_IOBJECTOUTPUTSTREAM_IID)
51 :
52 : /* Use this macro when declaring classes that implement this interface. */
53 : #define NS_DECL_NSIOBJECTOUTPUTSTREAM \
54 : NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) override; \
55 : NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) override; \
56 : NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) override; \
57 : NS_IMETHOD WriteID(const nsID & aID) override; \
58 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \
59 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) override;
60 :
61 : /* Use this macro when declaring the members of this interface when the
62 : class doesn't implement the interface. This is useful for forwarding. */
63 : #define NS_DECL_NON_VIRTUAL_NSIOBJECTOUTPUTSTREAM \
64 : nsresult WriteObject(nsISupports *aObject, bool aIsStrongRef); \
65 : nsresult WriteSingleRefObject(nsISupports *aObject); \
66 : nsresult WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef); \
67 : nsresult WriteID(const nsID & aID); \
68 : nsresult_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask); \
69 : nsresult_(void) PutBuffer(char *aBuffer, uint32_t aLength);
70 :
71 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
72 : #define NS_FORWARD_NSIOBJECTOUTPUTSTREAM(_to) \
73 : NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) override { return _to WriteObject(aObject, aIsStrongRef); } \
74 : NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) override { return _to WriteSingleRefObject(aObject); } \
75 : NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) override { return _to WriteCompoundObject(aObject, aIID, aIsStrongRef); } \
76 : NS_IMETHOD WriteID(const nsID & aID) override { return _to WriteID(aID); } \
77 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override { return _to GetBuffer(aLength, aAlignMask); } \
78 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) override { return _to PutBuffer(aBuffer, aLength); }
79 :
80 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
81 : #define NS_FORWARD_SAFE_NSIOBJECTOUTPUTSTREAM(_to) \
82 : NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteObject(aObject, aIsStrongRef); } \
83 : NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteSingleRefObject(aObject); } \
84 : NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteCompoundObject(aObject, aIID, aIsStrongRef); } \
85 : NS_IMETHOD WriteID(const nsID & aID) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteID(aID); } \
86 : NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \
87 : NS_IMETHOD_(void) PutBuffer(char *aBuffer, uint32_t aLength) override;
88 :
89 : #if 0
90 : /* Use the code below as a template for the implementation class for this interface. */
91 :
92 : /* Header file */
93 : class nsObjectOutputStream : public nsIObjectOutputStream
94 : {
95 : public:
96 : NS_DECL_ISUPPORTS
97 : NS_DECL_NSIOBJECTOUTPUTSTREAM
98 :
99 : nsObjectOutputStream();
100 :
101 : private:
102 : ~nsObjectOutputStream();
103 :
104 : protected:
105 : /* additional members */
106 : };
107 :
108 : /* Implementation file */
109 : NS_IMPL_ISUPPORTS(nsObjectOutputStream, nsIObjectOutputStream)
110 :
111 : nsObjectOutputStream::nsObjectOutputStream()
112 : {
113 : /* member initializers and constructor code */
114 : }
115 :
116 : nsObjectOutputStream::~nsObjectOutputStream()
117 : {
118 : /* destructor code */
119 : }
120 :
121 : /* void writeObject (in nsISupports aObject, in boolean aIsStrongRef); */
122 : NS_IMETHODIMP nsObjectOutputStream::WriteObject(nsISupports *aObject, bool aIsStrongRef)
123 : {
124 : return NS_ERROR_NOT_IMPLEMENTED;
125 : }
126 :
127 : /* void writeSingleRefObject (in nsISupports aObject); */
128 : NS_IMETHODIMP nsObjectOutputStream::WriteSingleRefObject(nsISupports *aObject)
129 : {
130 : return NS_ERROR_NOT_IMPLEMENTED;
131 : }
132 :
133 : /* void writeCompoundObject (in nsISupports aObject, in nsIIDRef aIID, in boolean aIsStrongRef); */
134 : NS_IMETHODIMP nsObjectOutputStream::WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef)
135 : {
136 : return NS_ERROR_NOT_IMPLEMENTED;
137 : }
138 :
139 : /* void writeID (in nsIDRef aID); */
140 : NS_IMETHODIMP nsObjectOutputStream::WriteID(const nsID & aID)
141 : {
142 : return NS_ERROR_NOT_IMPLEMENTED;
143 : }
144 :
145 : /* [notxpcom] charPtr getBuffer (in uint32_t aLength, in uint32_t aAlignMask); */
146 : NS_IMETHODIMP_(char *) nsObjectOutputStream::GetBuffer(uint32_t aLength, uint32_t aAlignMask)
147 : {
148 : return NS_ERROR_NOT_IMPLEMENTED;
149 : }
150 :
151 : /* [notxpcom] void putBuffer (in charPtr aBuffer, in uint32_t aLength); */
152 : NS_IMETHODIMP_(void) nsObjectOutputStream::PutBuffer(char *aBuffer, uint32_t aLength)
153 : {
154 : return NS_ERROR_NOT_IMPLEMENTED;
155 : }
156 :
157 : /* End of implementation class template. */
158 : #endif
159 :
160 :
161 : inline nsresult
162 : NS_WriteOptionalObject(nsIObjectOutputStream* aStream, nsISupports* aObject,
163 : bool aIsStrongRef)
164 : {
165 : bool nonnull = (aObject != nullptr);
166 : nsresult rv = aStream->WriteBoolean(nonnull);
167 : if (NS_SUCCEEDED(rv) && nonnull)
168 : rv = aStream->WriteObject(aObject, aIsStrongRef);
169 : return rv;
170 : }
171 : inline nsresult
172 : NS_WriteOptionalSingleRefObject(nsIObjectOutputStream* aStream,
173 : nsISupports* aObject)
174 : {
175 : bool nonnull = (aObject != nullptr);
176 : nsresult rv = aStream->WriteBoolean(nonnull);
177 : if (NS_SUCCEEDED(rv) && nonnull)
178 : rv = aStream->WriteSingleRefObject(aObject);
179 : return rv;
180 : }
181 : inline nsresult
182 3 : NS_WriteOptionalCompoundObject(nsIObjectOutputStream* aStream,
183 : nsISupports* aObject,
184 : const nsIID& aIID,
185 : bool aIsStrongRef)
186 : {
187 3 : bool nonnull = (aObject != nullptr);
188 3 : nsresult rv = aStream->WriteBoolean(nonnull);
189 3 : if (NS_SUCCEEDED(rv) && nonnull)
190 1 : rv = aStream->WriteCompoundObject(aObject, aIID, aIsStrongRef);
191 3 : return rv;
192 : }
193 :
194 : #endif /* __gen_nsIObjectOutputStream_h__ */
|