Clean and order documentation in source files. Source ready to beta 2 release
[mdictionary] / src / plugins / xdxf / XdxfDictDownloader.h
index 629f57d..ebd048d 100644 (file)
     Copyright 2010 Comarch S.A.
 
 *******************************************************************************/
+/*!
+    \file XdxfDictDownloader.h
+    \brief XdxfDictDownloader is responsible for getting dict list from XDXF website
+    and other actions necessary to download and add dictionary
 
-//Created by Mateusz Półrola
+    \author Mateusz Półrola <mateusz.polrola@comarch.pl>
+*/
 
 #ifndef XDXFDICTDOWNLOADER_H
 #define XDXFDICTDOWNLOADER_H
 #include <DownloadDict.h>
 #include "XdxfDictDownloadProgressDialog.h"
 #include "../../include/Notify.h"
+#include "HttpDownloader.h"
+#include <string.h>
+#include <errno.h>
 
-/** XdxfDictDownloader is responsible for getting dict list from XDXF website
+/*!
+    XdxfDictDownloader is responsible for getting dict list from XDXF website
     and other actions necessary to download and add dictionary
 
     When user want to add dictionary he may choose "browse" or "download",
@@ -45,9 +54,9 @@ class XdxfDictDownloader : public QObject {
     Q_OBJECT
 public:
     XdxfDictDownloader(QObject *parent = 0);
+
     //! \return name of downloaded file
     QString downloadedFile();
-    ~XdxfDictDownloader();
 
 public Q_SLOTS:
     //! downloads dictionaries list from xdxf website
@@ -56,15 +65,36 @@ public Q_SLOTS:
 Q_SIGNALS:
     //! emmited when file download precess is complete
     void fileDownloaded(QString);
+
+    //! emitted to inform user about errors and warnings
     void notify(Notify::NotifyType, QString);
 
+    //! emmited what is update Download Progress
+    void downloadProgress(float);
+
 private Q_SLOTS:
+    //! obtained list of dictionaries from website
     void dictListReceived(QNetworkReply*);
-    void processFinished(int);
+
+    //! one of system processes finished
+    void processFinished();
+
+    //! user cancel downloading
     void breakDownloading();
 
+    //! handling a download error
+    void downloadingError(QString);
+
+    /*!
+        function divide two qint64 and result emmit in
+        signals downloadProgress(float)
+    */
+    void updateDownloadProgress(qint64, qint64);
+
 private:
+    //! dict is downloaded and unpacked
     void downloadComplete();
+
     QList<DownloadDict> dicts;
     QWidget* parentDialog;
     QString _downloadedFile;
@@ -75,6 +105,9 @@ private:
     QString _fileName;
     bool downloadError;
     bool aborted;
+    QNetworkAccessManager *manager;
+    bool extract(QString file);
+    HttpDownloader http;
 };
 
 #endif // XDXFDICTDOWNLOADER_H