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 _GUI_HTTP_ 00019 #define _GUI_HTTP_ 00020 00021 // Management of HTTP operations done in response to a GUI RPC, 00022 // i.e. triggered by the user. 00023 // 00024 00025 using std::string; 00026 00027 #include "http_curl.h" 00028 00029 #define GUI_HTTP_STATE_IDLE 0 00030 #define GUI_HTTP_STATE_BUSY 1 00031 00032 struct GUI_HTTP_OP; 00033 00035 00038 00039 struct GUI_HTTP { 00040 int state; 00041 GUI_HTTP_OP* gui_http_op; 00042 HTTP_OP http_op; 00043 00044 GUI_HTTP(): state(GUI_HTTP_STATE_IDLE) {} 00045 int do_rpc(GUI_HTTP_OP*, string url, string output_file); 00046 int do_rpc_post(GUI_HTTP_OP*, string url, string input_file, string output_file); 00047 bool poll(); 00048 }; 00049 00051 00052 struct GUI_HTTP_OP { 00053 GUI_HTTP* gui_http; 00054 virtual void handle_reply(int) {} 00055 GUI_HTTP_OP(){} 00056 virtual ~GUI_HTTP_OP(){} 00057 }; 00058 00059 #endif
1.5.6