// XmlMemberInfo.h: interface for the CXmlMemberInfo class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(_XMLMEMBERINFO_H_)
#define _XMLMEMBERINFO_H_



#include <set>

#include "XmlBaseElement.h"
#include "XmlMemberValidation.h"
#include "XmlMemberGui_Long.h"
#include "XmlMemberGui_String.h"
#include "XmlMemberGui_Double.h"
#include "XmlMemberGui_Boolean.h"

using namespace std;

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

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

	
	// get/set methods for validation rules
	//
	CXmlMemberValidation* GetValidationInfo();
	CXmlMemberGui_Long* GetLongMemberGuiInfo();
	CXmlMemberGui_String* GetStringMemberGuiInfo();
	CXmlMemberGui_Double* GetDoubleMemberGuiInfo();
	CXmlMemberGui_Boolean* GetBooleanMemberGuiInfo();

	enPersistenceMode GetPersistenceMode() const;
	void SetPersistenceMode(enPersistenceMode persistenceMode);

	int GetDecimalPlaces() const;
	void SetDecimalPlaces(int decimalPlaces);

	int GetDigitPlaces() const;
	void SetDigitPlaces(int digitPlaces);

	int GetMaxChar() const;
	void SetMaxChar(int maxChar);

	cmString GetCaption() const; 
	void SetCaption(const cmString& caption);

	bool GetMultilineString() const;
	void SetMultilineString(bool multilineString);

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

	bool IsHidden();

	void SetReadOnly(bool readOnly);
	bool IsReadOnly() const;

protected:
	
	// general
	//
	cmString caption_;

	// validation rules
	//
	CXmlMemberValidation validationInfo_;		// validation mode used by the element
	CXmlMemberGui_Long longMemberGui_;			// display mode for "long" (dataType) members
	CXmlMemberGui_String stringMemberGui_;		// display mode for "string" (dataType) members
	CXmlMemberGui_Double doubleMemberGui_;		// display mode for "double" (dataType) members
	CXmlMemberGui_Boolean booleanMemberGui_;	// display mode for "boolean" (dataType) members
	
	enPersistenceMode persistenceMode_;			// specifiy how the member persists
	
	// format info
	//
	int decimalPlaces_;						// number of digit used for floating point values
	int digitPlaces_;
	int maxChar_;							// maximum number of characters for String values
	bool multilineString_;					// if dataType is enDataType_String specifies if multiline
	bool readOnly_;
};

#endif // !defined(_XMLMEMBERINFO_H_)
