]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/volume.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFSVolume - encapsulates system volume information
4 // Author: George Policello
8 // Copyright: (c) 2002 George Policello
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ----------------------------------------------------------------------------
13 // wxFSVolume represents a volume/drive/mount point in a file system
14 // ----------------------------------------------------------------------------
16 #ifndef _WX_FSVOLUME_H_
17 #define _WX_FSVOLUME_H_
19 #if defined(__GNUG__) && !defined(__APPLE__)
20 #pragma interface "fsvolume.h"
28 #include "wx/iconbndl.h" // for wxIconArray
34 // is the volume mounted?
35 wxFS_VOL_MOUNTED
= 0x0001,
37 // is the volume removable (floppy, CD, ...)?
38 wxFS_VOL_REMOVABLE
= 0x0002,
40 // read only? (otherwise read write)
41 wxFS_VOL_READONLY
= 0x0004,
44 wxFS_VOL_REMOTE
= 0x0008
65 wxFS_VOL_ICO_SMALL
= 0,
67 wxFS_VOL_ICO_SEL_SMALL
,
68 wxFS_VOL_ICO_SEL_LARGE
,
74 class WXDLLEXPORT wxFSVolume
77 // return the array containing the names of the volumes
79 // only the volumes with the flags such that
80 // (flags & flagsSet) == flagsSet && !(flags & flagsUnset)
81 // are returned (by default, all mounted ones)
82 static wxArrayString
GetVolumes(int flagsSet
= wxFS_VOL_MOUNTED
,
85 // stop execution of GetVolumes() called previously (should be called from
86 // another thread, of course)
87 static void CancelSearch();
89 // create the volume object with this name (should be one of those returned
92 wxFSVolume(const wxString
& name
);
93 bool Create(const wxString
& name
);
98 // is this a valid volume?
101 // kind of this volume?
102 wxFSVolumeKind
GetKind() const;
104 // flags of this volume?
105 int GetFlags() const;
107 // can we write to this volume?
108 bool IsWritable() const { return !(GetFlags() & wxFS_VOL_READONLY
); }
110 // get the name of the volume and the name which should be displayed to the
112 wxString
GetName() const { return m_volName
; }
113 wxString
GetDisplayName() const { return m_dispName
; }
116 wxIcon
GetIcon(wxFSIconType type
) const;
119 // TODO: operatios (Mount(), Unmount(), Eject(), ...)?
131 #endif // wxUSE_FSVOLUME
133 #endif // _WX_FSVOLUME_H_