// XmlProjectIcons.h: interface for the CXmlProjectIcons class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(_XMLPROJECTICONS_H_)
#define _XMLPROJECTICONS_H_

#include <map>
#include "XmlSerializable.h"
#include "XmlIcon.h"

using namespace std;

typedef map<cmString, CXmlIcon*> IconMap;

class CXmlProjectIcons : public CXmlSerializable  
{
public:
	CXmlProjectIcons();
	virtual ~CXmlProjectIcons();

	// implementation of CXmlSerializable
	//
public:
	virtual bool BuildFromXml(IXMLDOMNode* node);
	virtual bool AppendToDOMDocument(IXMLDOMDocument2* xmlDoc, IXMLDOMElement* parentElement);

	cmString GetIconKey(const cmString& iconFileName);
	IconMap* GetIconList();
	CXmlIcon* AddIcon(const cmString& iconFileName);
	void RemoveIcon(const cmString& iconFileName);
	void Clear();
	void SetDefaults();

	static cmString GetXmlNodeName(){return _T("ProjectIcons");}

	CXmlIcon* GetIcon(const cmString& name);

protected:
	
	cmString GetNewKey();

	IconMap icons_;
	int keyCounter_;
};

#endif // !defined(_XMLPROJECTICONS_H_)