xref: /haiku/headers/os/storage/Volume.h (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
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 
17 class BDirectory;
18 class BBitmap;
19 
20 
21 class BVolume {
22 public:
23 							BVolume();
24 							BVolume(dev_t device);
25 							BVolume(const BVolume& volume);
26 	virtual					~BVolume();
27 
28 			status_t		InitCheck() const;
29 			status_t		SetTo(dev_t device);
30 			void			Unset();
31 
32 			dev_t			Device() const;
33 
34 			status_t		GetRootDirectory(BDirectory* directory) const;
35 
36 			off_t			Capacity() const;
37 			off_t			FreeBytes() const;
38 			off_t			BlockSize() const;
39 
40 			status_t		GetName(char* name) const;
41 			status_t		SetName(const char* name);
42 
43 			status_t		GetIcon(BBitmap* icon, icon_size which) const;
44 			status_t		GetIcon(uint8** _data, size_t* _size,
45 								type_code* _type) const;
46 
47 			bool			IsRemovable() const;
48 			bool			IsReadOnly() const;
49 			bool			IsPersistent() const;
50 			bool			IsShared() const;
51 			bool			KnowsMime() const;
52 			bool			KnowsAttr() const;
53 			bool			KnowsQuery() const;
54 
55 			bool			operator==(const BVolume& volume) const;
56 			bool			operator!=(const BVolume& volume) const;
57 			BVolume&		operator=(const BVolume& volume);
58 
59 private:
60 	virtual void			_TurnUpTheVolume1();
61 	virtual void			_TurnUpTheVolume2();
62 	virtual void			_TurnUpTheVolume3();
63 	virtual void			_TurnUpTheVolume4();
64 	virtual void			_TurnUpTheVolume5();
65 	virtual void			_TurnUpTheVolume6();
66 	virtual void			_TurnUpTheVolume7();
67 	virtual void			_TurnUpTheVolume8();
68 
69 			dev_t			fDevice;
70 								// The device ID of the volume.
71 			status_t		fCStatus;
72 								// The initialization status of the object.
73 			int32			_reserved[8];
74 								// FBC
75 };
76 
77 
78 #endif	// _VOLUME_H
79