Very rough initial implementation of torrent adding working.
[qtrapids] / src / qml-client / MainPageHandler.h
index ada83d1..d0321bb 100644 (file)
     with this program; if not, write to the Free Software Foundation, Inc.,
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
-
-
 #ifndef MAINPAGEHANDLER_H
 #define MAINPAGEHANDLER_H
 
 // Used in this class and main.cpp, so include here
 #include <meegotouch/mapplication.h> 
 #include <QtCore/QObject>
+#include <QtCore/QSettings>
+
+#include "proxy.h"
+#include "models/QDeclarativeDownloadListModel.h"
+
+class QDeclarativeEngine;
 
 namespace qtrapids
 {
@@ -32,16 +36,26 @@ class MainPageHandler : public QObject
 {
     Q_OBJECT
 public:
-    MainPageHandler(QObject *parent = 0);
+    MainPageHandler(QDeclarativeEngine *engine, QObject *parent = 0);
     virtual ~MainPageHandler();
 
     Q_INVOKABLE void fileSelectorOpen();
-
+    Q_INVOKABLE void on_torrentFileSelected(const QString& fileUrl);
 private slots:
-    void on_torrentFileSelected(const QString& file);
+    //void on_torrentFileSelected(const QString& file);
+    void on_alert(qtrapids::TorrentState info, qtrapids::ParamsMap_t other_info);
+private:
+    void connectToServer();
+    void restoreSettings();
 
 private:
     Q_DISABLE_COPY(MainPageHandler);
+    
+    QDeclarativeDownloadListModel downloadModel_;
+
+    QDeclarativeEngine *engine_;
+    QSettings settings_;
+    QtRapidsServer server_;
 };
 
 } // namespace qtrapids