/*****************************************************************************
 *
 *  softwareupdate.cpp -- Check and download software update.
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is part of the Main module of the DVDx 4 application.
 *
 *  GNU Lesser General Public License Usage
 *  This file may be used under the terms of the GNU Lesser General
 *  Public License version 2.1 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.LGPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU Lesser General Public License version 2.1 requirements
 *  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 *
 *  GNU General Public License Usage
 *  Alternatively, this file may be used under the terms of the GNU
 *  General Public License version 3.0 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.GPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU General Public License version 3.0 requirements will be
 *  met: http://www.gnu.org/copyleft/gpl.html.
 *
 *****************************************************************************/

#ifndef SOFTWAREUPDATE_H
#define SOFTWAREUPDATE_H

#include <QObject>
#include <QFile>
#include <QtNetwork>

class SoftwareUpdate : public QObject 
{
	Q_OBJECT

public:
	SoftwareUpdate(QString *serverResponse, QString *whatYouGet,
		QString *openEditionUrl, QString *smartEditionUrl, QObject *parent=0);
	~SoftwareUpdate();

	virtual void checkUpdate();

signals:
	void checkUpdateFailed(QString);
	void checkUpdateFinished();
	void checkUpdateStarted();
	void checkUpdateSucceeded();

protected slots:
	void checkUpdateError(QNetworkReply::NetworkError);
	void checkUpdateFinish();
	void checkUpdateRead();

protected:
	QString m_appBuild;
	QString m_appPlatform;
	QString m_appSystem;
	QString m_appVersion;

	QNetworkReply	*m_reply;
	QString			*m_openEditionUrl;
	QString			*m_serverResponse;
	QString			*m_smartEditionUrl;
	QString			*m_whatYouGet;
};

#endif
