]>
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"
30 // is the volume mounted?
31 wxFS_VOL_MOUNTED
= 0x0001,
33 // is the volume removable (floppy, CD, ...)?
34 wxFS_VOL_REMOVABLE
= 0x0002,
36 // read only? (otherwise read write)
37 wxFS_VOL_READONLY
= 0x0004,
40 wxFS_VOL_REMOTE
= 0x0008
61 wxFS_VOL_ICO_SMALL
= 0,
63 wxFS_VOL_ICO_SEL_SMALL
,
64 wxFS_VOL_ICO_SEL_LARGE
,
68 // already in wx/iconbndl.h
69 // WX_DECLARE_EXPORTED_OBJARRAY(wxIcon, wxIconArray);
73 class WXDLLEXPORT wxFSVolume
76 // return the array containing the names of the volumes
78 // only the volumes with the flags such that
79 // (flags & flagsSet) == flagsSet && !(flags & flagsUnset)
80 // are returned (by default, all mounted ones)
81 static wxArrayString
GetVolumes(int flagsSet
= wxFS_VOL_MOUNTED
,
84 // stop execution of GetVolumes() called previously (should be called from
85 // another thread, of course)
86 static void CancelSearch();
88 // create the volume object with this name (should be one of those returned
91 wxFSVolume(const wxString
& name
);
92 bool Create(const wxString
& name
);
97 // is this a valid volume?
100 // kind of this volume?
101 wxFSVolumeKind
GetKind() const;
103 // flags of this volume?
104 int GetFlags() const;
106 // can we write to this volume?
107 bool IsWritable() const { return !(GetFlags() & wxFS_VOL_READONLY
); }
109 // get the name of the volume and the name which should be displayed to the
111 wxString
GetName() const { return m_volName
; }
112 wxString
GetDisplayName() const { return m_dispName
; }
115 wxIcon
GetIcon(wxFSIconType type
) const;
118 // TODO: operatios (Mount(), Unmount(), Eject(), ...)?
130 #endif // wxUSE_FSVOLUME
132 #endif // _WX_FSVOLUME_H_