sbDeviceStatusHelper Class Reference

#include <sbDeviceStatusHelper.h>

Public Types

enum  Operation {
  OPERATION_TYPE_NONE, OPERATION_TYPE_MOUNT, OPERATION_TYPE_WRITE, OPERATION_TYPE_TRANSCODE,
  OPERATION_TYPE_DELETE, OPERATION_TYPE_READ, OPERATION_TYPE_FORMAT, OPERATION_TYPE_DOWNLOAD
}
 

Public Member Functions

void OperationStart (Operation aOperationType, PRInt32 aItemNum, PRInt32 aItemCount, PRInt32 aItemType, sbIMediaList *aMediaList=nsnull, sbIMediaItem *aMediaItem=nsnull, PRBool aNewBatch=PR_TRUE)
 
void OperationComplete (nsresult aResult)
 
void ItemStart (PRInt32 aItemNum, PRInt32 aItemCount, PRInt32 aItemType)
 
void ItemStart (sbIMediaList *aMediaList, sbIMediaItem *aMediaItem, PRInt32 aItemNum, PRInt32 aItemCount, PRInt32 aItemType=0)
 
void ItemProgress (double aProgress)
 
void ItemComplete (nsresult aResult)
 
 sbDeviceStatusHelper (sbBaseDevice *aDevice)
 
 ~sbDeviceStatusHelper ()
 
nsresult Initialize ()
 
nsresult ChangeState (PRUint32 aState)
 
nsresult GetCurrentStatus (sbIDeviceStatus **aCurrentStatus)
 
nsresult UpdateStatus (const nsAString &aOperation, const nsAString &aStateMessage, PRInt32 aItemNum, PRInt32 aItemCount, double aProgress, PRInt32 aItemType=0)
 
PRUint32 GetSubState ()
 

Detailed Description

This class communicates device status to the system. It's a wrapper around sbIDeviceStatus to make things a little easier to report status

Definition at line 47 of file sbDeviceStatusHelper.h.

Member Enumeration Documentation

Enumerator
OPERATION_TYPE_NONE 
OPERATION_TYPE_MOUNT 
OPERATION_TYPE_WRITE 
OPERATION_TYPE_TRANSCODE 
OPERATION_TYPE_DELETE 
OPERATION_TYPE_READ 
OPERATION_TYPE_FORMAT 
OPERATION_TYPE_DOWNLOAD 

Definition at line 69 of file sbDeviceStatusHelper.h.

Constructor & Destructor Documentation

sbDeviceStatusHelper::sbDeviceStatusHelper ( sbBaseDevice aDevice)

Construct a device status helper object.

Parameters
aDeviceDevice for which to construct status.

Definition at line 952 of file sbDeviceStatusHelper.cpp.

sbDeviceStatusHelper::~sbDeviceStatusHelper ( )

Destroy a device status helper object.

Definition at line 762 of file sbDeviceStatusHelper.cpp.

Member Function Documentation

nsresult sbDeviceStatusHelper::ChangeState ( PRUint32  aState)

Change the device state to the state specified by aState.

Parameters
aStateNew device state.

Definition at line 808 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbDeviceStatusHelper::GetCurrentStatus ( sbIDeviceStatus **  aCurrentStatus)

Return in aCurrentStatus the current device status.

Parameters
aCurrentStatusReturned current device status.

Definition at line 879 of file sbDeviceStatusHelper.cpp.

PRUint32 sbDeviceStatusHelper::GetSubState ( )
inline

Definition at line 135 of file sbDeviceStatusHelper.h.

nsresult sbDeviceStatusHelper::Initialize ( )

Initialize the device status helper object.

Definition at line 773 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

void sbDeviceStatusHelper::ItemComplete ( nsresult  aResult)

Process the completion of the current item with the result specified by aResult.

Parameters
aResultCompletion result of item.

Definition at line 717 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

void sbDeviceStatusHelper::ItemProgress ( double  aProgress)

Process the progress of the current item with the progress specified by aProgress.

Parameters
aProgressProgress of current item.

Definition at line 646 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

void sbDeviceStatusHelper::ItemStart ( PRInt32  aItemNum,
PRInt32  aItemCount,
PRInt32  aItemType 
)

Process the start of item processing of the item with item number specified by aItemNum out of the total item count specified by aItemCount. Don't update the current item num or total item count if the corresponding arguments are negative.

Parameters
aItemNumCurrent item number. Defaults to -1.
aItemCountCurrent total item count. Defaults to -1.

Definition at line 510 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void sbDeviceStatusHelper::ItemStart ( sbIMediaList aMediaList,
sbIMediaItem aMediaItem,
PRInt32  aItemNum,
PRInt32  aItemCount,
PRInt32  aItemType = 0 
)

Process the start of item processing of the media item specified by aMediaItem within the media list specified by aMediaList with item number specified by aItemNum out of the total item count specified by aItemCount. Don't update the current item num or total item count if the corresponding arguments are negative.

Parameters
aMediaListMedia list.
aMediaItemMedia item being started.
aItemNumCurrent item number. Defaults to -1.
aItemCountCurrent total item count. Defaults to -1.

Definition at line 620 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

void sbDeviceStatusHelper::OperationComplete ( nsresult  aResult)

Process the completion of the current operation with the result specified by aResult.

Parameters
aResultCompletion result of operation.

Definition at line 383 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

void sbDeviceStatusHelper::OperationStart ( sbDeviceStatusHelper::Operation  aOperationType,
PRInt32  aItemNum,
PRInt32  aItemCount,
PRInt32  aItemType,
sbIMediaList aMediaList = nsnull,
sbIMediaItem aMediaItem = nsnull,
PRBool  aNewBatch = PR_TRUE 
)

Process the start of a new operation of the type specified by aOperationType. The current operation item number is specified by aItemNum and the operation total item count is specified by aItemCount.

Parameters
aOperationTypeType of operation.
aItemNumCurrent item number
aItemCountCurrent total item count.
aMediaListOperation media list. Defaulted to nsnull.
aMediaItemOperation media item. Defaulted to nsnull.

Definition at line 245 of file sbDeviceStatusHelper.cpp.

Here is the call graph for this function:

nsresult sbDeviceStatusHelper::UpdateStatus ( const nsAString &  aOperation,
const nsAString &  aStateMessage,
PRInt32  aItemNum,
PRInt32  aItemCount,
double  aProgress,
PRInt32  aItemType = 0 
)

Update the device status as specified by aOperation, aStateMessage, aItemNum, aItemCount, and aProgress.

Parameters
aOperationCurrent operation.
aStateMessageCurrent state message.
aItemNumCurrent item number
aItemCountCurrent total item count.
aProgressProgress of current item.

Definition at line 900 of file sbDeviceStatusHelper.cpp.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: