xref: /haiku/headers/private/kernel/disk_device_manager/KPartitioningSystem.h (revision 4c212afefb9c1800bd32243d52a59dcccfecaaa2)
1*4c212afeSIngo Weinhold // KPartitioningSystem.h
2*4c212afeSIngo Weinhold 
3*4c212afeSIngo Weinhold #ifndef _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
4*4c212afeSIngo Weinhold #define _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
5*4c212afeSIngo Weinhold 
6*4c212afeSIngo Weinhold #include "KDiskSystem.h"
7*4c212afeSIngo Weinhold 
8*4c212afeSIngo Weinhold namespace BPrivate {
9*4c212afeSIngo Weinhold namespace DiskDevice {
10*4c212afeSIngo Weinhold 
11*4c212afeSIngo Weinhold class KPartitioningSystem {
12*4c212afeSIngo Weinhold 	KPartitioningSystem(const char *name);
13*4c212afeSIngo Weinhold 	virtual ~KPartitioningSystem();
14*4c212afeSIngo Weinhold 
15*4c212afeSIngo Weinhold 	virtual bool IsFileSystem() const;
16*4c212afeSIngo Weinhold 
17*4c212afeSIngo Weinhold 	virtual status_t Load();		// load/unload -- can be nested
18*4c212afeSIngo Weinhold 	virtual status_t Unload();		//
19*4c212afeSIngo Weinhold 	virtual bool IsLoaded() const;
20*4c212afeSIngo Weinhold 
21*4c212afeSIngo Weinhold 	// Scanning
22*4c212afeSIngo Weinhold 
23*4c212afeSIngo Weinhold 	virtual float Identify(KPartition *partition, void **cookie);
24*4c212afeSIngo Weinhold 	virtual status_t Scan(KPartition *partition, void *cookie);
25*4c212afeSIngo Weinhold 	virtual void FreeIdentifyCookie(KPartition *partition, void *cookie);
26*4c212afeSIngo Weinhold 	virtual void FreeCookie(KPartition *partition);
27*4c212afeSIngo Weinhold 	virtual void FreeContentCookie(KPartition *partition);
28*4c212afeSIngo Weinhold 
29*4c212afeSIngo Weinhold 	// Querying
30*4c212afeSIngo Weinhold 
31*4c212afeSIngo Weinhold 	virtual bool SupportsRepairing(KPartition *partition, bool checkOnly,
32*4c212afeSIngo Weinhold 								   bool *whileMounted);
33*4c212afeSIngo Weinhold 		// Does that makes sense for partitioning systems?
34*4c212afeSIngo Weinhold 	virtual bool SupportsResizing(KPartition *partition, bool *whileMounted);
35*4c212afeSIngo Weinhold 	virtual bool SupportsResizingChild(KPartition *child);
36*4c212afeSIngo Weinhold 	virtual bool SupportsMoving(KPartition *partition, bool *whileMounted);
37*4c212afeSIngo Weinhold 	virtual bool SupportsMovingChild(KPartition *child);
38*4c212afeSIngo Weinhold 	virtual bool SupportsParentSystem(KDiskSystem *system);
39*4c212afeSIngo Weinhold 	virtual bool SupportsChildSystem(KDiskSystem *system);
40*4c212afeSIngo Weinhold 
41*4c212afeSIngo Weinhold 	virtual bool ValidateResize(KPartition *partition, off_t *size);
42*4c212afeSIngo Weinhold 	virtual bool ValidateMove(KPartition *partition, off_t *start);
43*4c212afeSIngo Weinhold 	virtual bool ValidateResizeChild(KPartition *partition, off_t *size);
44*4c212afeSIngo Weinhold 	virtual bool ValidateMoveChild(KPartition *partition, off_t *start);
45*4c212afeSIngo Weinhold 	virtual bool ValidateCreateChild(KPartition *partition, off_t *start,
46*4c212afeSIngo Weinhold 									 off_t *size, const char *parameters);
47*4c212afeSIngo Weinhold 	virtual bool ValidateInitialize(KPartition *partition,
48*4c212afeSIngo Weinhold 									const char *parameters);
49*4c212afeSIngo Weinhold 	virtual bool ValidateSetParameters(KPartition *partition,
50*4c212afeSIngo Weinhold 									   const char *parameters);
51*4c212afeSIngo Weinhold 	virtual bool ValidateSetContentParameters(KPartition *child,
52*4c212afeSIngo Weinhold 											  const char *parameters);
53*4c212afeSIngo Weinhold 	virtual bool GetPartitionableSpaces(KPartition *partition,
54*4c212afeSIngo Weinhold 										partitionable_space_data **spaces,
55*4c212afeSIngo Weinhold 										int32 *count);
56*4c212afeSIngo Weinhold 
57*4c212afeSIngo Weinhold 	// Writing
58*4c212afeSIngo Weinhold 
59*4c212afeSIngo Weinhold 	virtual status_t Repair(KPartition *partition, bool checkOnly,
60*4c212afeSIngo Weinhold 							KDiskDeviceJob *job);
61*4c212afeSIngo Weinhold 	virtual status_t Resize(KPartition *partition, off_t size,
62*4c212afeSIngo Weinhold 							KDiskDeviceJob *job);
63*4c212afeSIngo Weinhold 	virtual status_t ResizeChild(KPartition *child, off_t size,
64*4c212afeSIngo Weinhold 								 KDiskDeviceJob *job);
65*4c212afeSIngo Weinhold 	virtual status_t Move(KPartition *partition, off_t offset,
66*4c212afeSIngo Weinhold 						  KDiskDeviceJob *job);
67*4c212afeSIngo Weinhold 	virtual status_t MoveChild(KPartition *child, off_t offset,
68*4c212afeSIngo Weinhold 							   KDiskDeviceJob *job);
69*4c212afeSIngo Weinhold 	virtual status_t CreateChild(KPartition *partition, off_t offset,
70*4c212afeSIngo Weinhold 								 off_t size, const char *parameters,
71*4c212afeSIngo Weinhold 								 KDiskDeviceJob *job,
72*4c212afeSIngo Weinhold 								 KPartition **child = NULL,
73*4c212afeSIngo Weinhold 								 partition_id childID = -1);
74*4c212afeSIngo Weinhold 	virtual status_t DeleteChild(KPartition *child, KDiskDeviceJob *job);
75*4c212afeSIngo Weinhold 	virtual status_t Initialize(KPartition *partition, const char *parameters,
76*4c212afeSIngo Weinhold 								KDiskDeviceJob *job);
77*4c212afeSIngo Weinhold 	virtual status_t SetParameters(KPartition *partition,
78*4c212afeSIngo Weinhold 								   const char *parameters,
79*4c212afeSIngo Weinhold 								   KDiskDeviceJob *job);
80*4c212afeSIngo Weinhold 	virtual status_t SetContentParameters(KPartition *partition,
81*4c212afeSIngo Weinhold 										  const char *parameters,
82*4c212afeSIngo Weinhold 										  KDiskDeviceJob *job);
83*4c212afeSIngo Weinhold };
84*4c212afeSIngo Weinhold 
85*4c212afeSIngo Weinhold } // namespace DiskDevice
86*4c212afeSIngo Weinhold } // namespace BPrivate
87*4c212afeSIngo Weinhold 
88*4c212afeSIngo Weinhold using BPrivate::DiskDevice::KPartitioningSystem;
89*4c212afeSIngo Weinhold 
90*4c212afeSIngo Weinhold #endif	// _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
91