1 /*******************************************************************************
3 This file is part of mDictionary.
5 mDictionary is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 mDictionary is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
22 //Created by Mateusz Półrola
24 #ifndef XDXFDICTDOWNLOADER_H
25 #define XDXFDICTDOWNLOADER_H
28 #include "XdxfDictSelectDialog.h"
30 #include <QNetworkAccessManager>
31 #include <QNetworkReply>
32 #include <DownloadDict.h>
33 #include "XdxfDictDownloadProgressDialog.h"
35 /** XdxfDictDownloader is responsible for getting dict list from XDXF website
36 and other actions necessary to download and add dictionary
38 When user want to add dictionary he may choose "browse" or "download",
39 after selecting "download" XDXFDictDownloader would present him list of
40 dictionaries and when he select one downloading would be started. Next
41 step is to extract archive and move file to ~/.mdictionary
43 class XdxfDictDownloader : public QObject {
46 XdxfDictDownloader(QObject *parent = 0);
47 //! \return name of downloaded file
48 QString downloadedFile();
51 //! downloads dictionaries list from xdxf website
52 void download(QWidget* parent);
55 //! emmited when file download precess is complete
56 void fileDownloaded(QString);
59 void dictListReceived(QNetworkReply*);
60 void processFinished(int);
63 void downloadComplete();
64 QList<DownloadDict> dicts;
65 QWidget* parentDialog;
66 QString _downloadedFile;
67 XdxfDictDownloadProgressDialog* progressDialog;
74 #endif // XDXFDICTDOWNLOADER_H