• 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
  • bittorrent
btdatasource.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
4 
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 
11 #ifndef BTDATASOURCE_H
12 #define BTDATASOURCE_H
13 
14 #include "core/transferdatasource.h"
15 
16 #include <kio/job.h>
17 #include <KUrl>
18 #include <QTimer>
19 
20 namespace bt
21 {
22  class TorrentControl;
23 }
24 
25 class BTChunkSelectorFactory;
26 class BTChunkSelector;
27 class BTCacheFactory;
28 class BTCache;
29 
30 class BTDataSource : public TransferDataSource
31 {
32  Q_OBJECT
33  public:
34  BTDataSource(const KUrl &srcUrl, QObject *parent);
35  ~BTDataSource();
36 
37  void start();
38  void stop();
39  void addSegments(const QPair<KIO::fileoffset_t, KIO::fileoffset_t> &segmentSize, const QPair<int, int> &segmentRange);
40  void getData(const KIO::fileoffset_t &off, const QByteArray &dataArray);
41 
42  private slots:
43  void init(const KUrl &torrentSource, const QByteArray &data);
44  void cacheAdded(BTCache *cache);
45  void selectorAdded(BTChunkSelector *selector);
46  void update();
47 
48  private:
49  bt::TorrentControl *tc;
50  BTChunkSelectorFactory *csf;
51  BTChunkSelector *cs;
52  BTCacheFactory *cf;
53 
54  KIO::fileoffset_t m_offset;
55  KIO::fileoffset_t m_bytes;
56  KUrl m_torrentSource;
57  QTimer timer;
58 };
59 
60 #endif
BTDataSource::start
void start()
Definition: btdatasource.cpp:79
BTChunkSelector
Definition: btchunkselector.h:29
BTDataSource::BTDataSource
BTDataSource(const KUrl &srcUrl, QObject *parent)
Definition: btdatasource.cpp:32
TransferDataSource
This Class is an interface for inter-plugins data change.
Definition: transferdatasource.h:26
QObject
BTCacheFactory
Definition: btcache.h:156
TransferDataSource::data
void data(KIO::fileoffset_t offset, const QByteArray &data, bool &worked)
Returns data in the forms of chucks.
BTDataSource::~BTDataSource
~BTDataSource()
Definition: btdatasource.cpp:62
BTDataSource::getData
void getData(const KIO::fileoffset_t &off, const QByteArray &dataArray)
Definition: btdatasource.cpp:162
BTDataSource::stop
void stop()
Definition: btdatasource.cpp:111
transferdatasource.h
BTDataSource::addSegments
void addSegments(const QPair< KIO::fileoffset_t, KIO::fileoffset_t > &segmentSize, const QPair< int, int > &segmentRange)
Adds multiple continuous segments that should be downloaded by this TransferDataSource.
BTDataSource
Definition: btdatasource.h:30
BTChunkSelectorFactory
Definition: btchunkselector.h:49
BTCache
Definition: btcache.h:33
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