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
|
|
|
*/
|
|
|
|
|
2008-11-11 12:13:55 +00:00
|
|
|
#ifndef GUI_LAUNCHER_DIALOG_H
|
|
|
|
#define GUI_LAUNCHER_DIALOG_H
|
2002-09-27 23:27:14 +00:00
|
|
|
|
2003-10-17 12:18:58 +00:00
|
|
|
#include "gui/dialog.h"
|
2008-09-17 17:31:29 +00:00
|
|
|
#include "engines/game.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;
|
2009-06-06 17:53:25 +00:00
|
|
|
class EditTextWidget;
|
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;
|
2010-03-18 15:09:24 +00:00
|
|
|
typedef Common::Array<Common::String> StringArray;
|
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:
|
2009-06-06 17:53:25 +00:00
|
|
|
EditTextWidget *_searchWidget;
|
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;
|
2009-06-06 17:53:25 +00:00
|
|
|
GraphicsWidget *_searchPic;
|
2006-04-17 18:50:33 +00:00
|
|
|
#endif
|
2009-06-06 17:54:08 +00:00
|
|
|
StaticTextWidget *_searchDesc;
|
2009-06-07 22:19:48 +00:00
|
|
|
ButtonWidget *_searchClearButton;
|
2010-03-18 15:09:24 +00:00
|
|
|
StringArray _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
|
|
|
|
2009-06-06 17:53:25 +00:00
|
|
|
String _search;
|
|
|
|
|
2006-08-04 13:55:53 +00:00
|
|
|
virtual void reflowLayout();
|
2006-04-16 20:33:52 +00:00
|
|
|
|
2009-12-15 08:19:34 +00:00
|
|
|
/**
|
|
|
|
* Fill the list widget with all currently configured targets, and trigger
|
|
|
|
* a redraw.
|
|
|
|
*/
|
2002-11-21 02:19:02 +00:00
|
|
|
void updateListing();
|
2009-12-15 08:19:34 +00:00
|
|
|
|
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();
|
2009-12-15 08:19:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle "Add game..." button.
|
|
|
|
*/
|
2004-01-26 07:34:53 +00:00
|
|
|
virtual void addGame();
|
2009-12-15 08:19:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle "Remove game..." button.
|
|
|
|
*/
|
2003-11-05 12:25:42 +00:00
|
|
|
void removeGame(int item);
|
2009-12-15 08:19:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle "Edit game..." button.
|
|
|
|
*/
|
2003-11-05 12:25:42 +00:00
|
|
|
void editGame(int item);
|
2009-12-15 08:19:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle "Load..." button.
|
|
|
|
*/
|
2008-07-30 21:48:45 +00:00
|
|
|
void loadGame(int item);
|
2008-12-22 11:22:15 +00:00
|
|
|
|
2009-12-15 08:19:34 +00:00
|
|
|
/**
|
|
|
|
* Select the target with the given name in the launcher game list.
|
|
|
|
* Also scrolls the list so that the newly selected item is visible.
|
|
|
|
*
|
|
|
|
* @target name of target to select
|
|
|
|
*/
|
|
|
|
void selectTarget(const String &target);
|
2002-09-27 23:27:14 +00:00
|
|
|
};
|
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
} // End of namespace GUI
|
|
|
|
|
2002-09-27 23:27:14 +00:00
|
|
|
#endif
|