~ubuntu-branches/ubuntu/raring/rtorrent/raring

« back to all changes in this revision

Viewing changes to src/ui/download.h

  • Committer: Bazaar Package Importer
  • Author(s): Dmitry E. Oboukhov
  • Date: 2009-08-16 09:12:32 UTC
  • mfrom: (1.1.12 upstream) (5.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090816091232-fkf317r620hqsrz1
Tags: 0.8.5-2
* Add patch to fix crash by SCGI, closes: 541487, thanks for jdrexler.
* Standards-Version was bumped to 3.8.3 (no changes required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// rTorrent - BitTorrent client
2
 
// Copyright (C) 2005-2007, Jari Sundell
3
 
//
4
 
// This program is free software; you can redistribute it and/or modify
5
 
// it under the terms of the GNU General Public License as published by
6
 
// the Free Software Foundation; either version 2 of the License, or
7
 
// (at your option) any later version.
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
 
// In addition, as a special exception, the copyright holders give
19
 
// permission to link the code of portions of this program with the
20
 
// OpenSSL library under certain conditions as described in each
21
 
// individual source file, and distribute linked combinations
22
 
// including the two.
23
 
//
24
 
// You must obey the GNU General Public License in all respects for
25
 
// all of the code used other than OpenSSL.  If you modify file(s)
26
 
// with this exception, you may extend this exception to your version
27
 
// of the file(s), but you are not obligated to do so.  If you do not
28
 
// wish to do so, delete this exception statement from your version.
29
 
// If you delete this exception statement from all source files in the
30
 
// program, then also delete it here.
31
 
//
32
 
// Contact:  Jari Sundell <jaris@ifi.uio.no>
33
 
//
34
 
//           Skomakerveien 33
35
 
//           3185 Skoppum, NORWAY
36
 
 
37
 
#ifndef RTORRENT_UI_DOWNLOAD_H
38
 
#define RTORRENT_UI_DOWNLOAD_H
39
 
 
40
 
#include <list>
41
 
#include <torrent/peer/peer.h>
42
 
#include <sigc++/connection.h>
43
 
 
44
 
#include "display/manager.h"
45
 
#include "utils/list_focus.h"
46
 
 
47
 
#include "element_base.h"
48
 
 
49
 
namespace display {
50
 
  class WindowDownloadStatusbar;
51
 
}
52
 
 
53
 
namespace core {
54
 
  class Download;
55
 
}
56
 
 
57
 
namespace ui {
58
 
 
59
 
class Download : public ElementBase {
60
 
public:
61
 
  typedef display::WindowDownloadStatusbar WDownloadStatus;
62
 
 
63
 
  typedef std::list<torrent::Peer>         PList;
64
 
 
65
 
  typedef enum {
66
 
    DISPLAY_MENU,
67
 
    DISPLAY_PEER_LIST,
68
 
    DISPLAY_INFO,
69
 
    DISPLAY_FILE_LIST,
70
 
    DISPLAY_TRACKER_LIST,
71
 
    DISPLAY_CHUNKS_SEEN,
72
 
    DISPLAY_TRANSFER_LIST,
73
 
    DISPLAY_MAX_SIZE
74
 
  } Display;
75
 
 
76
 
  Download(core::Download* d);
77
 
  ~Download();
78
 
 
79
 
  void                activate(display::Frame* frame, bool focus = true);
80
 
  void                disable();
81
 
 
82
 
  void                activate_display(Display d, bool focusDisplay);
83
 
 
84
 
  void                activate_display_focus(Display d) { activate_display(d, true); }
85
 
  void                activate_display_menu(Display d)  { activate_display(d, false); }
86
 
 
87
 
  void                receive_next_priority();
88
 
  void                receive_prev_priority();
89
 
 
90
 
  display::Window*    window() { return NULL; }
91
 
 
92
 
private:
93
 
  Download(const Download&);
94
 
  void operator = (const Download&);
95
 
 
96
 
  inline ElementBase* create_menu();
97
 
  inline ElementBase* create_info();
98
 
 
99
 
  void                receive_max_uploads(int t);
100
 
  void                receive_min_peers(int t);
101
 
  void                receive_max_peers(int t);
102
 
 
103
 
  void                bind_keys();
104
 
 
105
 
  core::Download*     m_download;
106
 
 
107
 
  Display             m_state;
108
 
  ElementBase*        m_uiArray[DISPLAY_MAX_SIZE];
109
 
 
110
 
  bool                m_focusDisplay;
111
 
 
112
 
  WDownloadStatus*    m_windowDownloadStatus;
113
 
};
114
 
 
115
 
}
116
 
 
117
 
#endif