1 /* 2 * Copyright 2003-2011, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold <bonefish@cs.tu-berlin.de> 7 */ 8 #ifndef _K_PARTITIONING_DISK_DEVICE_SYSTEM_H 9 #define _K_PARTITIONING_DISK_DEVICE_SYSTEM_H 10 11 #include "KDiskSystem.h" 12 13 14 struct partition_module_info; 15 16 17 namespace BPrivate { 18 namespace DiskDevice { 19 20 21 /** 22 * \brief Wrapper for the C interface of a partitioning system add-on. 23 * 24 * See \ref ddm_modules.h for better description of the interface. 25 */ 26 class KPartitioningSystem : public KDiskSystem { 27 public: 28 KPartitioningSystem(const char* name); 29 virtual ~KPartitioningSystem(); 30 31 virtual status_t Init(); 32 33 // Scanning 34 35 virtual float Identify(KPartition* partition, void** cookie); 36 virtual status_t Scan(KPartition* partition, void* cookie); 37 virtual void FreeIdentifyCookie(KPartition* partition, 38 void* cookie); 39 virtual void FreeCookie(KPartition* partition); 40 virtual void FreeContentCookie(KPartition* partition); 41 42 // Writing 43 44 virtual status_t Repair(KPartition* partition, bool checkOnly, 45 disk_job_id job); 46 virtual status_t Resize(KPartition* partition, off_t size, 47 disk_job_id job); 48 virtual status_t ResizeChild(KPartition* child, off_t size, 49 disk_job_id job); 50 virtual status_t Move(KPartition* partition, off_t offset, 51 disk_job_id job); 52 virtual status_t MoveChild(KPartition* child, off_t offset, 53 disk_job_id job); 54 virtual status_t SetName(KPartition* partition, const char* name, 55 disk_job_id job); 56 virtual status_t SetContentName(KPartition* partition, 57 const char* name, disk_job_id job); 58 virtual status_t SetType(KPartition* partition, const char* type, 59 disk_job_id job); 60 virtual status_t SetParameters(KPartition* partition, 61 const char* parameters, disk_job_id job); 62 virtual status_t SetContentParameters(KPartition* partition, 63 const char* parameters, disk_job_id job); 64 virtual status_t Initialize(KPartition* partition, 65 const char* name, const char* parameters, 66 disk_job_id job); 67 virtual status_t Uninitialize(KPartition* partition, 68 disk_job_id job); 69 virtual status_t CreateChild(KPartition* partition, off_t offset, 70 off_t size, const char* type, 71 const char* name, const char* parameters, 72 disk_job_id job, KPartition** child = NULL, 73 partition_id childID = -1); 74 virtual status_t DeleteChild(KPartition* child, disk_job_id job); 75 76 protected: 77 virtual status_t LoadModule(); 78 virtual void UnloadModule(); 79 80 private: 81 partition_module_info* fModule; 82 }; 83 84 85 } // namespace DiskDevice 86 } // namespace BPrivate 87 88 using BPrivate::DiskDevice::KPartitioningSystem; 89 90 #endif // _K_PARTITIONING_DISK_DEVICE_SYSTEM_H 91