using System;
using System.Collections.Generic;
using System.Text;
using Umbraco.Core;

namespace umbraco.editorControls.tinymce
{
	public class TinyMCEDataType : umbraco.cms.businesslogic.datatype.BaseDataType, umbraco.interfaces.IDataType
	{
		private umbraco.interfaces.IDataEditor _Editor;
		private umbraco.interfaces.IData _baseData;
		private umbraco.interfaces.IDataPrevalue _prevalueeditor;

		public override umbraco.interfaces.IDataEditor DataEditor
		{
			get
			{
				if (_Editor == null)
                    _Editor = new TinyMCELegacyControl();
				return _Editor;
			}
		}

		public override umbraco.interfaces.IData Data
		{
			get
			{
				if (_baseData == null)
					_baseData = new cms.businesslogic.datatype.DefaultData(this);
				return _baseData;
			}
		}
		public override Guid Id
		{
			get { return new Guid(Constants.PropertyEditors.TinyMCE); }
		}

		public override string DataTypeName
		{
			get { return "TinyMCE wysiwyg (Obsolete, upgrade to tinymce v3!)"; }
		}

		public override umbraco.interfaces.IDataPrevalue PrevalueEditor
		{
			get
			{
                if (_prevalueeditor == null)
					_prevalueeditor = new TinyMCELegacyControl();
				return _prevalueeditor;
			}
		}
	}
}
