//File:		Message.js
//Author:	Guo Tao
//Dept. :	Convergence SW R&D
//CopyRight:	Creative Technology Ltd., 2001-2004 All rights reserved
//Created on:	01/11/2002

/****************************************************************************************************************
 *														*
 *				Messages for the object CTSUEng()						*
 *														*
 ****************************************************************************************************************/

//Message Handler: int CTSUProc(nMsg, varParam1, varParam2, varParam3, varParam4, varParam5)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Define Message return code

var MSG_RETURN_OKYES=0;
var MSG_RETURN_NO=1
var MSG_RETURN_CANCEL=2;


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Define Global Messages, used in all pages; Start from 1

//Description	CTSU object failed to be initialed.
//Param 	varParam1- [int] error code;
//Return	MSG_RETURN_OKYES - continue; MSG_RETURN_CANCEL - aborted;
var MSG_CTSU_INITFAILED=1;


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Define Product Messages, used only in product page; Start from 11

//Description	Enumerate product one by one; Send after list of products are found
//Param		varParam1 - [int]index number of the product
//		varParam2 - [string]description of the product
//		varParam3 - [boolean]Flag to indicate whether the product is selected
//Return	Ignored
var MSG_CTSU_ENUMPRODUCT=11;

//Description	Update progress of the GetProduct thread; Send when GetProduct() is called
//Param		varParam1 - [int]return code of GetProduct thread
//		varParam2 - [int]number of products found
//Return	Ignored
var MSG_CTSU_GETPRODUCTPROGRESS=12;

//Description	Update progress of the Contact thread; Send when checking updates
//Param		varParam1 - [int]return code of Contact thread
//		varParam2 - [int]number indicating the percentage of the progress; from 0-100
//Return	Ignored
var MSG_CTSU_CHECKUPDATEPROGRESS=13;

//Description	Form Product Description; Send just before a product is being enumerated
//Param		varParam1 - [int]Type of products: APPILCAION/HARDWARE
//		varParam2 - [string]application version string if type is APPLICTION, or firmware version string if type is HARDWARE
//		varParam3 - [string]driver version; it is only meaningful if type is HARDWARE
//Return	string to present product descriptions
var MSG_CTSU_FORMPRODUCTDESC=14;


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Define Component Messages, used only in Component Page; start from 21

//Description	Enumerate component one by one; Send after list of components are found
//Param		varParam1 - [int]index number of the component
//		varParam2 - [boolean]Select status of the component
//		varParam3 - [string]Name of the component
//		varParam4 - [int]Category of the component (2-Compulsory; 1-Critical; 0-Recommended)
//		varParam5 - [long]Size of the component in bytes
//Return	Ignored
var MSG_CTSU_ENUMCOMPONENT=21;

//Description	The status of component is being changed; Send when a component is being selected or deselected because the statuses of its parents/children are changed
//Param		varParam1 - [int]Component status; 2-the child is being selected; 1-the parent is being deselected; 0-the parent is being removed
//		varParam2 - [string]Name of the parent/child component
//		varParam3 - [boolean]Exclusive flag
//		varParam4 - [int]Index of the selected exclusive package
//Return	RETURN_MSG_OKYES if the change is confirmed; RETURN_MSG_NO if the change is cancelled by user;
var MSG_CTSU_COMPONENTSTATUSCHANGING=22;

//Description	The status of component is changed; Send when a component is selected or deselected because the statuses of its parents/children are changed
//Param		varParam1 - [int]Index of the Component
//		varParam2 - [int]Component status
//		varParam3 - [int]Product Index; Only for multi-product mode
//Return	Ignored
var MSG_CTSU_COMPONENTSTATUSCHANGED=23;

//Description	The user tries to uncheck the compulsory component
//Param		NONE
//Return	Ignored
var MSG_CTSU_COMPULSORYCOMPONENTCHANGING=24;

//Description	The total selection of components is changed;
//Param		varParam1 - [int]Total selected Components
//		varParam2 - [int]Total download size in bytes.
//Return	Ignored
var MSG_CTSU_TOTALSELECTCHANGED=25;

//Description	Download Thread is in the initail/idle stage;
//Param		varParam1 - [int]Index of the component
//		varParam2 - [string]Name of the component
//Return	Ignored
var MSG_CTSU_DLINIT=26;

//Description	Download Thread is contacting the server for a component;
//Param		varParam1 - [int]Index of the component
//		varParam2 - [string]Name of the component
//Return	Ignored
var MSG_CTSU_DLCONTACTSERVER=27;

//Description	Download Thread is in the FTP queue;
//Param		varParam1 - [int]Index of the component;
//		varParam2 - [string]Name of the component;
//		varParam3 - [int]Queue number;
//Return	Ignored
var MSG_CTSU_DLWAITINQUEUE=28;

//Description	Download Thread is downloading a component;
//Param		varParam1 - [int]Index of the component;
//		varParam2 - [string]Name of the component;
//		varParam3 - [int]Downloaded size in bytes;
//		varParam4 - [int]Total Download size in bytes;
//		varParam5 - [int]Download speed in bytes/sec;
//Return	Ignored
var MSG_CTSU_DLPROGRESS=29;

//Description	A component is downloaded;
//Param		varParam1 - [int]Index of the component;
//		varParam2 - [string]Name of the component;
//		varParam3 - [int]Downloaded size in bytes;
//		varParam4 - [int]Total Download size in bytes;
//Return	Ignored
var MSG_CTSU_DLCOMPONENTDOWNLOADED=30;

//Description	A component failed to download;
//Param		varParam1 - [int]Index of the component;
//		varParam2 - [string]Name of the component;
//		varParam3 - [int]Error code;
//Return	MSG_RETURN_OKYES - skip the component; MSG_RETURN_NO - redownload the component; MSG_RETURN_ABORT - cancel download and install process;
var MSG_CTSU_DLCOMPONENTFAILED=31;

//Description	Download process is complete
//Param		varParam1 - [boolean]TRUE if components are downloaded; FALSE if no files are downloaded;
//		varParam2 - [boolean]Flag to indicate whether ask the user before install; It is ignored if varParam1=false;
//Return	MSG_RETURN_OKYES - start installing; MSG_RETURN_CANCEL - Cancel process;
var MSG_CTSU_DLCOMPLETE=32;

//Description	Install Thread is initialized;
//Param		varParam1 - [int]Index of the component
//		varParam2 - [string]Name of the component
//Return	Ignored
var MSG_CTSU_INSINIT=33;

//Description	Installing a component;
//Param		varParam1 - [int]Index of the component;
//		varParam2 - [string]Name of the component;
//		varParam3 - [int]% of process;
//Return	Ignored
var MSG_CTSU_INSPROGRESS=34;

//Description	A component is installed;
//Param		varParam1 - [int]Index of the component;
//		varParam2 - [string]Name of the component;
//Return	Ignored
var MSG_CTSU_INSCOMPONENTINSTALLED=35;

//Description	A component failed to install;
//Param		varParam1 - [int]Index of the component;
//		varParam2 - [string]Name of the component;
//		varParam3 - [int]Error code;
//Return	MSG_RETURN_OKYES - skip the component; MSG_RETURN_NO - reinstall the component; MSG_RETURN_ABORT - cancel install process;
var MSG_CTSU_INSCOMPONENTFAILED=36;

//Description	Install process is complete
//Param		varParam1 - [boolean]TRUE if components are installed; FALSE if no components are installed;
//		varParam2 - [boolean]Reboot Flag; It is ignored if varParam1=false;
//Return	Ignored;
var MSG_CTSU_INSCOMPLETE=37;

//Description	Exclusive package is launched
//Param		no
var MSG_CTSU_EXCLUSIVEPACKLAUNCHED=38;

//Description	Package requires reboot
//Param		no
var MSG_CTSU_INSMUSTREBOOT=39;

//Description	Check whether Product is selected; only for multiproduct mode
//Param		varParam1 - [int]index of the product
//Return	MSG_RETURN_OKYES - check the product; MSG_RETURN_NO - not checked
var MSG_CTSU_ISPRODUCTCHECKED=40;

//Description	Enable the component
//Param		varParam1 - [int] index of the product
//		varParam2 - [int] index of the component
//		varParam3 - [int] Enable/Disable flag
var MSG_CTSU_ENABLECOMPONENT=41;