File indexing completed on 2024-05-12 04:59:20
0001 /*************************************************************************** 0002 * Copyright (C) 2005-2007 by Joris Guisson * 0003 * joris.guisson@gmail.com * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the * 0017 * Free Software Foundation, Inc., * 0018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0019 ***************************************************************************/ 0020 #ifndef KTMONITOR_H 0021 #define KTMONITOR_H 0022 0023 #include <interfaces/monitorinterface.h> 0024 0025 namespace bt 0026 { 0027 class TorrentInterface; 0028 } 0029 0030 namespace kt 0031 { 0032 class PeerView; 0033 class ChunkDownloadView; 0034 class FileView; 0035 0036 /** 0037 @author Joris Guisson 0038 */ 0039 class Monitor : public bt::MonitorInterface 0040 { 0041 bt::TorrentInterface *tc; 0042 PeerView *pv; 0043 ChunkDownloadView *cdv; 0044 FileView *fv; 0045 0046 public: 0047 Monitor(bt::TorrentInterface *tc, PeerView *pv, ChunkDownloadView *cdv, FileView *fv); 0048 ~Monitor() override; 0049 0050 void downloadRemoved(bt::ChunkDownloadInterface *cd) override; 0051 void downloadStarted(bt::ChunkDownloadInterface *cd) override; 0052 void peerAdded(bt::PeerInterface *peer) override; 0053 void peerRemoved(bt::PeerInterface *peer) override; 0054 void stopped() override; 0055 void destroyed() override; 0056 void filePercentageChanged(bt::TorrentFileInterface *file, float percentage) override; 0057 void filePreviewChanged(bt::TorrentFileInterface *file, bool preview) override; 0058 }; 0059 } 0060 0061 #endif