• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • transfer-plugins
  • mmsthreads
mmsdownload.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE project
3  Copyright (C) 2011 Ernesto Rodriguez Ortiz <eortiz@uci.cu>
4 
5  This program 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.
9 
10  This program 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.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 */
19 
20 #ifndef MMSDOWNLOAD_H
21 #define MMSDOWNLOAD_H
22 
23 #include <libmms/mmsx.h>
24 #include <QString>
25 #include <QTimer>
26 #include <QMap>
27 #include <QFile>
28 #include <QDataStream>
29 #include <kstandarddirs.h>
30 
31 #include "mmsthread.h"
32 
33 
34 class MmsDownload : public QThread
35 {
36  Q_OBJECT
37  public:
38  MmsDownload(const QString& url, const QString& name, const QString& temp,
39  int amountsThread);
40  ~MmsDownload();
41  void run();
42  void stopTransfer();
43  int threadsAlive();
44 
45  public slots:
46  void slotThreadFinish();
47  void slotRead(int reading, int thread_end, int thead_ini);
48  void slotSpeedChanged();
49  void slotIsThreadConnected(bool connected);
50 
51  signals:
52  void signBrokenUrl();
53  void signNotAllowMultiDownload();
54  void signThreadFinish();
55  qulonglong signDownloaded(qulonglong reading);
56  qulonglong signTotalSize(qulonglong size);
57  unsigned long signSpeed(unsigned long bytes_per_second);
58  void signRestartDownload(int connections);
59 
60  private:
61  bool isWorkingUrl();
62  void splitTransfer();
63  void startTransfer();
64  void unSerialization();
65  void serialization();
66 
67  QString m_sourceUrl;
68  QString m_fileName;
69  QString m_fileTemp;
70  int m_amountThreads;
71  int m_connectionsFails;
72  int m_connectionsSuccefully;
73  qulonglong m_downloadedSize;
74  QList<qulonglong> m_prevDownloadedSizes;
75  mmsx_t* m_mms;
76  QTimer* m_speedTimer;
77  QList<MmsThread*> m_threadList;
78  QMap<int, int> m_mapEndIni;
79 };
80 
81 #endif // MMSDOWNLOAD_H
MmsDownload::slotThreadFinish
void slotThreadFinish()
Definition: mmsdownload.cpp:159
MmsDownload::slotRead
void slotRead(int reading, int thread_end, int thead_ini)
Definition: mmsdownload.cpp:171
MmsDownload::threadsAlive
int threadsAlive()
Definition: mmsdownload.cpp:153
MmsDownload::signDownloaded
qulonglong signDownloaded(qulonglong reading)
MmsDownload::signRestartDownload
void signRestartDownload(int connections)
MmsDownload
Definition: mmsdownload.h:34
MmsDownload::signSpeed
unsigned long signSpeed(unsigned long bytes_per_second)
mmsthread.h
MmsDownload::MmsDownload
MmsDownload(const QString &url, const QString &name, const QString &temp, int amountsThread)
Definition: mmsdownload.cpp:24
MmsDownload::stopTransfer
void stopTransfer()
Definition: mmsdownload.cpp:141
MmsDownload::run
void run()
Definition: mmsdownload.cpp:50
MmsDownload::slotIsThreadConnected
void slotIsThreadConnected(bool connected)
Definition: mmsdownload.cpp:185
MmsDownload::signThreadFinish
void signThreadFinish()
MmsDownload::signTotalSize
qulonglong signTotalSize(qulonglong size)
MmsDownload::~MmsDownload
~MmsDownload()
Definition: mmsdownload.cpp:41
MmsDownload::signNotAllowMultiDownload
void signNotAllowMultiDownload()
QThread
MmsDownload::slotSpeedChanged
void slotSpeedChanged()
Definition: mmsdownload.cpp:119
MmsDownload::signBrokenUrl
void signBrokenUrl()
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal