1 /* 2 * Copyright 2002-2009, 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 off_t BlockSize() const; 38 39 status_t GetName(char* name) const; 40 status_t SetName(const char* name); 41 42 status_t GetIcon(BBitmap* icon, icon_size which) const; 43 status_t GetIcon(uint8** _data, size_t* _size, 44 type_code* _type) const; 45 46 bool IsRemovable() const; 47 bool IsReadOnly() const; 48 bool IsPersistent() const; 49 bool IsShared() const; 50 bool KnowsMime() const; 51 bool KnowsAttr() const; 52 bool KnowsQuery() const; 53 54 bool operator==(const BVolume& volume) const; 55 bool operator!=(const BVolume& volume) const; 56 BVolume& operator=(const BVolume& volume); 57 58 private: 59 virtual void _TurnUpTheVolume1(); 60 virtual void _TurnUpTheVolume2(); 61 virtual void _TurnUpTheVolume3(); 62 virtual void _TurnUpTheVolume4(); 63 virtual void _TurnUpTheVolume5(); 64 virtual void _TurnUpTheVolume6(); 65 virtual void _TurnUpTheVolume7(); 66 virtual void _TurnUpTheVolume8(); 67 68 dev_t fDevice; 69 status_t fCStatus; 70 int32 _reserved[8]; 71 }; 72 73 #endif // _VOLUME_H 74