1
//---------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2012 LenMus project
5
// This program is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation,
7
// either version 3 of the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along with this
14
// program. If not, see <http://www.gnu.org/licenses/>.
16
// For any comment, suggestion or feature request, please contact the manager of
17
// the project at cecilios@users.sourceforge.net
19
//---------------------------------------------------------------------------------------
21
#ifndef __LENMUS_UPDATER_H__ //to avoid nested includes
22
#define __LENMUS_UPDATER_H__
24
#include "lenmus_injectors.h"
30
#include <wx/xml/xml.h> // to use wxXmlDocument
35
//---------------------------------------------------------------------------------------
39
ApplicationScope& m_appScope;
41
bool m_fCheckForUpdates; //user allows this checking
45
wxString m_sDescription;
46
wxString m_sUrl; //url for download
50
Updater(ApplicationScope& appScope);
53
void check_for_updates(wxFrame* pParent, bool fSilent);
55
const wxString& GetVersion() { return m_sVersion; }
56
const wxString& GetPackage() { return m_sPackage; }
57
const wxString& GetDescription() { return m_sDescription; }
58
const wxString& GetUrl() { return m_sUrl; }
61
//default values and user preferences
62
void LoadUserPreferences();
63
void SaveUserPreferences();
65
bool DoCheck(wxString sPlatform, bool fSilent); //true if errors in conection or update information download
67
bool CheckInternetConnection(); //true if internet connection operative
69
void ParseDocument(wxXmlNode* pNode);
70
wxString GetText(wxXmlNode* pElement);
71
wxString GetAttribute(wxXmlNode* pNode, wxString sName, wxString sDefault);
72
wxXmlNode* GetFirstChild(wxXmlNode* pNode);
73
wxXmlNode* GetNextSibling(wxXmlNode* pNode);
80
#endif // __LENMUS_UPDATER_H__