2003-05-29 01:46:11 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef _DISK_DEVICE_JOB_H
|
|
|
|
#define _DISK_DEVICE_JOB_H
|
|
|
|
|
2003-05-29 01:51:24 +04:00
|
|
|
#include <String.h>
|
|
|
|
|
2003-05-29 01:46:11 +04:00
|
|
|
// disk device job types
|
|
|
|
enum {
|
|
|
|
B_DISK_DEVICE_JOB_CREATE,
|
|
|
|
B_DISK_DEVICE_JOB_DELETE,
|
|
|
|
B_DISK_DEVICE_JOB_INITIALIZE,
|
|
|
|
B_DISK_DEVICE_JOB_RESIZE,
|
|
|
|
B_DISK_DEVICE_JOB_MOVE,
|
|
|
|
B_DISK_DEVICE_JOB_DEFRAGMENT,
|
|
|
|
B_DISK_DEVICE_JOB_REPAIR,
|
2003-05-29 01:47:29 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// disk device job statuses
|
|
|
|
enum {
|
|
|
|
B_DISK_DEVICE_JOB_UNINITIALIZED,
|
|
|
|
B_DISK_DEVICE_JOB_SCHEDULED,
|
|
|
|
B_DISK_DEVICE_JOB_IN_PROGRESS,
|
|
|
|
B_DISK_DEVICE_JOB_SUCCEEDED,
|
|
|
|
B_DISK_DEVICE_JOB_FAILED,
|
|
|
|
B_DISK_DEVICE_JOB_CANCELED,
|
|
|
|
};
|
2003-05-29 01:46:11 +04:00
|
|
|
|
2003-06-10 03:02:16 +04:00
|
|
|
// disk device job progress info
|
|
|
|
struct disk_device_progress_info {
|
|
|
|
int32 task_count;
|
|
|
|
int32 completed_tasks;
|
|
|
|
float current_task_progress;
|
|
|
|
char current_task_description[256];
|
|
|
|
};
|
|
|
|
|
|
|
|
// disk device job cancel properties
|
|
|
|
enum {
|
|
|
|
B_DISK_DEVICE_JOB_CAN_CANCEL = 0x01,
|
|
|
|
B_DISK_DEVICE_JOB_STOP_ON_CANCEL = 0x02,
|
|
|
|
B_DISK_DEVICE_JOB_REVERSE_ON_CANCEL = 0x04,
|
|
|
|
};
|
|
|
|
|
2003-05-29 01:46:11 +04:00
|
|
|
class BDiskDeviceJob {
|
|
|
|
public:
|
2003-06-10 03:02:16 +04:00
|
|
|
disk_job_id ID() const;
|
2003-05-29 01:46:11 +04:00
|
|
|
uint32 Type() const;
|
2003-05-29 01:51:24 +04:00
|
|
|
float Progress() const; // [0.0, 1.0]
|
2003-05-29 01:47:29 +04:00
|
|
|
uint32 Status() const;
|
2003-05-29 01:46:11 +04:00
|
|
|
const char *Description() const;
|
2003-06-10 03:02:16 +04:00
|
|
|
status_t GetProgressInfo(disk_devive_progress_info *info) const;
|
|
|
|
uint32 CancelProperties() const;
|
2003-06-11 02:43:52 +04:00
|
|
|
// TODO: Add Cancel() and Pause(), SupportsPause().
|
2003-05-29 01:46:11 +04:00
|
|
|
|
2003-06-10 03:02:16 +04:00
|
|
|
partition_id PartitionID() const;
|
|
|
|
|
2003-05-29 01:46:11 +04:00
|
|
|
private:
|
2003-06-10 03:02:16 +04:00
|
|
|
disk_job_id fJobID;
|
|
|
|
uint32 fType;
|
|
|
|
partition_id fPartitionID;
|
|
|
|
BString fDescription;
|
2003-05-29 01:46:11 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _DISK_DEVICE_JOB_H
|