1 /* 2 * Copyright 2007, Ingo Weinhold, bonefish@users.sf.net. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _EXTENDED_PARTITION_ADD_ON_H 6 #define _EXTENDED_PARTITION_ADD_ON_H 7 8 #include <DiskSystemAddOn.h> 9 10 #include "PartitionMap.h" 11 12 13 class ExtendedPartitionAddOn : public BDiskSystemAddOn { 14 public: 15 ExtendedPartitionAddOn(); 16 virtual ~ExtendedPartitionAddOn(); 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 ExtendedPartitionHandle : public BPartitionHandle { 37 public: 38 ExtendedPartitionHandle( 39 BMutablePartition* partition); 40 virtual ~ExtendedPartitionHandle(); 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 GetNextSupportedType( 50 const BMutablePartition* child, 51 int32* cookie, BString* type); 52 53 virtual status_t GetPartitioningInfo(BPartitioningInfo* info); 54 55 virtual status_t GetChildCreationParameterEditor( 56 const char* type, 57 BDiskDeviceParameterEditor** editor); 58 virtual status_t ValidateCreateChild(off_t* offset, 59 off_t* size, const char* type, 60 BString* name, const char* parameters); 61 virtual status_t CreateChild(off_t offset, off_t size, 62 const char* type, const char* name, 63 const char* parameters, 64 BMutablePartition** child); 65 private: 66 PrimaryPartition* fPrimaryPartition; 67 }; 68 69 70 #endif // _EXTENDED_PARTITION_ADD_ON_H 71