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 _PARTITION_H
|
|
|
|
#define _PARTITION_H
|
|
|
|
|
2003-02-08 03:39:38 +03:00
|
|
|
#include <disk_scanner.h>
|
2003-02-01 00:17:20 +03:00
|
|
|
#include <Mime.h>
|
|
|
|
#include <ObjectList.h>
|
2003-02-23 02:51:33 +03:00
|
|
|
#include <Rect.h>
|
2003-02-01 00:17:20 +03:00
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
class BDiskDevice;
|
|
|
|
class BSession;
|
|
|
|
class BVolume;
|
|
|
|
|
|
|
|
class BPartition {
|
|
|
|
public:
|
2003-02-08 03:39:38 +03:00
|
|
|
~BPartition();
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
BSession *Session() const;
|
|
|
|
BDiskDevice *Device() const;
|
|
|
|
|
|
|
|
off_t Offset() const;
|
|
|
|
off_t Size() const;
|
|
|
|
int32 BlockSize() const;
|
|
|
|
int32 Index() const;
|
|
|
|
|
|
|
|
uint32 Flags() const;
|
|
|
|
bool IsHidden() const;
|
|
|
|
bool IsVirtual() const;
|
|
|
|
bool IsEmpty() const;
|
2003-02-01 21:12:03 +03:00
|
|
|
bool ContainsFileSystem() const;
|
2003-02-01 00:17:20 +03:00
|
|
|
|
|
|
|
const char *Name() const;
|
|
|
|
const char *Type() const;
|
|
|
|
const char *FileSystemShortName() const;
|
|
|
|
const char *FileSystemLongName() const;
|
|
|
|
const char *VolumeName() const;
|
|
|
|
|
|
|
|
uint32 FileSystemFlags() const;
|
|
|
|
|
|
|
|
bool IsMounted() const;
|
|
|
|
|
|
|
|
int32 UniqueID() const;
|
|
|
|
|
|
|
|
status_t GetVolume(BVolume *volume) const;
|
|
|
|
|
|
|
|
status_t GetIcon(BBitmap *icon, icon_size which) const;
|
|
|
|
|
2003-02-01 21:12:03 +03:00
|
|
|
status_t Mount(uint32 mountFlags = 0, const char *parameters = NULL);
|
2003-02-01 00:17:20 +03:00
|
|
|
status_t Unmount();
|
|
|
|
|
|
|
|
status_t GetInitializationParameters(const char *fileSystem,
|
2003-02-01 21:12:03 +03:00
|
|
|
BString *volumeName,
|
2003-02-01 00:17:20 +03:00
|
|
|
BString *parameters,
|
2003-02-23 02:51:33 +03:00
|
|
|
BRect dialogCenter = BRect(),
|
2003-02-01 00:17:20 +03:00
|
|
|
bool *cancelled = NULL);
|
2003-02-01 21:12:03 +03:00
|
|
|
status_t Initialize(const char *fileSystem, const char *volumeName,
|
|
|
|
const char *parameters);
|
2003-02-01 00:17:20 +03:00
|
|
|
status_t Initialize(const char *fileSystem = "bfs",
|
2003-02-23 02:51:33 +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
|
|
|
BPartition();
|
2003-02-01 00:17:20 +03:00
|
|
|
BPartition(const BPartition &);
|
2003-02-01 21:12:03 +03:00
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
BPartition &operator=(const BPartition &);
|
|
|
|
|
2003-02-08 03:39:38 +03:00
|
|
|
void _Unset();
|
|
|
|
status_t _Unarchive(BMessage *archive);
|
|
|
|
|
|
|
|
void _SetSession(BSession *session);
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
private:
|
2003-02-20 03:22:09 +03:00
|
|
|
friend class BDiskDeviceList;
|
2003-02-08 03:39:38 +03:00
|
|
|
friend class BSession;
|
|
|
|
|
2003-02-01 00:17:20 +03:00
|
|
|
BSession *fSession;
|
2003-02-08 03:39:38 +03:00
|
|
|
int32 fUniqueID;
|
|
|
|
int32 fChangeCounter;
|
|
|
|
int32 fIndex;
|
2003-02-01 00:17:20 +03:00
|
|
|
// TODO: Also contains the device name, which we can get from Device() anyway.
|
|
|
|
// We could either remove it from extended_partition_info or list
|
|
|
|
// the individual fields here.
|
|
|
|
extended_partition_info fInfo;
|
|
|
|
dev_t fVolumeID;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _PARTITION_H
|