ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

remotebrowser.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef GUI_REMOTEBROWSER_DIALOG_H
00024 #define GUI_REMOTEBROWSER_DIALOG_H
00025 
00026 #include "gui/dialog.h"
00027 #include "common/fs.h"
00028 #include <backends/cloud/storagefile.h>
00029 #include <backends/networking/curl/request.h>
00030 #include <backends/cloud/storage.h>
00031 
00032 namespace GUI {
00033 
00034 class ListWidget;
00035 class StaticTextWidget;
00036 class CheckboxWidget;
00037 class CommandSender;
00038 
00039 class RemoteBrowserDialog : public Dialog {
00040 public:
00041     RemoteBrowserDialog(const char *title);
00042     virtual ~RemoteBrowserDialog();
00043 
00044     virtual void open();
00045     virtual void close();
00046     virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
00047     virtual void handleTickle();
00048 
00049     const Cloud::StorageFile    &getResult() { return _choice; }
00050 
00051 protected:
00052     ListWidget      *_fileList;
00053     StaticTextWidget    *_currentPath;
00054     Cloud::StorageFile _node, _backupNode;
00055     Common::Array<Cloud::StorageFile> _nodeContent;
00056     Common::HashMap<Common::String, Common::Array<Cloud::StorageFile> > _rememberedNodeContents;
00057     Cloud::StorageFile _choice;
00058     bool _navigationLocked;
00059     bool _updateList;
00060     bool _showError;
00061 
00062     Networking::Request *_workingRequest;
00063     bool _ignoreCallback;
00064 
00065     void updateListing();
00066     void goUp();
00067     void listDirectory(Cloud::StorageFile node);
00068     void directoryListedCallback(Cloud::Storage::ListDirectoryResponse response);
00069     void directoryListedErrorCallback(Networking::ErrorResponse error);
00070 
00071     struct FileListOrder : public Common::BinaryFunction<Cloud::StorageFile, Cloud::StorageFile, bool> {
00072         bool operator()(const Cloud::StorageFile &x, const Cloud::StorageFile &y) const {
00073             if (x.isDirectory() != y.isDirectory()) {
00074                 return x.isDirectory(); //x < y (directory < not directory) or x > y (not directory > directory)
00075             }
00076 
00077             return x.name() < y.name();
00078         }
00079     };
00080 };
00081 
00082 } // End of namespace GUI
00083 
00084 #endif


Generated on Sat Feb 16 2019 05:01:02 for ResidualVM by doxygen 1.7.1
curved edge   curved edge