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-07-07 03:11:10 +04:00
|
|
|
#include <DiskDeviceDefs.h>
|
2003-05-29 01:51:24 +04:00
|
|
|
#include <String.h>
|
|
|
|
|
2003-07-30 21:52:39 +04:00
|
|
|
struct user_disk_device_job_info;
|
|
|
|
|
2003-05-29 01:46:11 +04:00
|
|
|
class BDiskDeviceJob {
|
|
|
|
public:
|
2003-07-30 21:52:39 +04:00
|
|
|
BDiskDeviceJob();
|
|
|
|
~BDiskDeviceJob();
|
|
|
|
|
|
|
|
status_t SetTo(disk_job_id id);
|
|
|
|
void Unset();
|
|
|
|
status_t InitCheck() const;
|
|
|
|
|
2003-06-10 03:02:16 +04:00
|
|
|
disk_job_id ID() const;
|
2003-07-30 21:52:39 +04:00
|
|
|
uint32 Type() const;
|
2003-07-07 03:11:10 +04:00
|
|
|
partition_id PartitionID() const;
|
2003-07-30 21:52:39 +04:00
|
|
|
const char *Description() const;
|
2003-07-07 03:11:10 +04:00
|
|
|
|
2003-05-29 01:47:29 +04:00
|
|
|
uint32 Status() const;
|
2003-07-30 21:52:39 +04:00
|
|
|
float Progress() const; // [0.0, 1.0]
|
2003-07-30 04:33:32 +04:00
|
|
|
status_t GetProgressInfo(disk_device_job_progress_info *info) const;
|
2003-07-07 03:11:10 +04:00
|
|
|
uint32 InterruptProperties() const;
|
2003-06-10 03:02:16 +04:00
|
|
|
|
2003-07-30 04:33:32 +04:00
|
|
|
status_t Cancel(bool reverse = false);
|
2003-07-07 03:11:10 +04:00
|
|
|
status_t Pause();
|
|
|
|
|
2003-05-29 01:46:11 +04:00
|
|
|
private:
|
2003-07-30 21:52:39 +04:00
|
|
|
status_t _SetTo(user_disk_device_job_info *info);
|
|
|
|
|
|
|
|
friend class BDiskDeviceRoster;
|
|
|
|
|
|
|
|
disk_job_id fID;
|
2003-06-10 03:02:16 +04:00
|
|
|
uint32 fType;
|
|
|
|
partition_id fPartitionID;
|
|
|
|
BString fDescription;
|
2003-05-29 01:46:11 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _DISK_DEVICE_JOB_H
|