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
// -------------------------------------------------------------------------------- //
24
#include <wx/string.h>
25
#include <wx/stattext.h>
26
#include <wx/gdicmn.h>
28
#include <wx/colour.h>
29
#include <wx/settings.h>
30
#include <wx/bitmap.h>
33
#include <wx/bmpbuttn.h>
34
#include <wx/button.h>
36
#include <wx/treectrl.h>
37
#include <wx/textctrl.h>
38
#include <wx/statbox.h>
39
#include <wx/dialog.h>
40
#include <wx/xml/xml.h>
42
#include <wx/dynarray.h>
44
// -------------------------------------------------------------------------------- //
45
class guNewPodcastItem : public wxTreeItemData
51
WX_DECLARE_OBJARRAY(guNewPodcastItem, guNewPodcastItemArray);
53
// -------------------------------------------------------------------------------- //
54
class guNewPodcastCategory
58
guNewPodcastItemArray m_Items;
60
WX_DECLARE_OBJARRAY(guNewPodcastCategory, guNewPodcastChannelArray);
62
// -------------------------------------------------------------------------------- //
64
// -------------------------------------------------------------------------------- //
65
class guPodcastTreeCtrl : public wxTreeCtrl
68
wxImageList * m_ImageList;
69
wxTreeItemId m_RootId;
70
guNewPodcastChannelArray * m_NewPodcasts;
74
guPodcastTreeCtrl( wxWindow * parent, guNewPodcastChannelArray * newpodcasts );
77
void ReloadItems( void );
78
int GetCategoryCount( void ) { return m_NewPodcasts->Count(); }
79
int GetItemsCount( void ) { return m_NewItemsCount; }
80
void ExpandRoot( void ) { Expand( m_RootId ); }
84
// -------------------------------------------------------------------------------- //
85
class guNewPodcastChannelSelector : public wxDialog
90
wxStaticText * m_DirectoryInfoStaticText;
91
wxBitmapButton * m_DirectoryReload;
92
wxBitmapButton * m_FilterDirectory;
93
guPodcastTreeCtrl * m_DirectoryTreeCtrl;
94
wxTextCtrl * m_UrlTextCtrl;
95
guNewPodcastChannelArray m_NewPodcasts;
96
wxArrayString m_Filters;
98
void OnFilterDirectoryClicked( wxCommandEvent& event );
99
void OnReloadDirectoryClicked( wxCommandEvent& event );
100
void OnDirectoryItemSelected( wxTreeEvent& event );
101
void OnDirectoryItemChanged( wxTreeEvent& event );
103
void LoadPodcastDirectory( void );
104
int ReadNewPodcastChannel( wxXmlNode * XmlNode, guNewPodcastCategory * podcastchannel );
105
int ReadNewPodcastChannels( wxXmlNode * XmlNode );
106
int LoadNewPodcastsFromXml( const wxString &filename );
109
guNewPodcastChannelSelector( wxWindow * parent );
110
~guNewPodcastChannelSelector();
111
wxString GetValue( void );
117
// -------------------------------------------------------------------------------- //