/***************************************************************************
 *                          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 IFileInfo
 *   Interface for storing per-file information. This can be queried from IOpenSaveService
 *   for currently opened file. No file_info support for non-opened files available.
 *--------------------------------------------------------------------------
 * @created: Monday, September 06, 2004 15:03:29
 */

#if !defined(IFileInfo_h_included)
#define IFileInfo_h_included
//forward declaration of this class might require
namespace core
{ namespace io
  { class IFileInfo; }; };
#include <zmodeler.h>
#include <core/io/zmIOTypes.h>

namespace core
{
  namespace io
  {
    struct tFileInfo
    {
      ZString     m_strName;
      ZString     m_strValue;
      bool        m_bEditable;
      tFileInfo() {m_bEditable = true;}
      tFileInfo(LPCTSTR pszName, LPCTSTR pszValue, bool b)
      {
        m_strName   = pszName;
        m_strValue  = pszValue;
        m_bEditable = b;
      }
    };
    typedef ZSequence<tFileInfo> tFileInfoSeq;
    
    class IFileInfo : public ZUnknown
    {
    public:
      virtual ZRESULT enumInfoValues(tFileInfoSeq& seqInfo)=0;
      virtual ZRESULT addInfoValue(LPCTSTR pszName, LPCTSTR pszValue, bool bEditable)=0;
      virtual ZRESULT getInfoValue(LPCTSTR pszName, ZString& strValue, bool& bEditable)=0;
      /* pass NULL in pszValue to remove this value */
      virtual ZRESULT setInfoValue(LPCTSTR pszName, LPCTSTR pszValue)=0;
    
    };//class IFileInfo
  };//io
};//core

#endif
