Disable clipboardsharing in view only mode.
[kdenetwork.git] / kget / core / linkimporter.h
blob6109b6150124f6c79d0285cf978fbb6e2cbd2313
1 /* This file is part of the KDE project
3 Copyright (C) 2008 Javier Goday <jgoday @ gmail.com>
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9 */
10 #ifndef LINKIMPORTER_H
11 #define LINKIMPORTER_H
13 #include "kget_export.h"
15 #include <QList>
16 #include <QThread>
18 #include <KUrl>
20 class KLocalizedString;
22 /**
23 * Import a list of urls from a file (local or remote)
25 class KGET_EXPORT LinkImporter : public QThread
27 Q_OBJECT
28 public:
29 LinkImporter(const KUrl &source, QObject *parent);
30 LinkImporter(QObject *parent);
31 ~LinkImporter();
33 /**
34 * Check for urls in clipboard
36 void checkClipboard(const QString &clipboardContent);
38 /**
39 * Start reading the url contents
41 void run();
43 /**
44 * copy the remote file out of the thread
46 void copyRemoteFile();
48 /**
49 * Returns a list with the links of the selected url m_url
51 QList <QString> links()
53 return m_transfers;
56 signals:
57 void error(const KLocalizedString &);
58 void progress(int progress);
60 private slots:
61 void slotReadFile(const QUrl &url);
63 private:
64 /**
65 * Checks if an url is valid and adds it to the transfers lists
67 void addTransfer(QString &link);
69 private:
70 KUrl m_url;
71 QList <QString> m_transfers;
72 QString m_tempFile;
74 #endif