~ubuntu-branches/ubuntu/maverick/transmission/maverick

« back to all changes in this revision

Viewing changes to wx/filter.h

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-05-22 21:57:30 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (2.1.18 sid) (1.3.8 upstream)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20090522215730-ly5kgv5aw9ig2u82
Tags: upstream-1.61
ImportĀ upstreamĀ versionĀ 1.61

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@transmissionbt.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 7664 2009-01-11 17:46:51Z 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