ScummVM API documentation
remotebrowser.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 GUI_REMOTEBROWSER_DIALOG_H
23#define GUI_REMOTEBROWSER_DIALOG_H
24
25#include "gui/dialog.h"
26#include "common/fs.h"
27#include "backends/cloud/storagefile.h"
28#include "backends/networking/http/request.h"
29#include "backends/cloud/storage.h"
30
31namespace GUI {
32
33class ListWidget;
34class StaticTextWidget;
35class CheckboxWidget;
36class CommandSender;
37
39public:
41 ~RemoteBrowserDialog() override;
42
43 void open() override;
44 void close() override;
45 void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
46 void handleTickle() override;
47
48 const Cloud::StorageFile &getResult() { return _choice; }
49
50protected:
51 ListWidget *_fileList;
52 StaticTextWidget *_currentPath;
53 Cloud::StorageFile _node, _backupNode;
56 Cloud::StorageFile _choice;
57 bool _navigationLocked;
58 bool _updateList;
59 bool _showError;
60
61 Networking::Request *_workingRequest;
62 bool _ignoreCallback;
63
64 void updateListing();
65 void goUp();
66 void listDirectory(const Cloud::StorageFile &node);
67 void directoryListedCallback(const Cloud::Storage::ListDirectoryResponse &response);
68 void directoryListedErrorCallback(const Networking::ErrorResponse &error);
69
70 struct FileListOrder : public Common::BinaryFunction<Cloud::StorageFile, Cloud::StorageFile, bool> {
71 bool operator()(const Cloud::StorageFile &x, const Cloud::StorageFile &y) const {
72 if (x.isDirectory() != y.isDirectory()) {
73 return x.isDirectory(); //x < y (directory < not directory) or x > y (not directory > directory)
74 }
75
76 return x.name() < y.name();
77 }
78 };
79};
80
81} // End of namespace GUI
82
83#endif
Definition: storagefile.h:42
Definition: hashmap.h:85
Definition: ustr.h:57
Definition: object.h:40
Definition: dialog.h:49
Definition: list.h:52
Definition: remotebrowser.h:38
Definition: widget.h:213
Definition: request.h:119
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: func.h:52
Definition: remotebrowser.h:70
Definition: request.h:73
Definition: request.h:47