X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f618020a15f1647a83aaeab1fe315f90497a9876..6968a3b87cee46f5c5af9b46e1ef97f17133cef7:/include/wx/volume.h?ds=sidebyside diff --git a/include/wx/volume.h b/include/wx/volume.h index 87b9a27ad7..191d69b603 100644 --- a/include/wx/volume.h +++ b/include/wx/volume.h @@ -6,26 +6,24 @@ // Created: 28 Jan 02 // RCS-ID: $Id$ // Copyright: (c) 2002 George Policello -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ---------------------------------------------------------------------------- -// wxFSVolume represents a volume/drive/mount point in a file system +// wxFSVolume represents a volume/drive in a file system // ---------------------------------------------------------------------------- #ifndef _WX_FSVOLUME_H_ #define _WX_FSVOLUME_H_ -#ifdef __GNUG__ - #pragma interface "fsvolume.h" -#endif - #include "wx/defs.h" #if wxUSE_FSVOLUME +#include "wx/arrstr.h" + // the volume flags -enum +enum wxFSVolumeFlags { // is the volume mounted? wxFS_VOL_MOUNTED = 0x0001, @@ -52,25 +50,7 @@ enum wxFSVolumeKind wxFS_VOL_MAX }; -#if wxUSE_GUI - -#include "wx/icon.h" - -enum wxFSIconType -{ - wxFS_VOL_ICO_SMALL = 0, - wxFS_VOL_ICO_LARGE, - wxFS_VOL_ICO_SEL_SMALL, - wxFS_VOL_ICO_SEL_LARGE, - wxFS_VOL_ICO_MAX -}; - -// already in wx/iconbndl.h -// WX_DECLARE_EXPORTED_OBJARRAY(wxIcon, wxIconArray); - -#endif // wxUSE_GUI - -class WXDLLEXPORT wxFSVolume +class WXDLLIMPEXP_BASE wxFSVolumeBase { public: // return the array containing the names of the volumes @@ -87,8 +67,8 @@ public: // create the volume object with this name (should be one of those returned // by GetVolumes()). - wxFSVolume(); - wxFSVolume(const wxString& name); + wxFSVolumeBase(); + wxFSVolumeBase(const wxString& name); bool Create(const wxString& name); // accessors @@ -111,23 +91,56 @@ public: wxString GetName() const { return m_volName; } wxString GetDisplayName() const { return m_dispName; } -#if wxUSE_GUI - wxIcon GetIcon(wxFSIconType type) const; -#endif - // TODO: operatios (Mount(), Unmount(), Eject(), ...)? -private: +protected: + // the internal volume name wxString m_volName; + + // the volume name as it is displayed to the user wxString m_dispName; -#if wxUSE_GUI - wxIconArray m_icons; -#endif + + // have we been initialized correctly? bool m_isOk; +}; +#if wxUSE_GUI + +#include "wx/icon.h" +#include "wx/iconbndl.h" // only for wxIconArray + +enum wxFSIconType +{ + wxFS_VOL_ICO_SMALL = 0, + wxFS_VOL_ICO_LARGE, + wxFS_VOL_ICO_SEL_SMALL, + wxFS_VOL_ICO_SEL_LARGE, + wxFS_VOL_ICO_MAX }; +// wxFSVolume adds GetIcon() to wxFSVolumeBase +class WXDLLIMPEXP_CORE wxFSVolume : public wxFSVolumeBase +{ +public: + wxFSVolume() : wxFSVolumeBase() { InitIcons(); } + wxFSVolume(const wxString& name) : wxFSVolumeBase(name) { InitIcons(); } + + wxIcon GetIcon(wxFSIconType type) const; + +private: + void InitIcons(); + + // the different icons for this volume (created on demand) + wxIconArray m_icons; +}; + +#else // !wxUSE_GUI + +// wxFSVolume is the same thing as wxFSVolume in wxBase +typedef wxFSVolumeBase wxFSVolume; + +#endif // wxUSE_GUI/!wxUSE_GUI + #endif // wxUSE_FSVOLUME #endif // _WX_FSVOLUME_H_ -