Oops. Only build mpegplayer bitmaps for SWCODEC.
[Rockbox.git] / rbutil / rbutilqt / installbootloader.h
blob03b715c15e9548aa975e7cf4562527d47469ca38
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id$
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef INSTALLBOOTLOADER_H
21 #define INSTALLBOOTLOADER_H
23 #include <QtGui>
25 #include "progressloggerinterface.h"
26 #include "httpget.h"
27 #include "irivertools/irivertools.h"
29 extern "C" {
30 // Ipodpatcher
31 #include "../ipodpatcher/ipodpatcher.h"
32 #include "../sansapatcher/sansapatcher.h"
35 bool initIpodpatcher();
36 bool initSansapatcher();
38 class BootloaderInstaller : public QObject
40 Q_OBJECT
42 public:
43 BootloaderInstaller(QObject* parent);
44 ~BootloaderInstaller() {}
46 void install(ProgressloggerInterface* dp);
47 void uninstall(ProgressloggerInterface* dp);
49 void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;}
50 void setProxy(QUrl proxy) {m_proxy= proxy;}
51 void setDevice(QString device) {m_device= device;} //!< the current plattform
52 void setBootloaderMethod(QString method) {m_bootloadermethod= method;}
53 void setBootloaderName(QString name){m_bootloadername= name;}
54 void setBootloaderBaseUrl(QString baseUrl){m_bootloaderUrlBase = baseUrl;}
55 void setOrigFirmwarePath(QString path) {m_origfirmware = path;} //!< for iriver original firmware
56 void setBootloaderInfoUrl(QString url) {m_bootloaderinfoUrl =url; } //!< the url for the info file
57 bool downloadInfo(); //!< should be called before install/uninstall, blocks until downloaded.
58 bool uptodate(); //!< returns wether the bootloader is uptodate
60 signals:
61 void done(bool error); //installation finished.
63 signals: // internal signals. Dont use this from out side.
64 void prepare();
65 void finish();
67 private slots:
68 void createInstallLog(); // adds the bootloader entry to the log
69 void removeInstallLog(); // removes the bootloader entry from the log
71 void updateDataReadProgress(int, int);
72 void downloadDone(bool);
73 void downloadRequestFinished(int, bool);
74 void infoDownloadDone(bool);
75 void infoRequestFinished(int, bool);
76 void installEnded(bool);
78 // gigabeat specific routines
79 void gigabeatPrepare();
80 void gigabeatFinish();
82 //iaudio specific routines
83 void iaudioPrepare();
84 void iaudioFinish();
86 //h10 specific routines
87 void h10Prepare();
88 void h10Finish();
90 //ipod specific routines
91 void ipodPrepare();
92 void ipodFinish();
94 //sansa specific routines
95 void sansaPrepare();
96 void sansaFinish();
98 //iriver specific routines
99 void iriverPrepare();
100 void iriverFinish();
102 private:
104 HttpGet *infodownloader;
105 QTemporaryFile bootloaderInfo;
106 volatile bool infoDownloaded;
107 volatile bool infoError;
109 QString m_mountpoint, m_device,m_bootloadermethod,m_bootloadername;
110 QString m_bootloaderUrlBase,m_tempfilename,m_origfirmware;
111 QUrl m_proxy;
112 QString m_bootloaderinfoUrl;
113 bool m_install;
115 int series,table_entry; // for fwpatcher
117 HttpGet *getter;
118 QTemporaryFile downloadFile;
120 ProgressloggerInterface* m_dp;
123 #endif