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