2003-02-01 01:05:09 +03:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
2003-02-01 00:17:20 +03:00
|
|
|
|
|
|
|
#ifndef _DISK_DEVICE_H
|
|
|
|
#define _DISK_DEVICE_H
|
|
|
|
|
2003-07-07 03:11:10 +04:00
|
|
|
#include <Partition.h>
|
|
|
|
|
|
|
|
struct user_disk_device_data;
|
|
|
|
|
2003-05-29 01:43:58 +04:00
|
|
|
class BDiskDevice : public BPartition {
|
2003-02-01 00:17:20 +03:00
|
|
|
public:
|
2003-07-07 03:11:10 +04:00
|
|
|
BDiskDevice();
|
|
|
|
virtual ~BDiskDevice();
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
bool HasMedia() const;
|
2003-07-09 03:28:32 +04:00
|
|
|
bool IsRemovableMedia() const;
|
|
|
|
bool IsReadOnlyMedia() const;
|
|
|
|
bool IsWriteOnceMedia() const;
|
2003-02-01 00:17:20 +03:00
|
|
|
|
2003-02-16 21:03:59 +03:00
|
|
|
status_t Eject(bool update = false);
|
2003-02-01 00:17:20 +03:00
|
|
|
|
2003-07-15 05:15:17 +04:00
|
|
|
status_t SetTo(partition_id id);
|
2003-02-16 21:03:59 +03:00
|
|
|
status_t Update(bool *updated = NULL);
|
2003-05-29 01:46:11 +04:00
|
|
|
void Unset();
|
2003-07-15 05:15:17 +04:00
|
|
|
status_t InitCheck() const;
|
2003-07-07 03:11:10 +04:00
|
|
|
|
|
|
|
virtual status_t GetPath(BPath *path) const;
|
|
|
|
|
2003-05-29 01:46:11 +04:00
|
|
|
bool IsModified() const;
|
2003-07-07 03:11:10 +04:00
|
|
|
status_t PrepareModifications();
|
2003-06-10 03:02:16 +04:00
|
|
|
status_t CommitModifications(bool synchronously = true,
|
2003-05-29 01:46:11 +04:00
|
|
|
BMessenger progressMessenger = BMessenger(),
|
2003-07-07 03:11:10 +04:00
|
|
|
bool receiveCompleteProgressUpdates = true);
|
|
|
|
status_t CancelModifications();
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
private:
|
2003-02-20 03:22:09 +03:00
|
|
|
friend class BDiskDeviceList;
|
2003-02-08 03:39:38 +03:00
|
|
|
friend class BDiskDeviceRoster;
|
|
|
|
|
2003-07-22 04:19:23 +04:00
|
|
|
BDiskDevice::BDiskDevice(const BDiskDevice &);
|
|
|
|
BDiskDevice &BDiskDevice::operator=(const BDiskDevice &);
|
|
|
|
|
|
|
|
static status_t _GetData(partition_id id, bool deviceOnly, bool shadow,
|
|
|
|
size_t neededSize, user_disk_device_data **data);
|
|
|
|
|
2003-07-15 05:15:17 +04:00
|
|
|
status_t _SetTo(partition_id id, bool deviceOnly, bool shadow,
|
|
|
|
size_t neededSize);
|
2003-07-08 22:26:15 +04:00
|
|
|
status_t _SetTo(user_disk_device_data *data);
|
2003-07-22 04:19:23 +04:00
|
|
|
status_t _Update(bool shadow, bool *updated);
|
|
|
|
status_t _Update(user_disk_device_data *data, bool *updated);
|
2003-07-08 22:26:15 +04:00
|
|
|
|
|
|
|
virtual bool _AcceptVisitor(BDiskDeviceVisitor *visitor, int32 level);
|
2003-05-29 01:43:58 +04:00
|
|
|
|
2003-07-07 03:11:10 +04:00
|
|
|
user_disk_device_data *fDeviceData;
|
|
|
|
};
|
2003-02-01 00:17:20 +03:00
|
|
|
|
|
|
|
#endif // _DISK_DEVICE_H
|