2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2002-09-27 23:27:14 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-09-27 23:27:14 +00:00
|
|
|
*
|
2006-02-11 10:08:56 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2002-09-27 23:27:14 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LAUNCHER_DIALOG_H
|
|
|
|
#define LAUNCHER_DIALOG_H
|
|
|
|
|
2003-10-17 12:18:58 +00:00
|
|
|
#include "gui/dialog.h"
|
2008-09-17 17:31:29 +00:00
|
|
|
#include "engines/game.h"
|
2008-11-03 18:32:16 +00:00
|
|
|
#include "engines/metaengine.h"
|
2002-09-27 23:27:14 +00:00
|
|
|
#include "common/str.h"
|
2002-09-30 00:55:47 +00:00
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
namespace GUI {
|
|
|
|
|
2005-04-16 17:55:09 +00:00
|
|
|
class BrowserDialog;
|
2002-09-30 00:55:47 +00:00
|
|
|
class ListWidget;
|
2006-04-17 18:50:33 +00:00
|
|
|
class GraphicsWidget;
|
2008-07-30 21:48:45 +00:00
|
|
|
class SaveLoadChooser;
|
2007-02-18 18:23:52 +00:00
|
|
|
|
|
|
|
Common::String addGameToConf(const GameDescriptor &result);
|
|
|
|
|
2002-09-27 23:27:14 +00:00
|
|
|
class LauncherDialog : public Dialog {
|
2003-10-02 17:43:02 +00:00
|
|
|
typedef Common::String String;
|
|
|
|
typedef Common::StringList StringList;
|
2002-09-27 23:27:14 +00:00
|
|
|
public:
|
2006-05-04 22:52:18 +00:00
|
|
|
LauncherDialog();
|
2002-11-21 02:19:02 +00:00
|
|
|
~LauncherDialog();
|
2002-09-27 23:27:14 +00:00
|
|
|
|
2002-11-21 15:20:52 +00:00
|
|
|
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
2002-09-27 23:27:14 +00:00
|
|
|
|
2007-06-30 12:26:59 +00:00
|
|
|
virtual void handleKeyDown(Common::KeyState state);
|
|
|
|
virtual void handleKeyUp(Common::KeyState state);
|
2006-10-02 22:28:02 +00:00
|
|
|
|
2002-09-27 23:27:14 +00:00
|
|
|
protected:
|
2002-11-21 02:19:02 +00:00
|
|
|
ListWidget *_list;
|
2007-02-04 02:36:23 +00:00
|
|
|
ButtonWidget *_addButton;
|
2002-11-21 02:19:02 +00:00
|
|
|
Widget *_startButton;
|
2008-09-14 18:19:22 +00:00
|
|
|
Widget *_loadButton;
|
2002-11-21 13:11:29 +00:00
|
|
|
Widget *_editButton;
|
|
|
|
Widget *_removeButton;
|
2006-04-17 18:50:33 +00:00
|
|
|
#ifndef DISABLE_FANCY_THEMES
|
|
|
|
GraphicsWidget *_logo;
|
|
|
|
#endif
|
2002-11-21 14:12:55 +00:00
|
|
|
StringList _domains;
|
2005-04-16 17:55:09 +00:00
|
|
|
BrowserDialog *_browser;
|
2008-07-30 21:48:45 +00:00
|
|
|
SaveLoadChooser *_loadDialog;
|
2002-11-21 02:19:02 +00:00
|
|
|
|
2006-08-04 13:55:53 +00:00
|
|
|
virtual void reflowLayout();
|
2006-04-16 20:33:52 +00:00
|
|
|
|
2002-11-21 02:19:02 +00:00
|
|
|
void updateListing();
|
2002-12-01 12:47:13 +00:00
|
|
|
void updateButtons();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2006-07-22 21:23:49 +00:00
|
|
|
void open();
|
2004-10-01 21:12:18 +00:00
|
|
|
void close();
|
2004-01-26 07:34:53 +00:00
|
|
|
virtual void addGame();
|
2003-11-05 12:25:42 +00:00
|
|
|
void removeGame(int item);
|
|
|
|
void editGame(int item);
|
2008-07-30 21:48:45 +00:00
|
|
|
void loadGame(int item);
|
|
|
|
|
2005-01-05 01:42:52 +00:00
|
|
|
void selectGame(const String &name);
|
2002-09-27 23:27:14 +00:00
|
|
|
};
|
|
|
|
|
2008-11-03 18:32:16 +00:00
|
|
|
class SaveLoadChooser : public GUI::Dialog {
|
|
|
|
typedef Common::String String;
|
|
|
|
typedef Common::StringList StringList;
|
|
|
|
protected:
|
|
|
|
GUI::ListWidget *_list;
|
|
|
|
GUI::ButtonWidget *_chooseButton;
|
|
|
|
GUI::ButtonWidget *_deleteButton;
|
|
|
|
GUI::GraphicsWidget *_gfxWidget;
|
|
|
|
GUI::ContainerWidget *_container;
|
|
|
|
GUI::StaticTextWidget *_date;
|
|
|
|
GUI::StaticTextWidget *_time;
|
|
|
|
GUI::StaticTextWidget *_playtime;
|
|
|
|
|
|
|
|
const EnginePlugin *_plugin;
|
|
|
|
bool _delSupport;
|
|
|
|
bool _metaInfoSupport;
|
|
|
|
bool _thumbnailSupport;
|
|
|
|
bool _saveDateSupport;
|
|
|
|
bool _playTimeSupport;
|
|
|
|
String _target;
|
|
|
|
SaveStateList _saveList;
|
2008-11-09 17:53:37 +00:00
|
|
|
String _resultString;
|
2008-11-03 18:32:16 +00:00
|
|
|
|
|
|
|
uint8 _fillR, _fillG, _fillB;
|
|
|
|
|
|
|
|
void updateSaveList();
|
|
|
|
void updateSelection(bool redraw);
|
|
|
|
public:
|
|
|
|
SaveLoadChooser(const String &title, const String &buttonLabel);
|
|
|
|
~SaveLoadChooser();
|
|
|
|
|
|
|
|
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
|
|
|
|
void setList(const StringList& list);
|
|
|
|
int runModal(const EnginePlugin *plugin, const String &target);
|
|
|
|
|
2008-11-07 13:20:25 +00:00
|
|
|
const Common::String &getResultString() const;
|
2008-11-06 20:26:19 +00:00
|
|
|
void setSaveMode(bool saveMode);
|
|
|
|
|
2008-11-03 18:32:16 +00:00
|
|
|
virtual void reflowLayout();
|
|
|
|
|
|
|
|
virtual void close();
|
|
|
|
};
|
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
} // End of namespace GUI
|
|
|
|
|
2002-09-27 23:27:14 +00:00
|
|
|
#endif
|