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