00001 // This file is part of BOINC. 00002 // http://boinc.berkeley.edu 00003 // Copyright (C) 2008 University of California 00004 // 00005 // BOINC is free software; you can redistribute it and/or modify it 00006 // under the terms of the GNU Lesser General Public License 00007 // as published by the Free Software Foundation, 00008 // either version 3 of the License, or (at your option) any later version. 00009 // 00010 // BOINC is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 // See the GNU Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with BOINC. If not, see <http://www.gnu.org/licenses/>. 00017 00018 #ifndef _ACCT_SETUP_H_ 00019 #define _ACCT_SETUP_H_ 00020 00021 #include "gui_http.h" 00022 #include "error_numbers.h" 00023 00025 00026 struct PROJECT_INIT { 00027 char url[256]; 00028 char name[256]; 00029 char account_key[256]; 00030 00031 PROJECT_INIT(); 00032 int init(); 00033 int remove(); 00034 void clear(); 00035 }; 00036 00037 struct ACCOUNT_IN { 00038 std::string url; 00040 std::string email_addr; 00042 std::string user_name; 00043 std::string passwd_hash; 00044 00045 void parse(char*); 00046 }; 00047 00048 struct GET_PROJECT_CONFIG_OP: public GUI_HTTP_OP { 00049 std::string reply; 00050 int error_num; 00051 00052 GET_PROJECT_CONFIG_OP(GUI_HTTP* p){ 00053 error_num = BOINC_SUCCESS; 00054 gui_http = p; 00055 } 00056 virtual ~GET_PROJECT_CONFIG_OP(){} 00057 int do_rpc(string url); 00058 virtual void handle_reply(int http_op_retval); 00059 }; 00060 00061 struct LOOKUP_ACCOUNT_OP: public GUI_HTTP_OP { 00062 std::string reply; 00063 int error_num; 00064 00065 LOOKUP_ACCOUNT_OP(GUI_HTTP* p){ 00066 error_num = BOINC_SUCCESS; 00067 gui_http = p; 00068 } 00069 virtual ~LOOKUP_ACCOUNT_OP(){} 00070 int do_rpc(ACCOUNT_IN&); 00071 virtual void handle_reply(int http_op_retval); 00072 }; 00073 00074 struct CREATE_ACCOUNT_OP: public GUI_HTTP_OP { 00075 std::string reply; 00076 int error_num; 00077 00078 CREATE_ACCOUNT_OP(GUI_HTTP* p){ 00079 error_num = BOINC_SUCCESS; 00080 gui_http = p; 00081 } 00082 virtual ~CREATE_ACCOUNT_OP(){} 00083 int do_rpc(ACCOUNT_IN&); 00084 virtual void handle_reply(int http_op_retval); 00085 }; 00086 00087 struct GET_CURRENT_VERSION_OP: public GUI_HTTP_OP { 00088 int error_num; 00089 00090 GET_CURRENT_VERSION_OP(GUI_HTTP* p){ 00091 error_num = BOINC_SUCCESS; 00092 gui_http = p; 00093 } 00094 virtual ~GET_CURRENT_VERSION_OP(){} 00095 int do_rpc(); 00096 virtual void handle_reply(int http_op_retval); 00097 }; 00098 00099 struct GET_PROJECT_LIST_OP: public GUI_HTTP_OP { 00100 int error_num; 00101 00102 GET_PROJECT_LIST_OP(GUI_HTTP* p){ 00103 error_num = BOINC_SUCCESS; 00104 gui_http = p; 00105 } 00106 virtual ~GET_PROJECT_LIST_OP(){} 00107 int do_rpc(); 00108 virtual void handle_reply(int http_op_retval); 00109 }; 00110 00111 struct PROJECT_ATTACH { 00112 int error_num; 00113 std::vector<std::string> messages; 00114 }; 00115 00116 #endif
1.5.6