~ubuntu-branches/ubuntu/hardy/transmission/hardy-updates

« back to all changes in this revision

Viewing changes to wx/filter.h

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-01-14 20:27:42 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20080114202742-38opwgiy41dx0187
Tags: upstream-1.01
ImportĀ upstreamĀ versionĀ 1.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Xmission - a cross-platform bittorrent client
 
3
 * Copyright (C) 2007 Charles Kerr <charles@rebelbase.com>
 
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; version 2 of the License.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 *
 
18
 * $Id: filter.h 3109 2007-09-20 19:47:19Z charles $
 
19
 */
 
20
 
 
21
#ifndef __XMISSION_TORRENT_FILTER_H__
 
22
#define __XMISSION_TORRENT_FILTER_H__
 
23
 
 
24
#include <vector>
 
25
#include <wx/intl.h>
 
26
#include <libtransmission/transmission.h>
 
27
 
 
28
class TorrentFilter
 
29
{
 
30
    private:
 
31
 
 
32
        enum ShowFlags
 
33
        {
 
34
            FLAG_ALL        = (1<<0),
 
35
            FLAG_COMPLETE   = (1<<1),
 
36
            FLAG_INCOMPLETE = (1<<2),
 
37
            FLAG_SEEDING    = (1<<3),
 
38
            FLAG_LEECHING   = (1<<4),
 
39
            FLAG_ACTIVE     = (1<<5),
 
40
            FLAG_IDLE       = (1<<6)
 
41
        };
 
42
 
 
43
    public:
 
44
 
 
45
        typedef std::vector<tr_torrent*> torrents_v;
 
46
 
 
47
        enum Show {
 
48
            ALL,
 
49
            COMPLETE, INCOMPLETE,
 
50
            SEEDING, LEECHING,
 
51
            ACTIVE, IDLE,
 
52
            N_FILTERS
 
53
        };
 
54
 
 
55
        static int GetFlags( const tr_torrent * );
 
56
 
 
57
        static void CountHits( const torrents_v & torrents,
 
58
                               int              * counts );
 
59
 
 
60
        static wxString GetName( int show, int count=0 );
 
61
 
 
62
        static void RemoveFailures( int           show,
 
63
                                    torrents_v  &  torrents );
 
64
};
 
65
 
 
66
 
 
67
#endif