#include <sbDeviceStatusHelper.h>
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 () |
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.
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.
sbDeviceStatusHelper::sbDeviceStatusHelper | ( | sbBaseDevice * | aDevice | ) |
Construct a device status helper object.
aDevice | Device 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.
nsresult sbDeviceStatusHelper::ChangeState | ( | PRUint32 | aState | ) |
Change the device state to the state specified by aState.
aState | New device state. |
Definition at line 808 of file sbDeviceStatusHelper.cpp.
nsresult sbDeviceStatusHelper::GetCurrentStatus | ( | sbIDeviceStatus ** | aCurrentStatus | ) |
Return in aCurrentStatus the current device status.
aCurrentStatus | Returned current device status. |
Definition at line 879 of file sbDeviceStatusHelper.cpp.
|
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.
void sbDeviceStatusHelper::ItemComplete | ( | nsresult | aResult | ) |
Process the completion of the current item with the result specified by aResult.
aResult | Completion result of item. |
Definition at line 717 of file sbDeviceStatusHelper.cpp.
void sbDeviceStatusHelper::ItemProgress | ( | double | aProgress | ) |
Process the progress of the current item with the progress specified by aProgress.
aProgress | Progress of current item. |
Definition at line 646 of file sbDeviceStatusHelper.cpp.
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.
aItemNum | Current item number. Defaults to -1. |
aItemCount | Current total item count. Defaults to -1. |
Definition at line 510 of file sbDeviceStatusHelper.cpp.
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.
aMediaList | Media list. |
aMediaItem | Media item being started. |
aItemNum | Current item number. Defaults to -1. |
aItemCount | Current total item count. Defaults to -1. |
Definition at line 620 of file sbDeviceStatusHelper.cpp.
void sbDeviceStatusHelper::OperationComplete | ( | nsresult | aResult | ) |
Process the completion of the current operation with the result specified by aResult.
aResult | Completion result of operation. |
Definition at line 383 of file sbDeviceStatusHelper.cpp.
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.
aOperationType | Type of operation. |
aItemNum | Current item number |
aItemCount | Current total item count. |
aMediaList | Operation media list. Defaulted to nsnull. |
aMediaItem | Operation media item. Defaulted to nsnull. |
Definition at line 245 of file sbDeviceStatusHelper.cpp.
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.
aOperation | Current operation. |
aStateMessage | Current state message. |
aItemNum | Current item number |
aItemCount | Current total item count. |
aProgress | Progress of current item. |
Definition at line 900 of file sbDeviceStatusHelper.cpp.