/***************************************************************************
 *                          Zanoza Modeler v2.x                            *
 *      This is unpublished propietary source code of Zanoza Software.     *
 *      The copyright notice does not evidence any actual or intended      *
 *                    publication of such source code.                     *
 *                                                                         *
 *                Copyright (c) 2002-2008 Zanoza Software.                 *
 *                                                                         *
 *                        All rights reserved.                             *
 ***************************************************************************
 *--------------------------------------------------------------------------
 * @author:   Oleg Melashenko
 *--------------------------------------------------------------------------
 * @purpose:  Declaration of the class ISerializeable
 *   Interface for storing and loding data to/from the stream
 *--------------------------------------------------------------------------
 * @created: Friday, January 03, 2003 13:49:22
 */

#if !defined(ISerializeable_h_included)
#define ISerializeable_h_included
//forward declaration of this class might require
namespace core
{ namespace io
  { class ISerializeable; class CSerializeableCol; }; };
#include <zmodeler.h>
#include <core/io/zmIOTypes.h>
#include <core/io/IStream.h>
#include <services/IOpenSaveService.h>


namespace core
{
  namespace io
  {
    
    class ISerializeable : public ZUnknown
    {
    public:
      /* Saves declaration part of interface, used to re-create the instance. */
      virtual ZRESULT saveDeclaration(core::io::IStream* pStream, services::IOpenSaveService* pSrv, LPCTSTR pszResolver=NULL)=0;
      virtual ZRESULT saveData(core::io::IStream* pStream, DWORD dwID, services::IOpenSaveService* pSrv)=0;
      virtual ZRESULT loadData(core::io::IStream* pStream, services::IOpenSaveService* pSrv, DWORD dwSize, DWORD dwVersion=0, bool bMerge=false)=0;
      virtual ZRESULT getReCreationMode(core::io::eReCreationMode& mode)=0;
    
    };//class ISerializeable
    
    //
    // collection template
    //
    class CSerializeableCol : public ZUnknown,
        public ZIntrCollection<ISerializeable>
    {
    public:
      INTERFACE_FUNCTIONS_DEFAULT(CSerializeableCol)
    };//class CSerializeableCol
  };//io
};//core

#endif
