2 * Copyright 2003-2007, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2003, Tyler Akidau, haiku@akidau.net.
4 * Distributed under the terms of the MIT License.
12 struct user_disk_device_data
;
14 class BDiskDevice
: public BPartition
{
17 virtual ~BDiskDevice();
19 bool HasMedia() const;
20 bool IsRemovableMedia() const;
21 bool IsReadOnlyMedia() const;
22 bool IsWriteOnceMedia() const;
24 status_t
Eject(bool update
= false);
26 status_t
SetTo(partition_id id
);
27 status_t
Update(bool* updated
= NULL
);
29 status_t
InitCheck() const;
31 virtual status_t
GetPath(BPath
* path
) const;
33 bool IsModified() const;
34 status_t
PrepareModifications();
35 status_t
CommitModifications(bool synchronously
= true,
36 BMessenger progressMessenger
= BMessenger(),
37 bool receiveCompleteProgressUpdates
= true);
38 status_t
CancelModifications();
41 status_t
GetFilePath(BPath
* path
) const;
44 friend class BDiskDeviceList
;
45 friend class BDiskDeviceRoster
;
47 BDiskDevice(const BDiskDevice
&);
48 BDiskDevice
& operator=(const BDiskDevice
&);
50 static status_t
_GetData(partition_id id
, bool deviceOnly
,
52 user_disk_device_data
** data
);
54 status_t
_SetTo(partition_id id
, bool deviceOnly
,
56 status_t
_SetTo(user_disk_device_data
* data
);
57 status_t
_Update(bool* updated
);
58 status_t
_Update(user_disk_device_data
* data
,
61 static void _ClearUserData(user_partition_data
* data
);
63 virtual bool _AcceptVisitor(BDiskDeviceVisitor
* visitor
,
66 user_disk_device_data
* fDeviceData
;
69 #endif // _DISK_DEVICE_H