]>
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 license
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_
20 #pragma interface "fsvolume.h"
26 // is the volume mounted?
27 wxFS_VOL_MOUNTED
= 0x0001,
29 // is the volume removable (floppy, CD, ...)?
30 wxFS_VOL_REMOVABLE
= 0x0002,
32 // read only? (otherwise read write)
33 wxFS_VOL_READONLY
= 0x0004,
36 wxFS_VOL_REMOTE
= 0x0008
54 wxFS_VOL_ICO_SMALL
= 0,
56 wxFS_VOL_ICO_SEL_SMALL
,
57 wxFS_VOL_ICO_SEL_LARGE
,
62 WX_DECLARE_OBJARRAY(wxIcon
, wxIconArray
);
64 class WXDLLEXPORT wxFSVolume
67 // return the array containing the names of the volumes
69 // only the volumes with the flags such that
70 // (flags & flagsSet) == flagsSet && !(flags & flagsUnset)
71 // are returned (by default, all mounted ones)
72 static wxArrayString
GetVolumes(int flagsSet
= wxFS_VOL_MOUNTED
,
75 // stop execution of GetVolumes() called previously (should be called from
76 // another thread, of course)
77 static void CancelSearch();
79 // create the volume object with this name (should be one of those returned
82 wxFSVolume(const wxString
& name
);
83 bool Create(const wxString
& name
);
88 // is this a valid volume?
91 // kind of this volume?
92 wxFSVolumeKind
GetKind() const;
94 // flags of this volume?
97 // can we write to this volume?
98 bool IsWritable() const { return !(GetFlags() & wxFS_VOL_READONLY
); }
100 // get the name of the volume and the name which should be displayed to the
102 wxString
GetName() const { return m_volName
; }
103 wxString
GetDisplayName() const { return m_dispName
; }
106 wxIcon
GetIcon(wxFSIconType type
) const;
109 // TODO: operatios (Mount(), Unmount(), Eject(), ...)?
121 #endif // _WX_FSVOLUME_H_