Move C linkage binding for c++ to exporting header files instead of includes.
[Rockbox.git] / rbutil / rbutilqt / installbootloader.h
blob727b8bfbe7c9996e9afc43b0893c13227c6f8c36
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 #ifndef CONSOLE
24 #include <QtGui>
25 #else
26 #include <QtCore>
27 #endif
29 #include "progressloggerinterface.h"
30 #include "httpget.h"
31 #include "irivertools/irivertools.h"
33 #include "../ipodpatcher/ipodpatcher.h"
34 #include "../sansapatcher/sansapatcher.h"
36 bool initIpodpatcher();
37 bool initSansapatcher();
39 class BootloaderInstaller : public QObject
41 Q_OBJECT
43 public:
44 BootloaderInstaller(QObject* parent);
45 ~BootloaderInstaller() {}
47 void install(ProgressloggerInterface* dp);
48 void uninstall(ProgressloggerInterface* dp);
50 void setMountPoint(QString mountpoint) {m_mountpoint = mountpoint;}
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 //mrobe100 specific routines
103 void mrobe100Prepare();
104 void mrobe100Finish();
106 private:
108 HttpGet *infodownloader;
109 QTemporaryFile bootloaderInfo;
110 volatile bool infoDownloaded;
111 volatile bool infoError;
113 QString m_mountpoint, m_device,m_bootloadermethod,m_bootloadername;
114 QString m_bootloaderUrlBase,m_tempfilename,m_origfirmware;
115 QString m_bootloaderinfoUrl;
116 bool m_install;
118 int series,table_entry; // for fwpatcher
120 HttpGet *getter;
121 QTemporaryFile downloadFile;
123 ProgressloggerInterface* m_dp;
126 #endif