14c212afeSIngo Weinhold // KPartitioningSystem.h 24c212afeSIngo Weinhold 34c212afeSIngo Weinhold #ifndef _K_PARTITIONING_DISK_DEVICE_SYSTEM_H 44c212afeSIngo Weinhold #define _K_PARTITIONING_DISK_DEVICE_SYSTEM_H 54c212afeSIngo Weinhold 64c212afeSIngo Weinhold #include "KDiskSystem.h" 74c212afeSIngo Weinhold 8*13a452eaSIngo Weinhold struct partition_module_info; 9*13a452eaSIngo Weinhold 104c212afeSIngo Weinhold namespace BPrivate { 114c212afeSIngo Weinhold namespace DiskDevice { 124c212afeSIngo Weinhold 136778f211SIngo Weinhold class KPartitioningSystem : public KDiskSystem { 146778f211SIngo Weinhold public: 154c212afeSIngo Weinhold KPartitioningSystem(const char *name); 164c212afeSIngo Weinhold virtual ~KPartitioningSystem(); 174c212afeSIngo Weinhold 18*13a452eaSIngo Weinhold virtual status_t Init(); 19*13a452eaSIngo Weinhold 204c212afeSIngo Weinhold virtual bool IsFileSystem() const; 214c212afeSIngo Weinhold 224c212afeSIngo Weinhold // Scanning 234c212afeSIngo Weinhold 244c212afeSIngo Weinhold virtual float Identify(KPartition *partition, void **cookie); 254c212afeSIngo Weinhold virtual status_t Scan(KPartition *partition, void *cookie); 264c212afeSIngo Weinhold virtual void FreeIdentifyCookie(KPartition *partition, void *cookie); 274c212afeSIngo Weinhold virtual void FreeCookie(KPartition *partition); 284c212afeSIngo Weinhold virtual void FreeContentCookie(KPartition *partition); 294c212afeSIngo Weinhold 304c212afeSIngo Weinhold // Querying 314c212afeSIngo Weinhold 324c212afeSIngo Weinhold virtual bool SupportsRepairing(KPartition *partition, bool checkOnly, 334c212afeSIngo Weinhold bool *whileMounted); 344c212afeSIngo Weinhold virtual bool SupportsResizing(KPartition *partition, bool *whileMounted); 354c212afeSIngo Weinhold virtual bool SupportsResizingChild(KPartition *child); 364c212afeSIngo Weinhold virtual bool SupportsMoving(KPartition *partition, bool *whileMounted); 374c212afeSIngo Weinhold virtual bool SupportsMovingChild(KPartition *child); 384c212afeSIngo Weinhold virtual bool SupportsParentSystem(KDiskSystem *system); 394c212afeSIngo Weinhold virtual bool SupportsChildSystem(KDiskSystem *system); 404c212afeSIngo Weinhold 414c212afeSIngo Weinhold virtual bool ValidateResize(KPartition *partition, off_t *size); 424c212afeSIngo Weinhold virtual bool ValidateMove(KPartition *partition, off_t *start); 434c212afeSIngo Weinhold virtual bool ValidateResizeChild(KPartition *partition, off_t *size); 444c212afeSIngo Weinhold virtual bool ValidateMoveChild(KPartition *partition, off_t *start); 454c212afeSIngo Weinhold virtual bool ValidateCreateChild(KPartition *partition, off_t *start, 464c212afeSIngo Weinhold off_t *size, const char *parameters); 474c212afeSIngo Weinhold virtual bool ValidateInitialize(KPartition *partition, 484c212afeSIngo Weinhold const char *parameters); 494c212afeSIngo Weinhold virtual bool ValidateSetParameters(KPartition *partition, 504c212afeSIngo Weinhold const char *parameters); 514c212afeSIngo Weinhold virtual bool ValidateSetContentParameters(KPartition *child, 524c212afeSIngo Weinhold const char *parameters); 536778f211SIngo Weinhold virtual int32 CountPartitionableSpaces(KPartition *partition); 544c212afeSIngo Weinhold virtual bool GetPartitionableSpaces(KPartition *partition, 556778f211SIngo Weinhold partitionable_space_data *spaces, 566778f211SIngo Weinhold int32 count, 576778f211SIngo Weinhold int32 *actualCount = NULL); 584c212afeSIngo Weinhold 594c212afeSIngo Weinhold // Writing 604c212afeSIngo Weinhold 614c212afeSIngo Weinhold virtual status_t Repair(KPartition *partition, bool checkOnly, 624c212afeSIngo Weinhold KDiskDeviceJob *job); 634c212afeSIngo Weinhold virtual status_t Resize(KPartition *partition, off_t size, 644c212afeSIngo Weinhold KDiskDeviceJob *job); 654c212afeSIngo Weinhold virtual status_t ResizeChild(KPartition *child, off_t size, 664c212afeSIngo Weinhold KDiskDeviceJob *job); 674c212afeSIngo Weinhold virtual status_t Move(KPartition *partition, off_t offset, 684c212afeSIngo Weinhold KDiskDeviceJob *job); 694c212afeSIngo Weinhold virtual status_t MoveChild(KPartition *child, off_t offset, 704c212afeSIngo Weinhold KDiskDeviceJob *job); 714c212afeSIngo Weinhold virtual status_t CreateChild(KPartition *partition, off_t offset, 724c212afeSIngo Weinhold off_t size, const char *parameters, 734c212afeSIngo Weinhold KDiskDeviceJob *job, 744c212afeSIngo Weinhold KPartition **child = NULL, 754c212afeSIngo Weinhold partition_id childID = -1); 764c212afeSIngo Weinhold virtual status_t DeleteChild(KPartition *child, KDiskDeviceJob *job); 774c212afeSIngo Weinhold virtual status_t Initialize(KPartition *partition, const char *parameters, 784c212afeSIngo Weinhold KDiskDeviceJob *job); 794c212afeSIngo Weinhold virtual status_t SetParameters(KPartition *partition, 804c212afeSIngo Weinhold const char *parameters, 814c212afeSIngo Weinhold KDiskDeviceJob *job); 824c212afeSIngo Weinhold virtual status_t SetContentParameters(KPartition *partition, 834c212afeSIngo Weinhold const char *parameters, 844c212afeSIngo Weinhold KDiskDeviceJob *job); 856778f211SIngo Weinhold 866778f211SIngo Weinhold protected: 876778f211SIngo Weinhold virtual status_t LoadModule(); 886778f211SIngo Weinhold virtual void UnloadModule(); 896778f211SIngo Weinhold 906778f211SIngo Weinhold private: 916778f211SIngo Weinhold partition_module_info *fModule; 924c212afeSIngo Weinhold }; 934c212afeSIngo Weinhold 944c212afeSIngo Weinhold } // namespace DiskDevice 954c212afeSIngo Weinhold } // namespace BPrivate 964c212afeSIngo Weinhold 974c212afeSIngo Weinhold using BPrivate::DiskDevice::KPartitioningSystem; 984c212afeSIngo Weinhold 994c212afeSIngo Weinhold #endif // _K_PARTITIONING_DISK_DEVICE_SYSTEM_H 100