2003-07-05 03:45:26 +04:00
|
|
|
// KPartition.h
|
|
|
|
|
|
|
|
#ifndef _K_DISK_DEVICE_SHADOW_PARTITION_H
|
|
|
|
#define _K_DISK_DEVICE_SHADOW_PARTITION_H
|
|
|
|
|
2003-09-29 02:04:13 +04:00
|
|
|
#include <KPartition.h>
|
|
|
|
#include <KPartitionListener.h>
|
2003-07-05 03:45:26 +04:00
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
namespace DiskDevice {
|
|
|
|
|
|
|
|
class KPhysicalPartition;
|
|
|
|
|
2003-09-29 02:04:13 +04:00
|
|
|
class KShadowPartition : public KPartition, private KPartitionListener {
|
2003-07-05 03:45:26 +04:00
|
|
|
public:
|
|
|
|
KShadowPartition(KPhysicalPartition *physicalPartition);
|
|
|
|
virtual ~KShadowPartition();
|
|
|
|
|
|
|
|
// Hierarchy
|
|
|
|
|
|
|
|
virtual status_t CreateChild(partition_id id, int32 index,
|
|
|
|
KPartition **child = NULL);
|
|
|
|
|
|
|
|
// Shadow Partition
|
|
|
|
|
2003-07-07 03:01:22 +04:00
|
|
|
virtual KShadowPartition *ShadowPartition() const;
|
2003-07-05 03:45:26 +04:00
|
|
|
virtual bool IsShadowPartition() const;
|
2003-07-07 03:01:22 +04:00
|
|
|
void UnsetPhysicalPartition();
|
|
|
|
virtual KPhysicalPartition *PhysicalPartition() const;
|
|
|
|
|
|
|
|
void SyncWithPhysicalPartition();
|
2003-07-05 03:45:26 +04:00
|
|
|
|
2003-07-15 05:00:24 +04:00
|
|
|
virtual void WriteUserData(UserDataWriter &writer,
|
|
|
|
user_partition_data *data);
|
|
|
|
|
2003-07-05 03:45:26 +04:00
|
|
|
virtual void Dump(bool deep, int32 level);
|
|
|
|
|
2003-09-29 02:04:13 +04:00
|
|
|
private:
|
|
|
|
virtual void OffsetChanged(KPartition *partition, off_t offset);
|
|
|
|
virtual void SizeChanged(KPartition *partition, off_t size);
|
|
|
|
virtual void ContentSizeChanged(KPartition *partition, off_t size);
|
|
|
|
virtual void BlockSizeChanged(KPartition *partition, uint32 blockSize);
|
|
|
|
virtual void IndexChanged(KPartition *partition, int32 index);
|
|
|
|
virtual void StatusChanged(KPartition *partition, uint32 status);
|
|
|
|
virtual void FlagsChanged(KPartition *partition, uint32 flags);
|
|
|
|
virtual void NameChanged(KPartition *partition, const char *name);
|
|
|
|
virtual void ContentNameChanged(KPartition *partition, const char *name);
|
|
|
|
virtual void TypeChanged(KPartition *partition, const char *type);
|
|
|
|
virtual void IDChanged(KPartition *partition, partition_id id);
|
|
|
|
virtual void VolumeIDChanged(KPartition *partition, dev_t volumeID);
|
|
|
|
virtual void MountCookieChanged(KPartition *partition, void *cookie);
|
|
|
|
virtual void ParametersChanged(KPartition *partition,
|
|
|
|
const char *parameters);
|
|
|
|
virtual void ContentParametersChanged(KPartition *partition,
|
|
|
|
const char *parameters);
|
|
|
|
virtual void ChildAdded(KPartition *partition, KPartition *child,
|
|
|
|
int32 index);
|
|
|
|
virtual void ChildRemoved(KPartition *partition, KPartition *child,
|
|
|
|
int32 index);
|
|
|
|
virtual void DiskSystemChanged(KPartition *partition,
|
|
|
|
KDiskSystem *diskSystem);
|
|
|
|
virtual void CookieChanged(KPartition *partition, void *cookie);
|
|
|
|
virtual void ContentCookieChanged(KPartition *partition, void *cookie);
|
|
|
|
|
|
|
|
private:
|
2003-07-05 03:45:26 +04:00
|
|
|
KPhysicalPartition *fPhysicalPartition;
|
2003-09-29 02:04:13 +04:00
|
|
|
|
2003-07-05 03:45:26 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace DiskDevice
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
using BPrivate::DiskDevice::KShadowPartition;
|
|
|
|
|
|
|
|
#endif // _K_DISK_DEVICE_SHADOW_PARTITION_H
|