xref: /haiku/headers/private/kernel/disk_device_manager/KPartitioningSystem.h (revision 285f4cf441dbc269553bee753d151cbf0074f232)
1d86af8ceSIngo Weinhold /*
2*285f4cf4SIngo Weinhold  * Copyright 2003-2011, Haiku, Inc. All Rights Reserved.
3d86af8ceSIngo Weinhold  * Distributed under the terms of the MIT License.
4d86af8ceSIngo Weinhold  *
5d86af8ceSIngo Weinhold  * Authors:
6d86af8ceSIngo Weinhold  *		Ingo Weinhold <bonefish@cs.tu-berlin.de>
7d86af8ceSIngo Weinhold  */
84c212afeSIngo Weinhold #ifndef _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
94c212afeSIngo Weinhold #define _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
104c212afeSIngo Weinhold 
114c212afeSIngo Weinhold #include "KDiskSystem.h"
124c212afeSIngo Weinhold 
137b45b55bSIngo Weinhold 
1413a452eaSIngo Weinhold struct partition_module_info;
1513a452eaSIngo Weinhold 
167b45b55bSIngo Weinhold 
174c212afeSIngo Weinhold namespace BPrivate {
184c212afeSIngo Weinhold namespace DiskDevice {
194c212afeSIngo Weinhold 
207b45b55bSIngo Weinhold 
212dc6403dSIngo Weinhold /**
222dc6403dSIngo Weinhold  * 	\brief Wrapper for the C interface of a partitioning system add-on.
232dc6403dSIngo Weinhold  *
242dc6403dSIngo Weinhold  * 	See \ref ddm_modules.h for better description of the interface.
252dc6403dSIngo Weinhold  */
266778f211SIngo Weinhold class KPartitioningSystem : public KDiskSystem {
276778f211SIngo Weinhold public:
284c212afeSIngo Weinhold 								KPartitioningSystem(const char* name);
294c212afeSIngo Weinhold 	virtual						~KPartitioningSystem();
304c212afeSIngo Weinhold 
3113a452eaSIngo Weinhold 	virtual	status_t			Init();
3213a452eaSIngo Weinhold 
334c212afeSIngo Weinhold 	// Scanning
344c212afeSIngo Weinhold 
354c212afeSIngo Weinhold 	virtual	float				Identify(KPartition* partition, void** cookie);
364c212afeSIngo Weinhold 	virtual	status_t			Scan(KPartition* partition, void* cookie);
377b45b55bSIngo Weinhold 	virtual	void				FreeIdentifyCookie(KPartition* partition,
387b45b55bSIngo Weinhold 									void* cookie);
394c212afeSIngo Weinhold 	virtual	void				FreeCookie(KPartition* partition);
404c212afeSIngo Weinhold 	virtual	void				FreeContentCookie(KPartition* partition);
414c212afeSIngo Weinhold 
424c212afeSIngo Weinhold 	// Writing
434c212afeSIngo Weinhold 
444c212afeSIngo Weinhold 	virtual	status_t			Repair(KPartition* partition, bool checkOnly,
457b45b55bSIngo Weinhold 									disk_job_id job);
464c212afeSIngo Weinhold 	virtual	status_t			Resize(KPartition* partition, off_t size,
477b45b55bSIngo Weinhold 									disk_job_id job);
484c212afeSIngo Weinhold 	virtual	status_t			ResizeChild(KPartition* child, off_t size,
497b45b55bSIngo Weinhold 									disk_job_id job);
504c212afeSIngo Weinhold 	virtual	status_t			Move(KPartition* partition, off_t offset,
517b45b55bSIngo Weinhold 									disk_job_id job);
524c212afeSIngo Weinhold 	virtual	status_t			MoveChild(KPartition* child, off_t offset,
537b45b55bSIngo Weinhold 									disk_job_id job);
547b45b55bSIngo Weinhold 	virtual	status_t			SetName(KPartition* partition, const char* name,
557b45b55bSIngo Weinhold 									disk_job_id job);
567b45b55bSIngo Weinhold 	virtual	status_t			SetContentName(KPartition* partition,
577b45b55bSIngo Weinhold 									const char* name, disk_job_id job);
587b45b55bSIngo Weinhold 	virtual	status_t			SetType(KPartition* partition, const char* type,
597b45b55bSIngo Weinhold 									disk_job_id job);
60708a31baSIngo Weinhold 	virtual	status_t			SetParameters(KPartition* partition,
617b45b55bSIngo Weinhold 									const char* parameters, disk_job_id job);
62708a31baSIngo Weinhold 	virtual	status_t			SetContentParameters(KPartition* partition,
637b45b55bSIngo Weinhold 									const char* parameters, disk_job_id job);
647b45b55bSIngo Weinhold 	virtual	status_t			Initialize(KPartition* partition,
657b45b55bSIngo Weinhold 									const char* name, const char* parameters,
667b45b55bSIngo Weinhold 									disk_job_id job);
67*285f4cf4SIngo Weinhold 	virtual	status_t			Uninitialize(KPartition* partition,
68*285f4cf4SIngo Weinhold 									disk_job_id job);
694c212afeSIngo Weinhold 	virtual	status_t			CreateChild(KPartition* partition, off_t offset,
70b22221adSIngo Weinhold 									off_t size, const char* type,
717b45b55bSIngo Weinhold 									const char* name, const char* parameters,
727b45b55bSIngo Weinhold 									disk_job_id job, KPartition** child = NULL,
734c212afeSIngo Weinhold 									partition_id childID = -1);
747b45b55bSIngo Weinhold 	virtual	status_t			DeleteChild(KPartition* child, disk_job_id job);
756778f211SIngo Weinhold 
766778f211SIngo Weinhold protected:
776778f211SIngo Weinhold 	virtual	status_t			LoadModule();
786778f211SIngo Weinhold 	virtual	void				UnloadModule();
796778f211SIngo Weinhold 
806778f211SIngo Weinhold private:
816778f211SIngo Weinhold 			partition_module_info* fModule;
824c212afeSIngo Weinhold };
834c212afeSIngo Weinhold 
847b45b55bSIngo Weinhold 
854c212afeSIngo Weinhold } // namespace DiskDevice
864c212afeSIngo Weinhold } // namespace BPrivate
874c212afeSIngo Weinhold 
884c212afeSIngo Weinhold using BPrivate::DiskDevice::KPartitioningSystem;
894c212afeSIngo Weinhold 
904c212afeSIngo Weinhold #endif	// _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
91