

function HistoryData () {
    
	// for Item
    this.DisplayName          	= null;
	this.IdentityName			= null;
	this.Identity				= null;
	this.Status					= null;
    this.Availablity			= null;    
	this.AvatarPath				= null;
	this.AvatarType				= null;	
	this.Time					= null;
	this.Duration				= null;
}

/*
class HistoryInfo {
public:
	int HistoryType;
	SEString HistorySkypeName; //	
	SEString HistoryDisplayName; //	
	SEString HistoryBiginTimeStamp;
	SEString m_sLocalTimeStamp;
	int HistoryIsMissed;    // set if it is unseen missed call , P_IS_UNSEEN_MISSED
	int HistoryStatus;  //Outgoing, incoming, missed
	int HistoryVMDuration;
	int HistoryVMIndex;
	int ToIntTimeStamp;
	int HistoryIsConference;  //set if it is incoming call, P_IS_INCOMING
	int HistoryCallMemeberType;
	int HistoryIsUnknownPSTN;

};

*/ 


HistoryData.prototype.SetData = function(Type,Name_,Display,Time_,IsMissed,IsConference,IsInComing,IsPSTN,Duration_,ID,Index) {

	alert("HistoryData.SetData ");
	
    if(Display){
        this.DisplayName = Display;
    }
 	else if(Name_){
		this.DisplayName = Name_;
	}
		
	this.IdentityName = Name_;
	this.Identity = ID;		
			
	if(Time_){
        this.Time = Time_;
    }

	if(Duration_){
        this.Duration = Duration_;
    }
	
	if(Type == "1") {
		if(IsMissed == "1" ) {			
			this.Status = ENUM_HISTORY_STATUS.MISSED_VOICEMAIL;
		}
		else {//if(IsInComing == "1")
			this.Status = ENUM_HISTORY_STATUS.INCOMING_VOICEMAIL;			
		}		
	}
	else {
		//conference call
		if(IsConference == "2"){
			if(IsMissed == "1" ) {			
				this.Status = ENUM_HISTORY_STATUS.MISSED_CONFENRECE_CALL;
			}
			else{ //if(IsInComing == "1")		
				this.Status = ENUM_HISTORY_STATUS.INCOMING_CONFERENCE;			
			}
			
			this.DisplayName = PluginAPIMgr.GetHistoryParticipantsWithIndex(Index);		
		}
		//out call
		else if(IsInComing == "0"){		
			this.Status = ENUM_HISTORY_STATUS.OUTGOING_CALL;					
		}
		//normal call
		else {
			if(IsMissed == "1" ) {			
				this.Status = ENUM_HISTORY_STATUS.MISSED_INCOMING_CALL;
			}
			else {			
				//this.Status = ENUM_HISTORY_STATUS.OUTGOING_CALL;
				this.Status = ENUM_HISTORY_STATUS.INCOMING_CALL;			
			}			
		}
	}
	
	//check avatar
	
	if(IsPSTN == '1'){

		this.AvatarPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_PSTN;
		this.AvatarType = ENUM_CONTACT_AVATA_TYPE.PSTN;		
//		this.Availablity = ENUM_CONTACT_AVAILABILITY.SKYPEOUT;		
	}
	else if(IsConference == "2"){
		
		this.AvatarPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_GROUP;
		this.AvatarType = ENUM_CONTACT_AVATA_TYPE.GROUP;		
//		this.Availablity = ENUM_CONTACT_AVAILABILITY.GROUP;
	}
	else{

		this.AvatarPath = PluginAPIMgr.GetAvatarPath(Name_);
		this.AvatarType = PluginAPIMgr.GetAvatarType(Name_);
//		this.Availablity = PluginAPIMgr.GetContactPropWithName(Name_,ENUM_CONTACT_PROPERTY.P_AVAILABILITY);
	}

	if(IsConference == "2")
		this.Availablity = ENUM_CONTACT_AVAILABILITY.GROUP;
	else	
		this.Availablity = PluginAPIMgr.GetContactPropWithName(Name_,ENUM_CONTACT_PROPERTY.P_AVAILABILITY);
	
	//this.AvatarPath = g_Image.IMAGE_LIST_MAIN_HISTORY_LIST_ITEM_DEFAULT_AVATA_NO_GENDER;
	//this.AvatarType = ENUM_CONTACT_AVATA_TYPE.NO_GENDER;
	//this.Availablity = ENUM_CONTACT_AVAILABILITY.OFFLINE;
} 

HistoryData.prototype.SkypeName = function() {
	return this.SkypeName;
}



