~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to clientgui/ProjectPropertiesPage.h

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Berkeley Open Infrastructure for Network Computing
2
 
// http://boinc.berkeley.edu
3
 
// Copyright (C) 2005 University of California
4
 
//
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.
9
 
//
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.
14
 
//
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
19
 
//
20
 
 
21
 
#ifndef _WIZ_PROJECTPROPERTIESPAGE_H_
22
 
#define _WIZ_PROJECTPROPERTIESPAGE_H_
23
 
 
24
 
#if defined(__GNUG__) && !defined(__APPLE__)
25
 
#pragma interface "ProjectPropertiesPage.cpp"
26
 
#endif
27
 
 
28
 
/*!
29
 
 * CProjectPropertiesPage custom events
30
 
 */
31
 
 
32
 
class CProjectPropertiesPageEvent : public wxEvent
33
 
{
34
 
public:
35
 
    CProjectPropertiesPageEvent(wxEventType evtType, wxWizardPageEx *parent)
36
 
        : wxEvent(-1, evtType)
37
 
        {
38
 
            SetEventObject(parent);
39
 
        }
40
 
 
41
 
    virtual wxEvent *Clone() const { return new CProjectPropertiesPageEvent(*this); }
42
 
};
43
 
 
44
 
 
45
 
BEGIN_DECLARE_EVENT_TYPES()
46
 
DECLARE_EVENT_TYPE( wxEVT_PROJECTPROPERTIES_STATECHANGE, 11000 )
47
 
END_DECLARE_EVENT_TYPES()
48
 
 
49
 
#define EVT_PROJECTPROPERTIES_STATECHANGE(fn) \
50
 
    DECLARE_EVENT_TABLE_ENTRY(wxEVT_PROJECTPROPERTIES_STATECHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
51
 
 
52
 
/*!
53
 
 * CProjectPropertiesPage states
54
 
 */
55
 
 
56
 
#define PROJPROP_INIT                                   0
57
 
#define PROJPROP_RETRPROJECTPROPERTIES_BEGIN            1
58
 
#define PROJPROP_RETRPROJECTPROPERTIES_EXECUTE          2
59
 
#define PROJPROP_DETERMINENETWORKSTATUS_BEGIN           3
60
 
#define PROJPROP_DETERMINENETWORKSTATUS_EXECUTE         4
61
 
#define PROJPROP_CLEANUP                                5
62
 
#define PROJPROP_END                                    6
63
 
 
64
 
/*!
65
 
 * CProjectPropertiesPage class declaration
66
 
 */
67
 
 
68
 
class CProjectPropertiesPage: public wxWizardPageEx
69
 
{    
70
 
    DECLARE_DYNAMIC_CLASS( CProjectPropertiesPage )
71
 
    DECLARE_EVENT_TABLE()
72
 
 
73
 
public:
74
 
    /// Constructors
75
 
    CProjectPropertiesPage( );
76
 
 
77
 
    CProjectPropertiesPage( CBOINCBaseWizard* parent );
78
 
 
79
 
    /// Creation
80
 
    bool Create( CBOINCBaseWizard* parent );
81
 
 
82
 
    /// Creates the controls and sizers
83
 
    void CreateControls();
84
 
 
85
 
////@begin CProjectPropertiesPage event handler declarations
86
 
 
87
 
    /// wxEVT_WIZARD_PAGE_CHANGED event handler for ID_PROJECTPROPERTIESPAGE
88
 
    void OnPageChanged( wxWizardExEvent& event );
89
 
 
90
 
    /// wxEVT_WIZARD_CANCEL event handler for ID_PROJECTPROPERTIESPAGE
91
 
    void OnCancel( wxWizardExEvent& event );
92
 
 
93
 
////@end CProjectPropertiesPage event handler declarations
94
 
 
95
 
    void OnStateChange( CProjectPropertiesPageEvent& event );
96
 
 
97
 
////@begin CProjectPropertiesPage member function declarations
98
 
 
99
 
    /// Gets the previous page.
100
 
    virtual wxWizardPageEx* GetPrev() const;
101
 
 
102
 
    /// Gets the next page.
103
 
    virtual wxWizardPageEx* GetNext() const;
104
 
 
105
 
    /// Retrieves bitmap resources
106
 
    wxBitmap GetBitmapResource( const wxString& name );
107
 
 
108
 
    /// Retrieves icon resources
109
 
    wxIcon GetIconResource( const wxString& name );
110
 
////@end CProjectPropertiesPage member function declarations
111
 
 
112
 
    bool GetProjectPropertiesSucceeded() const { return m_bProjectPropertiesSucceeded ; }
113
 
    void SetProjectPropertiesSucceeded(bool value) { m_bProjectPropertiesSucceeded = value ; }
114
 
 
115
 
    bool GetProjectPropertiesURLFailure() const { return m_bProjectPropertiesURLFailure ; }
116
 
    void SetProjectPropertiesURLFailure(bool value) { m_bProjectPropertiesURLFailure = value ; }
117
 
 
118
 
    bool GetProjectAccountCreationDisabled() const { return m_bProjectAccountCreationDisabled ; }
119
 
    void SetProjectAccountCreationDisabled(bool value) { m_bProjectAccountCreationDisabled = value ; }
120
 
 
121
 
    bool GetProjectClientAccountCreationDisabled() const { return m_bProjectClientAccountCreationDisabled ; }
122
 
    void SetProjectClientAccountCreationDisabled(bool value) { m_bProjectClientAccountCreationDisabled = value ; }
123
 
 
124
 
    bool GetProjectAlreadyAttached() const { return m_bProjectAlreadyAttached ; }
125
 
    void SetProjectAlreadyAttached(bool value) { m_bProjectAlreadyAttached = value ; }
126
 
 
127
 
    bool GetNetworkConnectionDetected() const { return m_bNetworkConnectionDetected ; }
128
 
    void SetNetworkConnectionDetected(bool value) { m_bNetworkConnectionDetected = value ; }
129
 
 
130
 
    bool GetServerReportedError() const { return m_bServerReportedError ; }
131
 
    void SetServerReportedError(bool value) { m_bServerReportedError = value ; }
132
 
 
133
 
    bool GetTermsOfUseRequired() const { return m_bTermsOfUseRequired ; }
134
 
    void SetTermsOfUseRequired(bool value) { m_bTermsOfUseRequired = value ; }
135
 
 
136
 
    wxInt32 GetCurrentState() const { return m_iCurrentState ; }
137
 
    void SetNextState(wxInt32 value) { m_iCurrentState = value ; }
138
 
 
139
 
    /// Should we show tooltips?
140
 
    static bool ShowToolTips();
141
 
 
142
 
    /// Progress Image Support
143
 
    void StartProgress(wxStaticBitmap* pBitmap);
144
 
    void IncrementProgress(wxStaticBitmap* pBitmap);
145
 
    void FinishProgress(wxStaticBitmap* pBitmap);
146
 
 
147
 
////@begin CProjectPropertiesPage member variables
148
 
    wxStaticText* m_pTitleStaticCtrl;
149
 
    wxStaticBitmap* m_pProgressIndicator;
150
 
////@end CProjectPropertiesPage member variables
151
 
    bool m_bProjectPropertiesSucceeded;
152
 
    bool m_bProjectPropertiesURLFailure;
153
 
    bool m_bProjectAccountCreationDisabled;
154
 
    bool m_bProjectClientAccountCreationDisabled;
155
 
    bool m_bProjectAlreadyAttached;
156
 
    bool m_bNetworkConnectionDetected;
157
 
    bool m_bServerReportedError;
158
 
    bool m_bTermsOfUseRequired;
159
 
    int m_iBitmapIndex;
160
 
    int m_iCurrentState;
161
 
};
162
 
 
163
 
#endif // _WIZ_PROJECTPROPERTIESPAGE_H_
164
 
 
 
1
// This file is part of BOINC.
 
2
// http://boinc.berkeley.edu
 
3
// Copyright (C) 2008 University of California
 
4
//
 
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.
 
9
//
 
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.
 
14
//
 
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/>.
 
17
//
 
18
#ifndef _WIZ_PROJECTPROPERTIESPAGE_H_
 
19
#define _WIZ_PROJECTPROPERTIESPAGE_H_
 
20
 
 
21
#if defined(__GNUG__) && !defined(__APPLE__)
 
22
#pragma interface "ProjectPropertiesPage.cpp"
 
23
#endif
 
24
 
 
25
/*!
 
26
 * CProjectPropertiesPage custom events
 
27
 */
 
28
 
 
29
class CProjectPropertiesPageEvent : public wxEvent
 
30
{
 
31
public:
 
32
    CProjectPropertiesPageEvent(wxEventType evtType, wxWizardPageEx *parent)
 
33
        : wxEvent(-1, evtType)
 
34
        {
 
35
            SetEventObject(parent);
 
36
        }
 
37
 
 
38
    virtual wxEvent *Clone() const { return new CProjectPropertiesPageEvent(*this); }
 
39
};
 
40
 
 
41
 
 
42
BEGIN_DECLARE_EVENT_TYPES()
 
43
DECLARE_EVENT_TYPE( wxEVT_PROJECTPROPERTIES_STATECHANGE, 11000 )
 
44
END_DECLARE_EVENT_TYPES()
 
45
 
 
46
#define EVT_PROJECTPROPERTIES_STATECHANGE(fn) \
 
47
    DECLARE_EVENT_TABLE_ENTRY(wxEVT_PROJECTPROPERTIES_STATECHANGE, -1, -1, (wxObjectEventFunction) (wxEventFunction) &fn, NULL),
 
48
 
 
49
/*!
 
50
 * CProjectPropertiesPage states
 
51
 */
 
52
 
 
53
#define PROJPROP_INIT                                   0
 
54
#define PROJPROP_RETRPROJECTPROPERTIES_BEGIN            1
 
55
#define PROJPROP_RETRPROJECTPROPERTIES_EXECUTE          2
 
56
#define PROJPROP_DETERMINENETWORKSTATUS_BEGIN           3
 
57
#define PROJPROP_DETERMINENETWORKSTATUS_EXECUTE         4
 
58
#define PROJPROP_DETERMINEACCOUNTINFOSTATUS_BEGIN       5
 
59
#define PROJPROP_DETERMINEACCOUNTINFOSTATUS_EXECUTE     6
 
60
#define PROJPROP_CLEANUP                                7
 
61
#define PROJPROP_END                                    8
 
62
 
 
63
/*!
 
64
 * CProjectPropertiesPage class declaration
 
65
 */
 
66
 
 
67
class CProjectPropertiesPage: public wxWizardPageEx
 
68
{    
 
69
    DECLARE_DYNAMIC_CLASS( CProjectPropertiesPage )
 
70
    DECLARE_EVENT_TABLE()
 
71
 
 
72
public:
 
73
    /// Constructors
 
74
    CProjectPropertiesPage( );
 
75
 
 
76
    CProjectPropertiesPage( CBOINCBaseWizard* parent );
 
77
 
 
78
    /// Creation
 
79
    bool Create( CBOINCBaseWizard* parent );
 
80
 
 
81
    /// Creates the controls and sizers
 
82
    void CreateControls();
 
83
 
 
84
////@begin CProjectPropertiesPage event handler declarations
 
85
 
 
86
    /// wxEVT_WIZARD_PAGE_CHANGED event handler for ID_PROJECTPROPERTIESPAGE
 
87
    void OnPageChanged( wxWizardExEvent& event );
 
88
 
 
89
    /// wxEVT_WIZARD_CANCEL event handler for ID_PROJECTPROPERTIESPAGE
 
90
    void OnCancel( wxWizardExEvent& event );
 
91
 
 
92
////@end CProjectPropertiesPage event handler declarations
 
93
 
 
94
    void OnStateChange( CProjectPropertiesPageEvent& event );
 
95
 
 
96
////@begin CProjectPropertiesPage member function declarations
 
97
 
 
98
    /// Gets the previous page.
 
99
    virtual wxWizardPageEx* GetPrev() const;
 
100
 
 
101
    /// Gets the next page.
 
102
    virtual wxWizardPageEx* GetNext() const;
 
103
 
 
104
    /// Retrieves bitmap resources
 
105
    wxBitmap GetBitmapResource( const wxString& name );
 
106
 
 
107
    /// Retrieves icon resources
 
108
    wxIcon GetIconResource( const wxString& name );
 
109
////@end CProjectPropertiesPage member function declarations
 
110
 
 
111
    bool GetProjectPropertiesSucceeded() const { return m_bProjectPropertiesSucceeded ; }
 
112
    void SetProjectPropertiesSucceeded(bool value) { m_bProjectPropertiesSucceeded = value ; }
 
113
 
 
114
    bool GetProjectPropertiesURLFailure() const { return m_bProjectPropertiesURLFailure ; }
 
115
    void SetProjectPropertiesURLFailure(bool value) { m_bProjectPropertiesURLFailure = value ; }
 
116
 
 
117
    bool GetProjectPropertiesCommunicationFailure() const { return m_bProjectPropertiesCommunicationFailure ; }
 
118
    void SetProjectPropertiesCommunicationFailure(bool value) { m_bProjectPropertiesCommunicationFailure = value ; }
 
119
 
 
120
    bool GetProjectAccountCreationDisabled() const { return m_bProjectAccountCreationDisabled ; }
 
121
    void SetProjectAccountCreationDisabled(bool value) { m_bProjectAccountCreationDisabled = value ; }
 
122
 
 
123
    bool GetProjectClientAccountCreationDisabled() const { return m_bProjectClientAccountCreationDisabled ; }
 
124
    void SetProjectClientAccountCreationDisabled(bool value) { m_bProjectClientAccountCreationDisabled = value ; }
 
125
 
 
126
    bool GetNetworkConnectionNotDetected() const { return m_bNetworkConnectionNotDetected ; }
 
127
    void SetNetworkConnectionNotDetected(bool value) { m_bNetworkConnectionNotDetected = value ; }
 
128
 
 
129
    bool GetServerReportedError() const { return m_bServerReportedError ; }
 
130
    void SetServerReportedError(bool value) { m_bServerReportedError = value ; }
 
131
 
 
132
    bool GetTermsOfUseRequired() const { return m_bTermsOfUseRequired ; }
 
133
    void SetTermsOfUseRequired(bool value) { m_bTermsOfUseRequired = value ; }
 
134
 
 
135
    bool GetCredentialsAlreadyAvailable() const { return m_bCredentialsAlreadyAvailable ; }
 
136
    void SetCredentialsAlreadyAvailable(bool value) { m_bCredentialsAlreadyAvailable = value ; }
 
137
 
 
138
    wxInt32 GetCurrentState() const { return m_iCurrentState ; }
 
139
    void SetNextState(wxInt32 value) { m_iCurrentState = value ; }
 
140
 
 
141
    /// Should we show tooltips?
 
142
    static bool ShowToolTips();
 
143
 
 
144
    /// Progress Image Support
 
145
    void StartProgress(wxStaticBitmap* pBitmap);
 
146
    void IncrementProgress(wxStaticBitmap* pBitmap);
 
147
    void FinishProgress(wxStaticBitmap* pBitmap);
 
148
 
 
149
////@begin CProjectPropertiesPage member variables
 
150
    wxStaticText* m_pTitleStaticCtrl;
 
151
    wxStaticBitmap* m_pProgressIndicator;
 
152
////@end CProjectPropertiesPage member variables
 
153
    bool m_bProjectPropertiesSucceeded;
 
154
    bool m_bProjectPropertiesURLFailure;
 
155
    bool m_bProjectPropertiesCommunicationFailure;
 
156
    bool m_bProjectAccountCreationDisabled;
 
157
    bool m_bProjectClientAccountCreationDisabled;
 
158
    bool m_bNetworkConnectionNotDetected;
 
159
    bool m_bServerReportedError;
 
160
    bool m_bTermsOfUseRequired;
 
161
    bool m_bCredentialsAlreadyAvailable;
 
162
    int m_iBitmapIndex;
 
163
    int m_iCurrentState;
 
164
};
 
165
 
 
166
#endif // _WIZ_PROJECTPROPERTIESPAGE_H_