1 /* 2 * Copyright 2002-2008, Haiku Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _VOLUME_H 6 #define _VOLUME_H 7 8 9 #include <sys/types.h> 10 11 #include <fs_info.h> 12 #include <Mime.h> 13 #include <StorageDefs.h> 14 #include <SupportDefs.h> 15 16 class BDirectory; 17 class BBitmap; 18 19 20 class BVolume { 21 public: 22 BVolume(); 23 BVolume(dev_t device); 24 BVolume(const BVolume& volume); 25 virtual ~BVolume(); 26 27 status_t InitCheck() const; 28 status_t SetTo(dev_t device); 29 void Unset(); 30 31 dev_t Device() const; 32 33 status_t GetRootDirectory(BDirectory* directory) const; 34 35 off_t Capacity() const; 36 off_t FreeBytes() const; 37 38 status_t GetName(char* name) const; 39 status_t SetName(const char* name); 40 41 status_t GetIcon(BBitmap* icon, icon_size which) const; 42 status_t GetIcon(uint8** _data, size_t* _size, 43 type_code* _type) const; 44 45 bool IsRemovable() const; 46 bool IsReadOnly() const; 47 bool IsPersistent() const; 48 bool IsShared() const; 49 bool KnowsMime() const; 50 bool KnowsAttr() const; 51 bool KnowsQuery() const; 52 53 bool operator==(const BVolume& volume) const; 54 bool operator!=(const BVolume& volume) const; 55 BVolume& operator=(const BVolume& volume); 56 57 private: 58 virtual void _TurnUpTheVolume1(); 59 virtual void _TurnUpTheVolume2(); 60 virtual void _TurnUpTheVolume3(); 61 virtual void _TurnUpTheVolume4(); 62 virtual void _TurnUpTheVolume5(); 63 virtual void _TurnUpTheVolume6(); 64 virtual void _TurnUpTheVolume7(); 65 virtual void _TurnUpTheVolume8(); 66 67 dev_t fDevice; 68 status_t fCStatus; 69 int32 _reserved[8]; 70 }; 71 72 #endif // _VOLUME_H 73