2007-10-08 05:33:46 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2007, Ingo Weinhold, bonefish@users.sf.net.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _DISK_SYSTEM_ADD_ON_H
|
|
|
|
#define _DISK_SYSTEM_ADD_ON_H
|
|
|
|
|
2010-10-24 07:39:19 +04:00
|
|
|
#include <DiskDeviceDefs.h>
|
2007-10-08 05:33:46 +04:00
|
|
|
#include <String.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
|
2009-07-21 00:29:16 +04:00
|
|
|
class BPartitionParameterEditor;
|
2007-10-08 05:33:46 +04:00
|
|
|
class BList;
|
|
|
|
class BMutablePartition;
|
|
|
|
class BPartitionHandle;
|
|
|
|
class BPartitioningInfo;
|
|
|
|
|
|
|
|
|
|
|
|
class BDiskSystemAddOn {
|
|
|
|
public:
|
|
|
|
BDiskSystemAddOn(const char* name,
|
|
|
|
uint32 flags);
|
|
|
|
virtual ~BDiskSystemAddOn();
|
|
|
|
|
|
|
|
const char* Name() const;
|
|
|
|
uint32 Flags() const;
|
|
|
|
|
|
|
|
virtual status_t CreatePartitionHandle(
|
|
|
|
BMutablePartition* partition,
|
|
|
|
BPartitionHandle** handle) = 0;
|
|
|
|
|
2007-10-11 01:35:22 +04:00
|
|
|
virtual bool CanInitialize(
|
|
|
|
const BMutablePartition* partition);
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateInitialize(
|
2007-10-11 01:35:22 +04:00
|
|
|
const BMutablePartition* partition,
|
2007-10-08 05:33:46 +04:00
|
|
|
BString* name, const char* parameters);
|
|
|
|
virtual status_t Initialize(BMutablePartition* partition,
|
|
|
|
const char* name, const char* parameters,
|
|
|
|
BPartitionHandle** handle);
|
|
|
|
|
2010-10-24 07:39:19 +04:00
|
|
|
virtual status_t GetParameterEditor(
|
|
|
|
B_PARAMETER_EDITOR_TYPE type,
|
|
|
|
BPartitionParameterEditor** editor);
|
2007-10-17 05:01:49 +04:00
|
|
|
virtual status_t GetTypeForContentType(const char* contentType,
|
|
|
|
BString* type);
|
|
|
|
virtual bool IsSubSystemFor(const BMutablePartition* child);
|
|
|
|
|
2007-10-08 05:33:46 +04:00
|
|
|
private:
|
|
|
|
BString fName;
|
|
|
|
uint32 fFlags;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class BPartitionHandle {
|
|
|
|
public:
|
|
|
|
BPartitionHandle(BMutablePartition* partition);
|
|
|
|
virtual ~BPartitionHandle();
|
|
|
|
|
|
|
|
BMutablePartition* Partition() const;
|
|
|
|
|
|
|
|
virtual uint32 SupportedOperations(uint32 mask);
|
|
|
|
virtual uint32 SupportedChildOperations(
|
2007-10-11 01:35:22 +04:00
|
|
|
const BMutablePartition* child,
|
|
|
|
uint32 mask);
|
2007-10-08 05:33:46 +04:00
|
|
|
|
|
|
|
virtual bool SupportsInitializingChild(
|
2007-10-11 01:35:22 +04:00
|
|
|
const BMutablePartition* child,
|
2007-10-08 05:33:46 +04:00
|
|
|
const char* diskSystem);
|
|
|
|
|
2007-10-11 01:35:22 +04:00
|
|
|
virtual status_t GetNextSupportedType(
|
|
|
|
const BMutablePartition* child,
|
2007-10-08 05:33:46 +04:00
|
|
|
int32* cookie, BString* type);
|
|
|
|
// child can be NULL
|
|
|
|
|
|
|
|
virtual status_t GetPartitioningInfo(BPartitioningInfo* info);
|
|
|
|
|
|
|
|
|
2007-10-11 01:35:22 +04:00
|
|
|
virtual status_t Defragment();
|
2007-10-08 05:33:46 +04:00
|
|
|
virtual status_t Repair(bool checkOnly);
|
|
|
|
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateResize(off_t* size);
|
|
|
|
virtual status_t ValidateResizeChild(
|
2007-10-11 01:35:22 +04:00
|
|
|
const BMutablePartition* child,
|
2007-10-08 05:33:46 +04:00
|
|
|
off_t* size);
|
|
|
|
virtual status_t Resize(off_t size);
|
|
|
|
virtual status_t ResizeChild(BMutablePartition* child,
|
|
|
|
off_t size);
|
|
|
|
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateMove(off_t* offset);
|
|
|
|
virtual status_t ValidateMoveChild(
|
2007-10-11 01:35:22 +04:00
|
|
|
const BMutablePartition* child,
|
2007-10-08 05:33:46 +04:00
|
|
|
off_t* offset);
|
|
|
|
virtual status_t Move(off_t offset);
|
|
|
|
virtual status_t MoveChild(BMutablePartition* child,
|
|
|
|
off_t offset);
|
|
|
|
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateSetContentName(BString* name);
|
|
|
|
virtual status_t ValidateSetName(const BMutablePartition* child,
|
2007-10-08 05:33:46 +04:00
|
|
|
BString* name);
|
|
|
|
virtual status_t SetContentName(const char* name);
|
|
|
|
virtual status_t SetName(BMutablePartition* child,
|
|
|
|
const char* name);
|
|
|
|
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateSetType(const BMutablePartition* child,
|
2007-10-08 05:33:46 +04:00
|
|
|
const char* type);
|
|
|
|
virtual status_t SetType(BMutablePartition* child,
|
|
|
|
const char* type);
|
|
|
|
|
2007-10-11 01:35:22 +04:00
|
|
|
virtual status_t GetContentParameterEditor(
|
2009-07-21 00:29:16 +04:00
|
|
|
BPartitionParameterEditor** editor);
|
2010-10-24 07:39:19 +04:00
|
|
|
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateSetContentParameters(
|
2007-10-08 05:33:46 +04:00
|
|
|
const char* parameters);
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateSetParameters(
|
2007-10-11 01:35:22 +04:00
|
|
|
const BMutablePartition* child,
|
2007-10-08 05:33:46 +04:00
|
|
|
const char* parameters);
|
|
|
|
virtual status_t SetContentParameters(const char* parameters);
|
|
|
|
virtual status_t SetParameters(BMutablePartition* child,
|
|
|
|
const char* parameters);
|
|
|
|
|
2010-10-24 07:39:19 +04:00
|
|
|
virtual status_t GetParameterEditor(
|
|
|
|
B_PARAMETER_EDITOR_TYPE type,
|
2009-07-21 00:29:16 +04:00
|
|
|
BPartitionParameterEditor** editor);
|
2007-10-14 01:29:33 +04:00
|
|
|
virtual status_t ValidateCreateChild(off_t* offset,
|
2007-10-08 05:33:46 +04:00
|
|
|
off_t* size, const char* type,
|
2007-10-14 01:29:33 +04:00
|
|
|
BString* name, const char* parameters);
|
2007-10-11 01:35:22 +04:00
|
|
|
virtual status_t CreateChild(off_t offset, off_t size,
|
2007-10-14 01:29:33 +04:00
|
|
|
const char* type, const char* name,
|
|
|
|
const char* parameters,
|
2007-10-11 01:35:22 +04:00
|
|
|
BMutablePartition** child);
|
2007-10-08 05:33:46 +04:00
|
|
|
|
|
|
|
virtual status_t DeleteChild(BMutablePartition* child);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BMutablePartition* fPartition;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" status_t get_disk_system_add_ons(BList* addOns);
|
|
|
|
// Implemented in the add-on
|
|
|
|
|
|
|
|
#endif // _DISK_SYSTEM_ADD_ON_H
|