1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
8 interface nsIObjectInputStream
;
9 interface nsIObjectOutputStream
;
11 [scriptable
, uuid(91cca981
-c26d
-44a8
-bebe
-d9ed4891503a
)]
12 interface nsISerializable
: nsISupports
15 * Initialize the object implementing nsISerializable, which must have
16 * been freshly constructed via CreateInstance. All data members that
17 * can't be set to default values must have been serialized by write,
18 * and should be read from aInputStream in the same order by this method.
20 void read
(in nsIObjectInputStream aInputStream
);
23 * Serialize the object implementing nsISerializable to aOutputStream, by
24 * writing each data member that must be recovered later to reconstitute
25 * a working replica of this object, in a canonical member and byte order,
28 * NB: a class that implements nsISerializable *must* also implement
29 * nsIClassInfo, in particular nsIClassInfo::GetClassID.
31 void write
(in nsIObjectOutputStream aOutputStream
);