]>
Commit | Line | Data |
---|---|---|
4e878f44 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: volume.h | |
3 | // Purpose: interface of wxFSVolume | |
4 | // Author: wxWidgets team | |
526954c5 | 5 | // Licence: wxWindows licence |
4e878f44 FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
8 | /** | |
9 | The volume flags. | |
10 | */ | |
11 | enum wxFSVolumeFlags | |
12 | { | |
13 | /// Is the volume mounted? | |
14 | wxFS_VOL_MOUNTED = 0x0001, | |
15 | ||
16 | /// Is the volume removable (floppy, CD, ...)? | |
17 | wxFS_VOL_REMOVABLE = 0x0002, | |
18 | ||
19 | /// Read only? (otherwise read write). | |
20 | wxFS_VOL_READONLY = 0x0004, | |
21 | ||
22 | /// Network resources. | |
23 | wxFS_VOL_REMOTE = 0x0008 | |
24 | }; | |
25 | ||
26 | /** | |
27 | The volume types. | |
28 | */ | |
29 | enum wxFSVolumeKind | |
30 | { | |
31 | wxFS_VOL_FLOPPY, | |
32 | wxFS_VOL_DISK, | |
33 | wxFS_VOL_CDROM, | |
34 | wxFS_VOL_DVDROM, | |
35 | wxFS_VOL_NETWORK, | |
36 | wxFS_VOL_OTHER, | |
37 | wxFS_VOL_MAX | |
38 | }; | |
39 | ||
40 | /** | |
41 | Icon types used by wxFSVolume. | |
42 | */ | |
43 | enum wxFSIconType | |
44 | { | |
45 | wxFS_VOL_ICO_SMALL = 0, | |
46 | wxFS_VOL_ICO_LARGE, | |
47 | wxFS_VOL_ICO_SEL_SMALL, | |
48 | wxFS_VOL_ICO_SEL_LARGE, | |
49 | wxFS_VOL_ICO_MAX | |
50 | }; | |
51 | ||
52 | /** | |
53 | @class wxFSVolume | |
54 | ||
55 | wxFSVolume represents a volume (also known as 'drive') in a file system | |
56 | under wxMSW. | |
57 | ||
58 | Unix ports of wxWidgets do not have the concept of volumes and thus do | |
59 | not implement wxFSVolume. | |
60 | ||
61 | @onlyfor{wxmsw} | |
62 | ||
63 | @library{wxbase} | |
64 | @category{misc} | |
65 | */ | |
66 | class wxFSVolume | |
67 | { | |
68 | public: | |
69 | /** | |
70 | Default ctor. Use Create() later. | |
71 | */ | |
7f01b1fe | 72 | wxFSVolume(); |
4e878f44 FM |
73 | |
74 | /** | |
75 | Create the volume object with the given @a name (which should be one of | |
76 | those returned by GetVolumes()). | |
77 | */ | |
7f01b1fe | 78 | wxFSVolume(const wxString& name); |
4e878f44 FM |
79 | |
80 | /** | |
81 | Create the volume object with the given @a name (which should be one of | |
82 | those returned by GetVolumes()). | |
83 | */ | |
84 | bool Create(const wxString& name); | |
85 | ||
86 | /** | |
87 | Returns an array containing the names of the volumes of this system. | |
88 | ||
89 | Only the volumes with @e flags such that the expression | |
90 | @code (flags & flagsSet) == flagsSet && !(flags & flagsUnset) @endcode | |
91 | is @true, are returned. By default, all mounted ones are returned. | |
7f01b1fe | 92 | See ::wxFSVolumeFlags enumeration values for a list of valid flags. |
4e878f44 FM |
93 | |
94 | This operation may take a while and, even if this function is | |
95 | synchronous, it can be stopped using CancelSearch(). | |
96 | */ | |
97 | static wxArrayString GetVolumes(int flagsSet = wxFS_VOL_MOUNTED, | |
98 | int flagsUnset = 0); | |
99 | ||
100 | /** | |
101 | Stops execution of GetVolumes() called previously (should be called from | |
102 | another thread, of course). | |
103 | */ | |
104 | static void CancelSearch(); | |
105 | ||
106 | /** | |
107 | Is this a valid volume? | |
108 | */ | |
109 | bool IsOk() const; | |
110 | ||
111 | /** | |
112 | Returns the kind of this volume. | |
113 | */ | |
114 | wxFSVolumeKind GetKind() const; | |
115 | ||
116 | /** | |
7f01b1fe | 117 | Returns the flags of this volume. See ::wxFSVolumeFlags enumeration values. |
4e878f44 FM |
118 | */ |
119 | int GetFlags() const; | |
120 | ||
121 | /** | |
122 | Returns @true if this volume is writable. | |
123 | */ | |
124 | bool IsWritable() const; | |
125 | ||
126 | /** | |
127 | Returns the name of the volume; this is the internal name | |
128 | for the volume used by the operating system. | |
129 | */ | |
130 | wxString GetName() const; | |
131 | ||
132 | /** | |
133 | Returns the name of the volume meant to be shown to the user. | |
134 | */ | |
135 | wxString GetDisplayName() const; | |
136 | ||
137 | /** | |
138 | This function is available only when @c wxUSE_GUI is @c 1. | |
139 | ||
140 | Returns the icon used by the native toolkit for the given file system type. | |
141 | */ | |
142 | wxIcon GetIcon(wxFSIconType type) const; | |
143 | }; |