2 * Copyright 2003-2007, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _DISK_DEVICE_LIST_H
6 #define _DISK_DEVICE_LIST_H
9 #include <DiskDeviceDefs.h>
10 #include <DiskDeviceVisitor.h>
12 #include <ObjectList.h>
15 class BDiskDeviceRoster
;
21 class BDiskDeviceList
: public BHandler
{
23 BDiskDeviceList(bool useOwnLocker
= true);
24 virtual ~BDiskDeviceList();
26 virtual void MessageReceived(BMessage
*message
);
27 virtual void SetNextHandler(BHandler
*handler
);
35 int32
CountDevices() const;
36 BDiskDevice
*DeviceAt(int32 index
) const;
38 BDiskDevice
*VisitEachDevice(BDiskDeviceVisitor
*visitor
);
39 BPartition
*VisitEachPartition(BDiskDeviceVisitor
*visitor
);
41 BPartition
*VisitEachMountedPartition(BDiskDeviceVisitor
*visitor
);
42 BPartition
*VisitEachMountablePartition(BDiskDeviceVisitor
*visitor
);
44 BDiskDevice
*DeviceWithID(partition_id id
) const;
45 BPartition
*PartitionWithID(partition_id id
) const;
47 virtual void MountPointMoved(BPartition
*partition
);
48 virtual void PartitionMounted(BPartition
*partition
);
49 virtual void PartitionUnmounted(BPartition
*partition
);
50 virtual void PartitionInitialized(BPartition
*partition
);
51 virtual void PartitionResized(BPartition
*partition
);
52 virtual void PartitionMoved(BPartition
*partition
);
53 virtual void PartitionCreated(BPartition
*partition
);
54 virtual void PartitionDeleted(BPartition
*partition
,
55 partition_id partitionID
);
56 virtual void PartitionDefragmented(BPartition
*partition
);
57 virtual void PartitionRepaired(BPartition
*partition
);
58 virtual void PartitionChanged(BPartition
*partition
, uint32 event
);
59 virtual void MediaChanged(BDiskDevice
*device
);
60 virtual void DeviceAdded(BDiskDevice
*device
);
61 virtual void DeviceRemoved(BDiskDevice
*device
);
64 status_t
_StartWatching();
67 void _MountPointMoved(BMessage
*message
);
68 void _PartitionMounted(BMessage
*message
);
69 void _PartitionUnmounted(BMessage
*message
);
70 void _PartitionInitialized(BMessage
*message
);
71 void _PartitionResized(BMessage
*message
);
72 void _PartitionMoved(BMessage
*message
);
73 void _PartitionCreated(BMessage
*message
);
74 void _PartitionDeleted(BMessage
*message
);
75 void _PartitionDefragmented(BMessage
*message
);
76 void _PartitionRepaired(BMessage
*message
);
77 void _MediaChanged(BMessage
*message
);
78 void _DeviceAdded(BMessage
*message
);
79 void _DeviceRemoved(BMessage
*message
);
81 BDiskDevice
*_FindDevice(BMessage
*message
);
82 BPartition
*_FindPartition(BMessage
*message
);
84 BDiskDevice
*_UpdateDevice(BMessage
*message
);
88 BObjectList
<BDiskDevice
> fDevices
;
92 #endif // _DISK_DEVICE_LIST_H