// XmlClassCardinality.h: interface for the CXmlClassCardinality class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(_XMLCLASSCARDINALITY_H_)
#define _XMLCLASSCARDINALITY_H_

#include "XmlBaseElement.h"
#include "enums.h"
#include <string>

using namespace std;

class CXmlClassCardinality : public CXmlBaseElement  
{
public:
	CXmlClassCardinality();
	virtual ~CXmlClassCardinality();

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

	void SetCardinality(enCardinality cardinality);
	enCardinality GetCardinality();

	void SetArrayMinSize(int minSize);
	int GetArrayMinSize();

	void SetArrayMaxSize(int maxSize);
	int GetArrayMaxSize();

	void SetMapMinSize(int minSize);
	int GetMapMinSize();

	void SetMapMaxSize(int maxSize);
	int GetMapMaxSize();

	void SetMapSortKey(const cmString& sortKey);
	cmString GetMapSortKey();

	void SetMapInterfaceGuid(const cmString& guid);
	cmString GetMapInterfaceGuid() const;

	void SetMapClassGuid(const cmString& guid);
	cmString GetMapClassGuid() const;

	void SetArrayInterfaceGuid(const cmString& guid);
	cmString GetArrayInterfaceGuid() const;

	void SetArrayClassGuid(const cmString& guid);
	cmString GetArrayClassGuid() const;

	void SetDisplayToolbar(bool displayToolbar);
	bool GetDisplayToolbar() const;

	void SetUseContainerNode(bool use);
	bool GetUseContainerNode() const;

	virtual cmString GetXmlNodeName(){return _T("Cardinality");}
	
	void Clear();

protected:

	void SetDefaults();
	
	enCardinality cardinality_;

	int arrayMinSize_;
	int arrayMaxSize_;

	int mapMinSize_;
	int mapMaxSize_;
	cmString mapSortKey_;

	cmString mapInterfaceGuid_;
	cmString arrayInterfaceGuid_;

	cmString mapClassGuid_;
	cmString arrayClassGuid_;

	bool displayToolbar_;
	bool useContainerNode_;
};

#endif // !defined(_XMLCLASSCARDINALITY_H_)
