ScummVM API documentation
scummvmcloud.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BACKENDS_DLC_SCUMMVMCLOUD_H
23 #define BACKENDS_DLC_SCUMMVMCLOUD_H
24 
25 #include "common/queue.h"
26 
27 #include "backends/dlc/store.h"
28 #include "backends/networking/curl/request.h"
29 #include "backends/networking/curl/curljsonrequest.h"
30 
31 namespace Networking {
32 class SessionRequest;
33 }
34 
35 namespace DLC {
36 namespace ScummVMCloud {
37 
38 class ScummVMCloud : public DLC::Store {
39 
41 
42 public:
43  ScummVMCloud() {}
44  virtual ~ScummVMCloud() {}
45 
46  virtual void getAllDLCs() override;
47 
48  virtual void startDownloadAsync(const Common::String &id, const Common::String &url) override;
49 
50  virtual void removeCacheFile(const Common::Path &file) override;
51 
52  // extracts the provided zip in the provided destination path
53  Common::Error extractZip(const Common::Path &file, const Common::Path &destPath);
54 
55  void addEntryToConfig(Common::Path gamePath);
56 
57  // callback functions
58  void jsonCallbackGetAllDLCs(const Networking::JsonResponse &response);
59 
60  void errorCallbackGetAllDLCs(const Networking::ErrorResponse &error);
61 
62  void downloadFileCallback(const Networking::DataResponse &response);
63 
64  void errorCallback(const Networking::ErrorResponse &error);
65 };
66 
67 } // End of namespace ScummVMCloud
68 } // End of namespace DLC
69 
70 #endif
Definition: store.h:32
Definition: system.h:51
Definition: str.h:59
Definition: error.h:84
Definition: scummvmcloud.h:31
Definition: request.h:73
Definition: path.h:52
Definition: request.h:47
Definition: scummvmcloud.h:38
Class for reading file and storing locally.
Definition: sessionrequest.h:50
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1