2003-02-01 01:05:09 +03:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
2003-02-01 00:17:20 +03:00
|
|
|
|
|
|
|
#ifndef _SESSION_H
|
|
|
|
#define _SESSION_H
|
|
|
|
|
|
|
|
#include <DiskDeviceVisitor.h>
|
2003-02-08 03:39:38 +03:00
|
|
|
#include <disk_scanner.h>
|
2003-02-01 00:17:20 +03:00
|
|
|
#include <ObjectList.h>
|
2003-02-23 02:52:15 +03:00
|
|
|
#include <Rect.h>
|
2003-02-01 00:17:20 +03:00
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
class BDiskDevice;
|
|
|
|
class BPartition;
|
|
|
|
|
2003-02-01 21:12:03 +03:00
|
|
|
extern const char *B_INTEL_PARTITIONING;
|
2003-02-01 00:17:20 +03:00
|
|
|
|
|
|
|
class BSession {
|
|
|
|
public:
|
2003-02-08 03:39:38 +03:00
|
|
|
~BSession();
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
BDiskDevice *Device() const;
|
|
|
|
|
|
|
|
off_t Offset() const;
|
|
|
|
off_t Size() const;
|
2003-02-08 03:39:38 +03:00
|
|
|
int32 BlockSize() const;
|
2003-02-01 00:17:20 +03:00
|
|
|
|
|
|
|
int32 CountPartitions() const;
|
|
|
|
BPartition *PartitionAt(int32 index) const;
|
|
|
|
|
|
|
|
int32 Index() const;
|
|
|
|
|
|
|
|
uint32 Flags() const;
|
|
|
|
bool IsAudio() const;
|
|
|
|
bool IsData() const;
|
|
|
|
bool IsVirtual() const;
|
|
|
|
|
2003-02-01 21:12:03 +03:00
|
|
|
const char *PartitioningSystem() const;
|
2003-02-01 00:17:20 +03:00
|
|
|
|
|
|
|
int32 UniqueID() const;
|
|
|
|
|
2003-02-01 21:12:03 +03:00
|
|
|
BPartition *VisitEachPartition(BDiskDeviceVisitor *visitor);
|
2003-02-01 00:17:20 +03:00
|
|
|
|
2003-02-09 02:34:47 +03:00
|
|
|
BPartition *PartitionWithID(int32 id);
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
status_t GetPartitioningParameters(const char *partitioningSystem,
|
|
|
|
BString *parameters,
|
2003-02-23 02:52:15 +03:00
|
|
|
BRect dialogCenter = BRect(),
|
2003-02-01 00:17:20 +03:00
|
|
|
bool *cancelled = NULL);
|
|
|
|
status_t Partition(const char *partitioningSystem, const char *parameters);
|
|
|
|
status_t Partition(const char *partitioningSystem,
|
2003-02-23 02:52:15 +03:00
|
|
|
BRect dialogCenter = BRect(),
|
2003-02-01 00:17:20 +03:00
|
|
|
bool *cancelled = NULL);
|
|
|
|
|
|
|
|
private:
|
2003-02-01 21:12:03 +03:00
|
|
|
BSession();
|
2003-02-01 00:17:20 +03:00
|
|
|
BSession(const BSession &);
|
|
|
|
BSession &operator=(const BSession &);
|
|
|
|
|
2003-02-08 03:39:38 +03:00
|
|
|
void _Unset();
|
|
|
|
status_t _Unarchive(BMessage *archive);
|
2003-02-16 21:03:59 +03:00
|
|
|
status_t _Update(BMessage *archive);
|
2003-02-08 03:39:38 +03:00
|
|
|
|
|
|
|
void _SetDevice(BDiskDevice *device);
|
|
|
|
|
|
|
|
bool _AddPartition(BPartition *partition);
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
private:
|
2003-02-08 03:39:38 +03:00
|
|
|
friend class BDiskDevice;
|
2003-02-20 03:22:09 +03:00
|
|
|
friend class BDiskDeviceList;
|
2003-02-08 03:39:38 +03:00
|
|
|
|
|
|
|
BDiskDevice *fDevice;
|
|
|
|
BObjectList<BPartition> fPartitions;
|
|
|
|
int32 fUniqueID;
|
|
|
|
int32 fChangeCounter;
|
|
|
|
int32 fIndex;
|
|
|
|
// TODO: Only offset, size and flags are used. Cleanup!
|
|
|
|
session_info fInfo;
|
|
|
|
BString fPartitioningSystem;
|
2003-02-01 00:17:20 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _SESSION_H
|