//
//	Copyright © 2006 Nemetschek North America 
//	All Rights Reserved.
//
// Created by Vladislav Stanev

#pragma once

namespace VWFC
{
	using namespace Tools;
	
	namespace VWObjects
	{
		class VWRecordObj : public VWObject
		{
		public:
								VWRecordObj(MCObjectHandle hRecordHandle);
								VWRecordObj(MCObjectHandle hFormat, MCObjectHandle hObject, bool bUseExistingRecord=true);
								VWRecordObj(const VWRecordObj& src);
			virtual				~VWRecordObj();

			VWRecordObj&		operator=(const VWRecordObj& src);
	
		public:
			TXString			GetRecordName() const;
			bool				IsParametric() const;
			void				SetParametric(bool bIsParametric);

		// parameters
		public:
			size_t				GetParamsCount() const;
			TXString			GetParamName(size_t paramIndex) const;
			// returns ((size_t) -1) if not found
			size_t				GetParamIndex(const TXString& paramName) const;
			EFieldStyle			GetParamStyle(size_t paramIndex) const;
			TXString			GetParamValue(size_t paramIndex) const;
			void				SetParamValue(size_t paramIndex, const TXString& value);

			long				GetParamLong(size_t paramIndex) const;
			void				SetParamLong(size_t paramIndex, long value);
			bool				GetParamBool(size_t paramIndex) const;
			void				SetParamBool(size_t paramIndex, bool value);
			double				GetParamReal(size_t paramIndex) const;
			void				SetParamReal(size_t paramIndex, double value);
			TXString			GetParamString(size_t paramIndex) const;
			void				SetParamString(size_t paramIndex, const TXString& value);

		// Tools
		public:
			// Return true if the specified object handle is record format
			static bool			IsRecordObject(MCObjectHandle hObj);
		};
	}
}