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/curl/request.h"
29
#include "backends/cloud/storage.h"
30
31
namespace
GUI
{
32
33
class
ListWidget;
34
class
StaticTextWidget;
35
class
CheckboxWidget;
36
class
CommandSender;
37
38
class
RemoteBrowserDialog
:
public
Dialog
{
39
public
:
40
RemoteBrowserDialog
(
const
Common::U32String
&title);
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
50
protected
:
51
ListWidget
*_fileList;
52
StaticTextWidget
*_currentPath;
53
Cloud::StorageFile
_node, _backupNode;
54
Common::Array<Cloud::StorageFile>
_nodeContent;
55
Common::HashMap<Common::String, Common::Array<Cloud::StorageFile>
> _rememberedNodeContents;
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
Networking::ErrorResponse
Definition:
request.h:73
Common::Array< Cloud::StorageFile >
GUI::StaticTextWidget
Definition:
widget.h:205
Networking::Response
Definition:
request.h:47
GUI
Definition:
system.h:46
Common::BinaryFunction
Definition:
func.h:52
GUI::RemoteBrowserDialog::FileListOrder
Definition:
remotebrowser.h:70
Common::HashMap
Definition:
hashmap.h:85
Common::U32String
Definition:
ustr.h:57
GUI::ListWidget
Definition:
list.h:51
error
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
GUI::Dialog
Definition:
dialog.h:49
Cloud::StorageFile
Definition:
storagefile.h:42
GUI::RemoteBrowserDialog
Definition:
remotebrowser.h:38
GUI::CommandSender
Definition:
object.h:40
Networking::Request
Definition:
request.h:119
gui
remotebrowser.h
Generated on Fri Nov 22 2024 09:30:38 for ScummVM API documentation by
1.8.13