2010-02-04 13:33:47 +02:00
|
|
|
/***************************************************************************
|
2011-10-23 17:13:02 +03:00
|
|
|
* Copyright (C) 2006 by Massimiliano Torromeo *
|
|
|
|
* massimiliano.torromeo@gmail.com *
|
2010-02-04 13:33:47 +02: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 Foundation, Inc., *
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
***************************************************************************/
|
2011-10-23 17:13:02 +03:00
|
|
|
|
2010-02-04 13:33:47 +02:00
|
|
|
#ifndef LINKAPP_H
|
|
|
|
#define LINKAPP_H
|
|
|
|
|
2011-10-23 17:13:02 +03:00
|
|
|
#include "link.h"
|
|
|
|
|
2010-02-04 13:33:47 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class GMenu2X;
|
2010-07-28 00:22:46 +03:00
|
|
|
class InputManager;
|
2011-12-23 15:03:05 +02:00
|
|
|
class Touchscreen;
|
2010-02-04 13:33:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Parses links files.
|
|
|
|
|
|
|
|
@author Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
|
|
|
|
*/
|
|
|
|
class LinkApp : public Link {
|
|
|
|
private:
|
2010-07-28 00:22:46 +03:00
|
|
|
InputManager &inputMgr;
|
2011-11-19 15:47:55 +02:00
|
|
|
std::string sclock;
|
|
|
|
int iclock;
|
2011-10-23 17:43:56 +03:00
|
|
|
std::string exec, params, workdir, manual, selectordir, selectorfilter, selectorscreens;
|
2012-10-17 01:51:55 +03:00
|
|
|
bool selectorbrowser, editable;
|
2010-02-04 13:33:47 +02:00
|
|
|
void drawRun();
|
|
|
|
|
2011-10-23 17:43:56 +03:00
|
|
|
std::string aliasfile;
|
|
|
|
std::string file;
|
2010-07-27 22:26:02 +03:00
|
|
|
|
|
|
|
bool dontleave;
|
2012-10-07 22:50:07 +03:00
|
|
|
#ifdef HAVE_LIBOPK
|
|
|
|
bool isOPK;
|
2012-10-09 02:41:57 +03:00
|
|
|
std::string opkMount, opkFile, category;
|
2012-10-07 22:50:07 +03:00
|
|
|
#endif
|
2010-02-04 13:33:47 +02:00
|
|
|
|
2011-12-30 17:54:36 +02:00
|
|
|
void start();
|
2011-12-23 16:51:54 +02:00
|
|
|
void launch(
|
|
|
|
const std::string &selectedFile = "",
|
|
|
|
const std::string &selectedDir = "");
|
|
|
|
|
2010-02-04 13:33:47 +02:00
|
|
|
public:
|
2012-10-07 22:50:07 +03:00
|
|
|
#ifdef HAVE_LIBOPK
|
2012-10-09 02:41:57 +03:00
|
|
|
const std::string &getCategory() { return category; }
|
2012-10-23 07:33:27 +03:00
|
|
|
bool isOpk() { return isOPK; }
|
2012-10-09 02:41:57 +03:00
|
|
|
|
2012-10-07 22:50:07 +03:00
|
|
|
LinkApp(GMenu2X *gmenu2x, Touchscreen &ts, InputManager &inputMgr,
|
2012-11-30 04:44:58 +02:00
|
|
|
const char* linkfile, struct ParserData *pdata = NULL);
|
2012-10-07 22:50:07 +03:00
|
|
|
#else
|
2011-12-23 15:03:05 +02:00
|
|
|
LinkApp(GMenu2X *gmenu2x, Touchscreen &ts, InputManager &inputMgr,
|
|
|
|
const char* linkfile);
|
2012-10-07 22:50:07 +03:00
|
|
|
#endif
|
|
|
|
|
2011-10-23 17:43:56 +03:00
|
|
|
virtual const std::string &searchIcon();
|
|
|
|
|
2012-11-27 07:14:08 +02:00
|
|
|
#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
|
2012-04-13 20:21:49 +03:00
|
|
|
bool consoleApp;
|
|
|
|
#endif
|
|
|
|
|
2011-10-23 17:43:56 +03:00
|
|
|
const std::string &getExec();
|
|
|
|
void setExec(const std::string &exec);
|
|
|
|
const std::string &getParams();
|
|
|
|
void setParams(const std::string ¶ms);
|
|
|
|
const std::string &getManual();
|
|
|
|
void setManual(const std::string &manual);
|
|
|
|
const std::string &getSelectorDir();
|
|
|
|
void setSelectorDir(const std::string &selectordir);
|
2010-02-04 13:33:47 +02:00
|
|
|
bool getSelectorBrowser();
|
|
|
|
void setSelectorBrowser(bool value);
|
2011-10-23 17:43:56 +03:00
|
|
|
const std::string &getSelectorScreens();
|
|
|
|
void setSelectorScreens(const std::string &selectorscreens);
|
|
|
|
const std::string &getSelectorFilter();
|
|
|
|
void setSelectorFilter(const std::string &selectorfilter);
|
|
|
|
const std::string &getAliasFile();
|
|
|
|
void setAliasFile(const std::string &aliasfile);
|
2010-02-04 13:33:47 +02:00
|
|
|
|
|
|
|
int clock();
|
2011-10-23 17:43:56 +03:00
|
|
|
const std::string &clockStr(int maxClock);
|
2010-02-04 13:33:47 +02:00
|
|
|
void setClock(int mhz);
|
|
|
|
|
|
|
|
bool save();
|
|
|
|
void showManual();
|
2011-10-23 17:43:56 +03:00
|
|
|
void selector(int startSelection=0, const std::string &selectorDir="");
|
2010-02-04 13:33:47 +02:00
|
|
|
bool targetExists();
|
2012-10-17 01:51:55 +03:00
|
|
|
bool isEditable() { return editable; }
|
2010-07-27 22:26:02 +03:00
|
|
|
|
2011-10-23 17:43:56 +03:00
|
|
|
const std::string &getFile() { return file; }
|
|
|
|
void renameFile(const std::string &name);
|
2010-07-27 22:26:02 +03:00
|
|
|
bool &runsInBackgroundRef() { return dontleave; }
|
2010-02-04 13:33:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|