1 /* 2 * Copyright 2007, Ingo Weinhold, bonefish@users.sf.net. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _PARTITION_MAP_ADD_ON_H 6 #define _PARTITION_MAP_ADD_ON_H 7 8 #include <DiskSystemAddOn.h> 9 10 #include "PartitionMap.h" 11 12 13 class PartitionMapAddOn : public BDiskSystemAddOn { 14 public: 15 PartitionMapAddOn(); 16 virtual ~PartitionMapAddOn(); 17 18 virtual status_t CreatePartitionHandle( 19 BMutablePartition* partition, 20 BPartitionHandle** handle); 21 22 virtual bool CanInitialize( 23 const BMutablePartition* partition); 24 virtual status_t GetInitializationParameterEditor( 25 const BMutablePartition* partition, 26 BDiskDeviceParameterEditor** editor); 27 virtual status_t ValidateInitialize( 28 const BMutablePartition* partition, 29 BString* name, const char* parameters); 30 virtual status_t Initialize(BMutablePartition* partition, 31 const char* name, const char* parameters, 32 BPartitionHandle** handle); 33 }; 34 35 36 class PartitionMapHandle : public BPartitionHandle { 37 public: 38 PartitionMapHandle( 39 BMutablePartition* partition); 40 virtual ~PartitionMapHandle(); 41 42 status_t Init(); 43 44 virtual uint32 SupportedOperations(uint32 mask); 45 virtual uint32 SupportedChildOperations( 46 const BMutablePartition* child, 47 uint32 mask); 48 49 virtual status_t GetPartitioningInfo(BPartitioningInfo* info); 50 51 virtual status_t GetChildCreationParameterEditor( 52 const char* type, 53 BDiskDeviceParameterEditor** editor); 54 virtual status_t ValidateCreateChild(off_t* offset, 55 off_t* size, const char* type, 56 BString* name, const char* parameters); 57 virtual status_t CreateChild(off_t offset, off_t size, 58 const char* type, const char* name, 59 const char* parameters, 60 BMutablePartition** child); 61 62 private: 63 PartitionMap fPartitionMap; 64 }; 65 66 67 #endif // _PARTITION_MAP_ADD_ON_H 68