/***************************************************************************
 *                          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 IOpenSaveService
 *   Service for processing open/save Z3D files.
 *--------------------------------------------------------------------------
 * @created: Thursday, December 04, 2003 17:47:54
 */

#if !defined(IOpenSaveService_h_included)
#define IOpenSaveService_h_included
//forward declaration of this class might require
namespace services
{ class IOpenSaveService; };
#include <zmodeler.h>
#include <core/coreTypes.h>
#include <services/zmServices.h>
#include <services/IService.h>
#include <core/io/ISerializeable.h>
#include <core/io/IStream.h>
#include <core/io/ISerialResolver.h>


namespace services
{
  
  class IOpenSaveService : public services::IService
  {
  public:
    /* Adds transient serializeable to declaration part. */
    virtual ZRESULT addTransientSerializeable(LPCTSTR pszClass, core::io::eReCreationMode mode=core::io::ERC_TRANSIENT_CLASS)=0;
    /* Adds persistent serializeable to declaration part. */
    virtual ZRESULT addPersistentSerializeable(core::io::ISerializeable* pSerial, bool bHold=true)=0;
    virtual ZRESULT addResolveableSerializeable(core::io::ISerializeable* pSerial, LPCTSTR pszName)=0;
    virtual DWORD getUnknownID(ZUnknown* pUnk)=0;
    virtual ZUnknown* getIDUnknown(const DWORD dwID)=0;
    virtual ZRESULT setIDUnknown(const DWORD dwID, ZUnknown* pUnk)=0;
    virtual ZRESULT save(core::io::IStream* pStream)=0;
    /* Performs open operation. Note, if bMerge is true, mergine is performed.
     * Certain merge parameters are taken from profile:
     * Services\Configuration\General\Files\Merge Collisions
     *   - Nodes
     *   - Materials
     *   - Animation Track
     *           (0=use scene, 1=use merged, 2=autoresolve (rename)) */
    virtual ZRESULT open(core::io::IStream* pStream, bool bMerge=false)=0;
    virtual ZRESULT addSerialResolver(core::io::ISerialResolver* pResolver)=0;
    virtual ZRESULT getCurrentFile(ZString& strPath, ZString& strName)=0;
    virtual ZRESULT setCurrentFile(LPCTSTR pszPath, LPCTSTR pszName)=0;
  
  };//class IOpenSaveService
};//services

#endif
