// CXmlFormItem_TextBox.cpp
//

#include "stdafx.h"
#include "XmlFormItem_TextBox.h"

CXmlFormItem_TextBox::CXmlFormItem_TextBox()
{}

CXmlFormItem_TextBox::~CXmlFormItem_TextBox()
{}

bool CXmlFormItem_TextBox::BuildFromXml(IXMLDOMNode* node)
{
	/***
	USES_CONVERSION;

	CXMLDOMNode childNode;
	CXMLDOMNodeList children;
	wstring nodeName;

	children = node.GetChildNodes();
	
	for (long i = 0; i < children.GetLength(); i++) {
		childNode = children.GetItem(i);
	
		nodeName = childNode.GetNodeName();

		if (nodeName == _T("formItem")) {
			CXmlBaseFormItem::BuildFromXml(childNode);
		} else if (nodeName == _T("text")) {
			text_ = childNode.GetNodeTypedValue().bstrVal;
		}
	}
	***/
	return true;
}

bool CXmlFormItem_TextBox::AppendToDOMDocument(IXMLDOMDocument2* xmlDoc, IXMLDOMElement* parentElement)
{
	/***
	CXMLDOMElement newElement;
	CXMLDOMElement rectElement;
	CXMLDOMElement member;

	newElement = xmlDoc.CreateElement(GetXmlNodeName().c_str());

	AppendMemberNode(_T("text"), text_, newElement, xmlDoc);

	CXmlBaseFormItem::AppendToDOMDocument(xmlDoc, newElement, parentIsValid),

	parentElement.AppendChild(newElement);
	***/

	return true;
}

void CXmlFormItem_TextBox::SetText(const wstring& text)
{
	text_ = text;
}

wstring CXmlFormItem_TextBox::GetText()
{
	return text_;
}

enFormItemType CXmlFormItem_TextBox::GetItemType()
{
	return enFormItemType_TextBox; 
}
	
