/***************************************************************************
 *                          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 IMaterialsService
 *   Service that holds and managers all materials in the scene
 *--------------------------------------------------------------------------
 * @created: Wednesday, May 28, 2003 19:08:25
 */

#if !defined(IMaterialsService_h_included)
#define IMaterialsService_h_included
//forward declaration of this class might require
namespace services
{ class IMaterialsService; };
#include <zmodeler.h>
#include <core/coreTypes.h>
#include <services/zmServices.h>
#include <services/IService.h>
#include <rend/IMaterial.h>
#include <core/layout/IChildDialog.h>


namespace services
{
  
  class IMaterialsService : public services::IService
  {
  public:
    virtual long getCount(void)=0;
    virtual ZRESULT getMaterial(long nIndex, rend::IMaterial** ppMat)=0;
    virtual ZRESULT setMaterial(long nIndex, rend::IMaterial* pMaterial)=0;
    virtual ZRESULT showMaterialEditor(long nInitialMaterial=0, bool bAllowAssign=true, bool bAllowEdit=true, bool bAllowSelectAnother=true)=0;
    virtual ZRESULT addEditorExtension(core::layout::IChildDialog* pDialog)=0;
    virtual ZRESULT findMaterialByName(ZString strName, rend::IMaterial** pMaterial, long* pMatIndex)=0;
    /* Creates material. You can specify class name of new material,
     * or material class will be taken from current ICompatibilityInfo.
     * You can also specify whether it's needed to add created material
     * into a set of materials. */
    virtual ZRESULT createMaterial(rend::IMaterial** ppMat, LPCTSTR pszClass=NULL, bool bAddIt=false)=0;
    virtual ZRESULT deleteMaterial(long nIndex)=0;
    virtual ZRESULT insertMaterial(rend::IMaterial* pMaterial, long nIndex=-1)=0;
    virtual ZRESULT addMaterialClass(LPCTSTR pszClassName, LPCTSTR pszTitle, LPCTSTR pszDesc=NULL)=0;
    virtual ZRESULT getMaterialClass(LPCTSTR pszClass, ZString& strTitle, ZString& strDesc)=0;
    virtual ZRESULT enumMaterialClasses(ZStringSeq& seqNames)=0;
  
  };//class IMaterialsService
};//services

#endif
