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 _VIEWPROJECTS_H_
21
#define _VIEWPROJECTS_H_
23
#if defined(__GNUG__) && !defined(__APPLE__)
24
#pragma interface "ViewProjects.cpp"
28
#include "BOINCBaseView.h"
31
class CProject : public wxObject
37
wxString m_strProjectName;
38
wxString m_strAccountName;
39
wxString m_strTeamName;
40
wxString m_strTotalCredit;
41
wxString m_strAVGCredit;
42
wxString m_strResourceShare;
47
class CViewProjects : public CBOINCBaseView
49
DECLARE_DYNAMIC_CLASS( CViewProjects )
53
CViewProjects(wxNotebook* pNotebook);
57
virtual wxString& GetViewName();
58
virtual wxString& GetViewDisplayName();
59
virtual const char** GetViewIcon();
61
void OnProjectUpdate( wxCommandEvent& event );
62
void OnProjectSuspend( wxCommandEvent& event );
63
void OnProjectNoNewWork( wxCommandEvent& event );
64
void OnProjectReset( wxCommandEvent& event );
65
void OnProjectDetach( wxCommandEvent& event );
67
void OnProjectWebsiteClicked( wxEvent& event );
70
std::vector<CProject*> m_ProjectCache;
72
virtual wxInt32 GetDocCount();
74
virtual wxString OnListGetItemText( long item, long column ) const;
76
virtual wxString OnDocGetItemText( long item, long column ) const;
78
virtual wxInt32 AddCacheElement();
79
virtual wxInt32 EmptyCache();
80
virtual wxInt32 GetCacheCount();
81
virtual wxInt32 RemoveCacheElement();
82
virtual wxInt32 UpdateCache( long item, long column, wxString& strNewData );
84
virtual void UpdateSelection();
86
wxInt32 FormatProjectName( wxInt32 item, wxString& strBuffer ) const;
87
wxInt32 FormatAccountName( wxInt32 item, wxString& strBuffer ) const;
88
wxInt32 FormatTeamName( wxInt32 item, wxString& strBuffer ) const;
89
wxInt32 FormatTotalCredit( wxInt32 item, wxString& strBuffer ) const;
90
wxInt32 FormatAVGCredit( wxInt32 item, wxString& strBuffer ) const;
91
wxInt32 FormatResourceShare( wxInt32 item, wxString& strBuffer ) const;
92
wxInt32 FormatStatus( wxInt32 item, wxString& strBuffer ) const;
94
bool IsWebsiteLink( const wxString& strLink );
95
wxInt32 ConvertWebsiteIndexToLink( wxInt32 iProjectIndex, wxInt32 iWebsiteIndex, wxString& strLink );
96
wxInt32 ConvertLinkToWebsiteIndex( const wxString& strLink, wxInt32& iProjectIndex, wxInt32& iWebsiteIndex );