1
// -------------------------------------------------------------------------------- //
2
// Copyright (C) 2008-2010 J.Rios
5
// This Program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 2, or (at your option)
10
// This Program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program; see the file LICENSE. If not, write to
17
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18
// http://www.gnu.org/copyleft/gpl.html
20
// -------------------------------------------------------------------------------- //
28
#include <wx/arrstr.h>
29
#include <wx/string.h>
30
#include <wx/dynarray.h>
34
// -------------------------------------------------------------------------------- //
43
guGIO_Volume( GVolume * volume ) { m_Volume = volume; }
44
~guGIO_Volume( void ) { if( m_Volume ) g_object_unref( m_Volume ); }
46
wxString GetName( void );
47
wxString GetUUID( void );
48
wxString GetIcon( void );
49
//GDrive GetDrive( void );
50
guGIO_Mount GetMount( void );
51
bool CanMount( void );
52
bool ShouldAutoMount( void );
53
//void Mount( int flags,
54
bool CanEject( void );
58
// -------------------------------------------------------------------------------- //
69
wxString m_IconString;
72
guGIO_Mount( GMount * mount );
73
guGIO_Mount( GMount * mount, wxString &mountpath );
76
bool IsMount( GMount * mount ) { return m_Mount == mount; }
78
bool IsReadOnly( void ) { return m_IsReadOnly; }
80
int PanelActive( void ) { guLogMessage( wxT( "PanelActive: %i" ), m_PanelActive ); return m_PanelActive; }
81
void SetPanelActive( int active ) { m_PanelActive = active; }
83
wxString GetName( void ) { return m_Name; }
84
wxString GetMountPath( void ) { return m_MountPath; }
85
wxString IconString( void ) { return m_IconString; }
87
GVolume GetVolume( void );
89
bool CanUnmount( void );
92
WX_DEFINE_ARRAY_PTR( guGIO_Mount *, guGIO_MountArray );
94
// -------------------------------------------------------------------------------- //
95
class guGIO_VolumeMonitor
99
int m_VolumeRemovedId;
101
int m_MountPreUnmountId;
102
int m_MountRemovedId;
105
GVolumeMonitor * m_VolumeMonitor;
106
guGIO_MountArray * m_MountedVolumes;
108
int FindMount( GMount * mount );
110
void GetCurrentMounts( void );
113
guGIO_VolumeMonitor();
114
~guGIO_VolumeMonitor();
116
void OnMountAdded( GMount * mount );
117
void OnMountRemoved( GMount * mount );
118
void OnVolumeAdded( GVolume * volume );
119
void OnVolumeRemoved( GVolume * volume );
121
wxArrayString GetMountNames( void );
122
int GetMountCount( void ) { return m_MountedVolumes->Count(); }
123
guGIO_Mount * GetMount( const int index ) { return m_MountedVolumes->Item( index ); }
124
guGIO_Mount * GetMount( const wxString &mountname );
125
int PanelActive( const int index ) { return m_MountedVolumes->Item( index )->PanelActive(); }
129
// -------------------------------------------------------------------------------- //