Revert "transmission: update from 2.13 to 2.22"
[tomato.git] / release / src / router / transmission / qt / torrent-delegate.h
blob6d8e3481c377935694f585d7055e756b6274d830
1 /*
2 * This file Copyright (C) Mnemosyne LLC
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10 * $Id: torrent-delegate.h 11092 2010-08-01 20:36:13Z charles $
13 #ifndef QTR_TORRENT_DELEGATE_H
14 #define QTR_TORRENT_DELEGATE_H
16 #include <QItemDelegate>
17 #include <QSize>
19 class QStyleOptionProgressBarV2;
20 class QStyleOptionViewItem;
21 class QStyle;
22 class Session;
23 class Torrent;
25 class TorrentDelegate: public QItemDelegate
27 Q_OBJECT
29 protected:
30 QStyleOptionProgressBarV2 * myProgressBarStyle;
32 protected:
33 QString statusString( const Torrent& tor ) const;
34 QString progressString( const Torrent& tor ) const;
35 QString shortStatusString( const Torrent& tor ) const;
36 QString shortTransferString( const Torrent& tor ) const;
38 protected:
39 QSize margin( const QStyle& style ) const;
40 virtual QSize sizeHint( const QStyleOptionViewItem&, const Torrent& ) const;
41 virtual void drawTorrent( QPainter* painter, const QStyleOptionViewItem& option, const Torrent& ) const;
43 public:
44 explicit TorrentDelegate( QObject * parent=0 );
45 virtual ~TorrentDelegate( );
47 QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
48 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
51 #endif