/*
 *  TI Connect X AE Keys.h
 *  TI Connect X CommMgr
 *
 *	This file contains all the descriptor keys used in the TI Connect Manager X
 *	background application.
 *
 *  Created by Stephen L. Reid on Fri Apr 11 2003.
 *  Copyright (c) 2003 Texas Instruments Incorporated. All rights reserved.
 *
 */
 
// include the carbon environment since we've got some "FinderRegistry" stuff below.
#include <Carbon/Carbon.h>

//========================================================================================
// TI Connect AE Suite of events that are specific to this app
//========================================================================================
enum {
	kAETIConnectSuite =     'TIco',
	kAERegister =           'TIno',		// register for notifications of new devices by name
	kAEUnRegister =         'TInf',		// unregister for notifications
	kAEIsRegistered	=       'TIne',		// is process registered?
	kAEDeviceAttachNotify =	'TIda',		// notification: device object attached
	kAEDeviceDetachNotify =	'TIdr',		// notification: device object detached
	kAEReconfirmIdentity =	'TIri',		// reconfirm identity of attached device
	kAEReacquireDevice =	'TIrd',		// re-acquire and identify attached device
	kAERefreshDirectory =	'TIrf',		// refresh cached directory entry event
	kAESendDataObjects =	'TIsd',		// send data to device
	kAESendKey 	=           'TIsk',		// send key to device
	kAEGetDataVersion =     'TIdv',		// get data version event
	kAEWaitDataObjects =	'TIwf',		// wait for data from device
	kAECheckName =          'TIcn',		// check for valid, non-reserved or illegal name(s)
	kAELoginDevice =        'TIli',		// install listener on specific devices
	kAEDeviceLoggedIn =     'TIlo',		// notification: device has seen login sequence
	kAEDeviceLoginTimedOut ='TIdt',		// notification: device login timed out.
	kAEDeviceHasLoggedIn =	'TIdl',		// self-notification: device has logged in.  Used to clean up login thread.
	kAEIDThreadCompleted =	'TIdj',		// self-notification: device id has completed.
	kAEThreadHasCompleted =	'TItc',		// AE Thread has completed processing.
	kAETerminateTransaction ='TIte',	// terminate a currently running transaction on (possibly) several devices.
	kAEGetCurrentDate =     'curd'		// AS missing key: 'curd' is used to retrieve the 'current date'
};
//========================================================================================


//========================================================================================
// in the SEND data event, we need the ability to override the object destination.  This is it.  (send obj to device n in RAM/archive)
//========================================================================================
enum {
	keyObjectLocation =         'kLoc'		// event key - location (ie. RAM or Archive destination)
};
//========================================================================================



//========================================================================================
// TI Connect Manager "Class" objects defined in dictionary
//========================================================================================
enum {

	cEducationalDevice =        'cEDv',		// an educational device
	cEducationalDeviceInUse =   'cIED',     // an educational device, currently in use (so we can bypass the pthread mutex)
	cUnknownEducationalDevice = 'cUED',     // an "unknown" educational device.
	cDirectory =                'cDir',		// a directory (normally represented as an ae list)
	cDataTimeObject	=           'cDat',		// class for retrieval of date information from device directory
	cCalculator =               'cCal',		// a calculator item definition
	cBatteries =                'cBat',		// battery state class
	cFlags =                    'cFlg',		// device flags class
	cCertificateMemory =        'Cctm',		// certificate memory class
	cFamily	=                   'cFam',		// family class
	cLoginStatus =              'cLog',		// device login status
	cClockOfDevice =            'cCLK',		// class clock of device
	cClockState =               'cDcs',		// class defines for clock state
	kAEProductInformation =     'cPrI'		// class product information of device
};
//========================================================================================




//========================================================================================
// TI Connect Manager "properties" objects defined in dictionary
//========================================================================================

//========================================================================================
// extra application properties
//========================================================================================
enum {
        pSupportedModels = 	'pSMo',		// aelist of supported models by enumerated type
        pSupportedDevices = 'pSDe',		// aelist of supported devices by unicode text string
        pUSBSuspendDelay =	'pSDt',
        pUSBResumeDelay =	'pRDt',
		pPreviousPassword = 'Pass',		// old password key attribute
//		pPassword			'pass',
		pSharingEnabled	=	'shar',		// sharing enabled (true) or disabled (false)
		pCurrentResolution = 'pReS'		// current 'in use' default screen resolution for use by
										// the contextual menu and services routines.
};
//========================================================================================



//========================================================================================
// device properties, some are device, others are unknown device, others are active device.
//========================================================================================
enum {
        // name, contents and class are container objects
	pNamed =		formName,	// as in object 'named' something
//	pContents =		'pcnt',		// as in contents of object...
//	pClass =		'pcls',		// as in class of object (what type?)
	pNativeName =		'pNam',		// native name format
	pDisplayName =		'pNAM',		// name in calculator UTF8 form (old pnam, before unicode)
	pLoginStatus =		'pLog',		// property of device for login status
	pScreenPICT =		'pScr',		// a TI Screen shot property of a device (returned as a PICT)
	pScreenColorPICT =	'pSCr',		// a TI Color Screen shot property of a device (returned as a PICT)
	pIDListValue =		'pIDl',		// a TI ID-List value returned as TEXT
	pLoginName =		'pLgN',		// login name property of device, plain text.
	pModel =		'pMod',		// model identity of device
	pIdentity =		'pIdn',		// true identity of device (in case user unplugs...)
	pFamily	=		'pFam',		// family property of device
	pDirectory =		'pDir',		// property of directory of device
	pBattery =		'pBat',		// battery state of device
	pCableName =		'pCnm',		// cable name property of device
	pFeatures =		'feat',		// device features
	pDeviceUserName	=	'pUNm',		// username is an 'TEXT' property of device
	pDirectoryFilter =	'pFlt',		// directory filter property
	pStoreModelName	=	'pSto',		// name of device used to access online store
	pCertificateMemory =	'Pctm',		// application information of device
	pClockProperty =	'pCLK',		// clock of device
	pStatusProperty	=	'pIOs',		// io status of active device
	pProductInformation =	'pPrI',		// product information of device
	pConnectionVia =	'pCon',		// connection to device is made via...
	pKeyEchoState =		'pKyE',		// key echo mode state
	pDefaultFolderName = 	'pDfl'		// default folder name (if folders supported in features property)
};
//========================================================================================



//========================================================================================
// directory item properties (coerce directory record property to get directory item
//========================================================================================
enum {
        pObjectCreationDate =	'pCdt',		// date of object creation
        pObjectModificationDate ='pMdt',	// date of last modification
        pApplicationMarker =	'pApM',		// 4-char application marker from 89/92P/V200 directory
        pMemoryAvailable =	'PMmA',		// in 'MemA' (memory available) records
        pParentFolder	=	'Pfol', 	// parent folder property in directory item
        pObjectRecordType =	'Pobt', 	//  object record type in directory item required if owner is CBL 2
        pObjectVersion	=	'Pobv', 	// optional
        pObjectDataType	=	'Podt', 	// optional (takes value from Object Descriptor if not supplied)
        pOwnerProductID	=	'pPID',		// optional product ID
	pFlags =		'pDal',		// flag properties for item
	pDeviceOwner =		'pOwn',		// owner, as in device.
	pExtension =		'pExt',		// file extension property of file.
	pEntryValue =		'pEnt',		// as in entry number of the record (CBL2/Labpro)
	pDataType =		'pTyp'		// as in content type of object
};
//========================================================================================




        
//========================================================================================
// properties of the io status property of a device
//========================================================================================
enum {
	pOperationInProgress =	'pOpe',		// status operation in progress
	pTransferredCount =	'pSnt',		// status operation transferred count
	pItemsCount =		'pTot',		// status operation count of objects
	pItemTransferredCount =	'PSnt',		// status operation current object transferred count
        pTransactionIDAttr =	'pTrn',		// current event transaction id attribute value (0 if none)
        pElapsedTime =		'pELt'		// current or final elapsed time
};
//========================================================================================




//========================================================================================
// properties of the clock property of a device
//========================================================================================
enum {
	pClockDeviceDate =	'pDAT',		// property device date: type 'ldt '
	pClockTimeZome =	'pDtz',		// property time zone: type 'long'
	pClockDateFormat =	'pDdf',		// property date format: type 'long'
	pClockTimeFormat =	'pDtf',		// property time format: type 'long'
        pClockDateSetting =	'pDtS',		// property date format settings strings (ae 'list' of text items)
	pClockState =		'pDcs',		// property clock state: type 'cDcs'
};
//========================================================================================





//========================================================================================
// product information record properties
//========================================================================================
enum {
	pOSRevision =		'pOSr',		// OS revision currently on device
	pROMRevision =		'pRMr', 	// Boot ROM revision currently on device
	pHardwareRevision =	'pHWr', 	// Hardware version of device
	pLanguageRevision =	'pLGr', 	// current active language of device
        pProductIDValue	  =	'pPID'		// current Product ID Revision
};
//========================================================================================





//========================================================================================
// enumerations used to define override location on SEND event using override
//========================================================================================
enum {
	enumArchive =		'eARH',		// destination is ARCHIVE (override object specified destination)
	enumRAM	=		'eRAM',		// destination is RAM/UNLOCKED (override object specified destination)
	enumLOCK =		'eLOK'		// destination is RAM/LOCKED (override object specified destination)
};
//========================================================================================




//========================================================================================
// enumerations used to define connection to device
//========================================================================================
enum {
	enumConnectivityCable =		'eSil',	// connection to device is made via a TI Connectivity Cable USB and DBUS comm
	enumDirectUSB	=		'eCAR',	// connection to device is via direct USB interface
	enumNavigatorNetwork =		'eNav',	// connection to device is via the navigator network interface
	enumGraySerialCable =		'eGry' // connection to device is via the "Gray" serial cable
};
//========================================================================================






//========================================================================================
// valid name response record from check name event
//========================================================================================
enum {
	kAEResponseRecord =		'RspR',	// a response record
	kAEResponseNameProperty =	'pnam', // contains an item name
	kAEResponseNameStatusProperty =	'pSta'  // and a status property indicating name valid or not
};



//========================================================================================
// Login status enumerations for retrieving current status
//========================================================================================
enum {
	enumLoginIsPending =	'eLPn',		// device login is pending
	enumDeviceLoggedIn =	'eLgI',		// device is logged in
	enumDeviceNotLoggedIn =	'eLnI'		// device is not logged in
};

//========================================================================================
// enumerated product features present in the Features property record of the device
//========================================================================================
enum {
	enumAtHome =		'eHom',		// product is on home screen
	enumRDISupport =	'eRDI',		// product has rdi support
	enumFlash =		'eFls',		// product has flash
	enumZeroRDC =		'eZer',		// product supports zero-rdc
	enumRDC =		'eRDC',		// product supports rdc
	enumDirFilters =	'eFlt',		// product has directory filter feature
	enumBusy =		'eBsy',		// product is busy
	enumProductCode =	'eOSl',		// product has product code loaded
        enumArchiveSupport = 	'eARc',		// product supports archive feature
        enumHasScreen =		'eScn',		// product has a screen
	enumClockSupport =	'eClk',		// product supports clock.
        enumLoginSupported = 	'eLgn',		// product supports login.
        enumFoldersSupported = 	'eFld',		// product supports folders
        enumDeleteSupported = 	'eDel',		// product supports deletion of objects
        enumAppsSupported = 	'eAps',		// product OS supports loading of apps
        enumSendKeysSupported = 'eKey',		// product can receive keystrokes
    enumColorSupport       =    'eClr'  // product supports color
};
//========================================================================================



//========================================================================================
// enumerated battery property of device state
//========================================================================================
enum {
	enumLow	=		'eLow',		// batteries are low
	enumOK =		'eOKb'		// batteries are ok
};
//========================================================================================




//========================================================================================
// enumerated directory item flags states
//========================================================================================
enum {
	enumNone =			'eNon',		// no flags set
	enumLocked =		'eLok',		// item is locked
	enumArchived =		'eArk',		// item is archived
	enumNonRemovable =  'eNoD'		// item cannot be deleted
};
//========================================================================================




//========================================================================================
// enumerated keys for application information response records
//========================================================================================
enum {
	keyCertificateItemName =	'Pcin',
	keyCertificateItemTimestamp =	'Ptsp',
	keyCertificateItemProgramID =	'Pidv',
	keyCertificateItemVersion =	'Pvrs'
};
//========================================================================================




//========================================================================================
// IO status enumerated completion status
//========================================================================================
enum {
	kEnumCompleted =	'Done'		// io operation done on device	
};
//========================================================================================




//========================================================================================
// enumerated clock state values for setting and retrieving clock properties
//========================================================================================
enum {
	kClockIsOn =		'kCKo',		// clock on
	kClockIsOff =		'kCKf',		// clock off
	kClockIsSame =		'kCKs'		// clock same
};
//========================================================================================




//========================================================================================
// enumerated check name response in status reply of check name event
//========================================================================================
enum {
	eAEValidNameResponse =		'tiVA',	// name is valid for target device
	eAEInvalidNameResponse =	'tiIN',	// name is not valid for target device
	eAEReservedNameResponse =	'tiRN'	// name is reserved or restricted use on target device
};
//========================================================================================




//========================================================================================
// Internal Tokens for AEObjectAccessor use
//========================================================================================
enum myTIAccessorTokens {
	myTIDeviceToken	=		'tTIt',	
	myTIDeviceInUseToken =		'tTIi',
        myTIUnknownDeviceToken =	'tTIu',
	myTIFolderToken	=		'tTIf',
        myTIFileToken =			'tTIn',
        myTIFileContentsToken =		'tTIc',
        myTIUserNameToken =		'tUNm',

        myTIModelPropertyToken =	'tTIm',
        myTIIdentityPropertyToken =	'tIdn',
        myTIFamilyPropertyToken	=	'tTIy',
	myTICableNamePropertyToken =	'tCNp',
	myTILoginNamePropertyToken =	'tLgN',
	myTIClassPropertyToken =	'tCls',
	myTIUniqueNamePropertyToken =	'tUID',
	myTISizePropertyToken =		'tSiz',
	myTIScreenPropertyToken =	'tTIs',
	myTIColorScreenPropertyToken =	'tTIr',

	myTIIDPropertyToken =		'tID ',
	myTICertMemPropertyToken =	'tCtm',
	myTIFeaturesPropertyToken =	'tFea',
	myTIBatteryPropertyToken =	'tBat',
	myTILoginStatusPropertyToken =	'tLog',
	myTIFilterPropertyToken	=	'tFlt',
	myTIStatusPropertyToken =	'tSta',
	myTIClockPropertyToken =	'tClk',
	myTIProductInfoPropertyToken =	'tPrI',
	myTIConnectionPropertyToken =	'tCon',
	myTIDefaultFolderPropertyToken ='tFld',
	myTIKeyEchoModeToken = 		'tKyE',
	
	myTIProductInfoNoCommPropertyToken = 	'tpRI',
	myTIUSBSuspendDelayIntervalToken =	'tSDt',
	myTIUSBResumeDelayIntervalToken =	'tRDt',
	myTIApplicationPictureResolutionToken = 'tReS',
	myTIApplicationPasswordToken = 'tPas',
	myTIApplicationSharingToken = 'tShr',
	myTIBatteryNoCommPropertyToken =	'tBAt',

	typeFolderURL =			'fURL',
	typeColorPict =			'pIcT',
    typeRGBPicture =        'PicC',
	typeColorGraphicsObject =	'GobS',
	typeCalculatorImageData = 'CIda',
    typeColorCalculatorImageData = 'COda' // used with TI-84 Plus Color
};
//========================================================================================




//========================================================================================
// Enumerated device types defined in the dictionary.
//========================================================================================
enum MyTI_DeviceEnumerations {
    enumNoDevice	=		'NCal',
    enumTI73		= 		'TI73',
    enumTI82		=		'TI82',
    enumTI83		=		'TI83',
    enumTI83Plus	=		'TI8X',
    enumTI83PlusSE	=		'TI8S',
    enumTI85		=		'TI85',
    enumTI86		=		'TI86',
    enumTI89		=		'TI89',
    enumTI92		=		'TI92',
    enumTI92Plus	=		'TI9P',
    enumVoyage200	=		'V200',
    enumCBR		=		'CBR ',
    enumCBR2    =       'CBR2',
    enumCBL2		=		'CBL2',
    enumCBL 		=		'CBL ',
    enumLabPro		=		'LabP',
    enumPresenter	=		'TIPr',
    enumTI84Plus	=		'TI84',
    enumTI84Platinum	=		'TI8P',
    enumTI89Titanium	=		'TI8T',
    enumTI84Color   =       'TI8C'
};
//========================================================================================


    

//========================================================================================
// Enumerated "family" types as defined in the dictionary.
//========================================================================================
enum MyTI_FamilyEnumerations {
    familyOther	=			'OtFa',
    familyTI83		=		'83Fa',
    familyTI85		=		'85Fa',
    familyTI92		=		'92Fa',
    familyCBL2		=		'C2Fa'
};
//========================================================================================


    

//========================================================================================
// Enumerated content types as defined in the dictionary.  Not all devices support all content types.
//========================================================================================
enum MyTI_ContentTypes {	// our 'content type' enumerated types.
        eNumber			= 'Numb',
        eVector			= 'Vect',
        eExpression 		= 'Expr',
        eApplication		= 'App ',
        eOSUpdate		= 'OSUp',
        eProgram		= 'Prog',
        ePicture		= 'Pict',
        eScreen			= 'Scrn',
        eMatrix			= 'Matr',
        eFunction		= 'Func',
        eComplex		= 'Cplx',
        eText			= 'TxtO',
        eList			= 'List',
        eEquation		= 'Equa',
        eComplexList		= 'Cpll',
        eCertificate		= 'Cert',
        eAppVar			= 'AppV',
        eComplexMatrix		= 'Cplm',
        eRange			= 'Rang',
        eTable			= 'Tbls',
        eIDList			= 'IDls',
        eStringList		= 'Strl',
        eData			= 'Datv',
        eAssemblyApp		= 'Asmp',
        eProduct		= 'PInf',
        eString			= 'Strv',
        eGDB			= 'GDBv',
        eFolder			= 'FOld',
        eFigure			= 'Gfig',
        eMacro			= 'Gmac',
        eClock			= 'Clok',
        eComplexConst		= 'CpCo',
        eConst			= 'Cons',
        eFraction		= 'Frac',
        eComplexVector		= 'Cvec',
        eGroup			= 'GrpO',
        eCImage         = 'CImg',
        eCScreen        = 'CScn',
        eCPicture       = 'CPic'
};
//========================================================================================
    
    
    

//========================================================================================
// These are keys used in the various AERecord's that are returned by the comm manager
//========================================================================================
enum {
	keyFolderEntry		= enumFolders,
	keyCalculatorObject	= 'CalC',
	keyDirectoryObject	= 'DirO',
	keyScreenObject		= 'ScrN',
	keyMemAvailObject	= 'MemA',
	keyMemoryUsedByData	= 'MemU',
	keyComputerObject	= 'Comp',
        
	typeDirectoryObject	= 'd\xFFrE'
};
//========================================================================================




//========================================================================================
// These are types used to translate from calculator pics to specific resolution PICT images
//========================================================================================
enum {
	typePicture72dpi	= 'PICT',		// standard macintosh image resolution
	typePicture96dpi	= 'Pic0',		// standard windows image resolution
	typePicture100dpi   = 'Pic1',
	typePicture120dpi   = 'Pic2',
	typePicture144dpi   = 'Pic3',		// standard mac * 2 resolution
	typePicture150dpi   = 'Pic4',
	typePicture192dpi   = 'Pic5',		// standard windows * 2 resolution
	typePicture288dpi   = 'Pic6',
	typePicture300dpi   = 'Pic7',
	typePictureWildDPI  = 'Pic*'		// "wildcard" used to reduce entries in coercion tables.
};
//========================================================================================

