1
// Berkeley Open Infrastructure for Network Computing
2
// http://boinc.berkeley.edu
3
// Copyright (C) 2005 University of California
5
// This is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation;
8
// either version 2.1 of the License, or (at your option) any later version.
10
// This software is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
// See the GNU Lesser General Public License for more details.
15
// To view the GNU Lesser General Public License visit
16
// http://www.gnu.org/copyleft/lesser.html
17
// or write to the Free Software Foundation, Inc.,
18
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef _VIEWTRANSFERS_H_
21
#define _VIEWTRANSFERS_H_
23
#if defined(__GNUG__) && !defined(__APPLE__)
24
#pragma interface "ViewTransfers.cpp"
28
#include "BOINCBaseView.h"
31
class CTransfer : public wxObject {
36
wxString m_strProjectName;
37
wxString m_strFileName;
38
wxString m_strProgress;
46
class CViewTransfers : public CBOINCBaseView {
47
DECLARE_DYNAMIC_CLASS( CViewTransfers )
51
CViewTransfers(wxNotebook* pNotebook);
55
virtual wxString& GetViewName();
56
virtual wxString& GetViewDisplayName();
57
virtual const char** GetViewIcon();
59
void OnTransfersRetryNow( wxCommandEvent& event );
60
void OnTransfersAbort( wxCommandEvent& event );
63
std::vector<CTransfer*> m_TransferCache;
65
virtual wxInt32 GetDocCount();
67
virtual wxString OnListGetItemText( long item, long column ) const;
69
virtual wxString OnDocGetItemText( long item, long column ) const;
71
virtual wxInt32 AddCacheElement();
72
virtual wxInt32 EmptyCache();
73
virtual wxInt32 GetCacheCount();
74
virtual wxInt32 RemoveCacheElement();
75
virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData );
77
virtual void UpdateSelection();
79
wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const;
80
wxInt32 FormatFileName( wxInt32 item, wxString& strBuffer ) const;
81
wxInt32 FormatProgress( wxInt32 item, wxString& strBuffer ) const;
82
wxInt32 FormatSize( wxInt32 item, wxString& strBuffer ) const;
83
wxInt32 FormatTime( wxInt32 item, wxString& strBuffer ) const;
84
wxInt32 FormatSpeed( wxInt32 item, wxString& strBuffer ) const;
85
wxInt32 FormatStatus( wxInt32 item, wxString& strBuffer ) const;
1
// This file is part of BOINC.
2
// http://boinc.berkeley.edu
3
// Copyright (C) 2008 University of California
5
// BOINC is free software; you can redistribute it and/or modify it
6
// under the terms of the GNU Lesser General Public License
7
// as published by the Free Software Foundation,
8
// either version 3 of the License, or (at your option) any later version.
10
// BOINC is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
// See the GNU Lesser General Public License for more details.
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef _VIEWTRANSFERS_H_
19
#define _VIEWTRANSFERS_H_
21
#if defined(__GNUG__) && !defined(__APPLE__)
22
#pragma interface "ViewTransfers.cpp"
26
#include "BOINCBaseView.h"
29
class CTransfer : public wxObject {
34
wxString m_strProjectName;
35
wxString m_strFileName;
37
double m_fBytesXferred;
42
wxString m_strProjectURL; // Used internally, not displayed
43
wxString m_strProgress;
50
class CViewTransfers : public CBOINCBaseView {
51
DECLARE_DYNAMIC_CLASS( CViewTransfers )
55
CViewTransfers(wxNotebook* pNotebook);
59
virtual wxString& GetViewName();
60
virtual wxString& GetViewDisplayName();
61
virtual const char** GetViewIcon();
62
virtual const int GetViewCurrentViewPage();
64
virtual wxString GetKeyValue1(int iRowIndex);
65
virtual wxString GetKeyValue2(int iRowIndex);
66
virtual int FindRowIndexByKeyValues(wxString& key1, wxString& key2);
68
void OnTransfersRetryNow( wxCommandEvent& event );
69
void OnTransfersAbort( wxCommandEvent& event );
71
std::vector<CTransfer*> m_TransferCache;
74
virtual wxInt32 GetDocCount();
76
virtual wxString OnListGetItemText( long item, long column ) const;
78
virtual wxInt32 AddCacheElement();
79
virtual wxInt32 EmptyCache();
80
virtual wxInt32 GetCacheCount();
81
virtual wxInt32 RemoveCacheElement();
82
virtual bool SynchronizeCacheItem(wxInt32 iRowIndex, wxInt32 iColumnIndex);
84
virtual bool IsSelectionManagementNeeded();
86
virtual void UpdateSelection();
88
void GetDocProjectName(wxInt32 item, wxString& strBuffer) const;
89
void GetDocFileName(wxInt32 item, wxString& strBuffer) const;
90
void GetDocProgress(wxInt32 item, float& fBuffer) const;
91
wxInt32 FormatProgress( float fBuffer, wxString& strBuffer ) const;
92
void GetDocBytesXferred(wxInt32 item, double& fBuffer) const;
93
void GetDocTotalBytes(wxInt32 item, double& fBuffer) const;
94
wxInt32 FormatSize( double fBytesSent, double fFileSize, wxString& strBuffer ) const;
95
void GetDocTime(wxInt32 item, double& fBuffer) const;
96
wxInt32 FormatTime( double fBuffer, wxString& strBuffer ) const;
97
void GetDocSpeed(wxInt32 item, double& fBuffer) const;
98
wxInt32 FormatSpeed( double fBuffer, wxString& strBuffer ) const;
99
void GetDocStatus(wxInt32 item, wxString& strBuffer) const;
100
void GetDocProjectURL(wxInt32 item, wxString& strBuffer) const;
102
virtual double GetProgressValue(long item);
103
virtual wxString GetProgressText( long item);
105
int GetTransferCacheAtIndex(CTransfer*& transferPtr, int index);
107
DECLARE_EVENT_TABLE()