Root/
| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2006 by Massimiliano Torromeo * |
| 3 | * massimiliano.torromeo@gmail.com * |
| 4 | * * |
| 5 | * This program is free software; you can redistribute it and/or modify * |
| 6 | * it under the terms of the GNU General Public License as published by * |
| 7 | * the Free Software Foundation; either version 2 of the License, or * |
| 8 | * (at your option) any later version. * |
| 9 | * * |
| 10 | * This program is distributed in the hope that it will be useful, * |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 13 | * GNU General Public License for more details. * |
| 14 | * * |
| 15 | * You should have received a copy of the GNU General Public License * |
| 16 | * along with this program; if not, write to the * |
| 17 | * Free Software Foundation, Inc., * |
| 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 19 | ***************************************************************************/ |
| 20 | |
| 21 | #ifndef LINKAPP_H |
| 22 | #define LINKAPP_H |
| 23 | |
| 24 | #include "link.h" |
| 25 | |
| 26 | #include <string> |
| 27 | |
| 28 | class GMenu2X; |
| 29 | |
| 30 | /** |
| 31 | Parses links files. |
| 32 | |
| 33 | @author Massimiliano Torromeo <massimiliano.torromeo@gmail.com> |
| 34 | */ |
| 35 | class LinkApp : public Link { |
| 36 | private: |
| 37 | std::string sclock; |
| 38 | int iclock; |
| 39 | std::string exec, params, workdir, manual, selectordir, selectorfilter, selectorscreens; |
| 40 | bool selectorbrowser, editable; |
| 41 | |
| 42 | std::string aliasfile; |
| 43 | std::string file; |
| 44 | |
| 45 | bool dontleave; |
| 46 | #ifdef HAVE_LIBOPK |
| 47 | bool isOPK; |
| 48 | std::string opkMount, opkFile, category; |
| 49 | #endif |
| 50 | |
| 51 | void start(); |
| 52 | |
| 53 | protected: |
| 54 | virtual const std::string &searchIcon(); |
| 55 | |
| 56 | public: |
| 57 | #ifdef HAVE_LIBOPK |
| 58 | const std::string &getCategory() { return category; } |
| 59 | bool isOpk() { return isOPK; } |
| 60 | const std::string &getOpkFile() { return opkFile; } |
| 61 | |
| 62 | LinkApp(GMenu2X *gmenu2x, const char* linkfile, struct OPK *opk = NULL); |
| 63 | #else |
| 64 | LinkApp(GMenu2X *gmenu2x, const char* linkfile); |
| 65 | bool isOpk() { return false; } |
| 66 | #endif |
| 67 | |
| 68 | virtual void loadIcon(); |
| 69 | |
| 70 | #if defined(PLATFORM_A320) || defined(PLATFORM_GCW0) |
| 71 | bool consoleApp; |
| 72 | #endif |
| 73 | |
| 74 | const std::string &getExec(); |
| 75 | void setExec(const std::string &exec); |
| 76 | const std::string &getParams(); |
| 77 | void setParams(const std::string ¶ms); |
| 78 | const std::string &getManual(); |
| 79 | void setManual(const std::string &manual); |
| 80 | const std::string &getSelectorDir(); |
| 81 | void setSelectorDir(const std::string &selectordir); |
| 82 | bool getSelectorBrowser(); |
| 83 | void setSelectorBrowser(bool value); |
| 84 | const std::string &getSelectorScreens(); |
| 85 | void setSelectorScreens(const std::string &selectorscreens); |
| 86 | const std::string &getSelectorFilter(); |
| 87 | void setSelectorFilter(const std::string &selectorfilter); |
| 88 | const std::string &getAliasFile(); |
| 89 | void setAliasFile(const std::string &aliasfile); |
| 90 | |
| 91 | int clock(); |
| 92 | const std::string &clockStr(int maxClock); |
| 93 | void setClock(int mhz); |
| 94 | |
| 95 | bool save(); |
| 96 | void showManual(); |
| 97 | void selector(int startSelection=0, const std::string &selectorDir=""); |
| 98 | bool targetExists(); |
| 99 | bool isEditable() { return editable; } |
| 100 | |
| 101 | const std::string &getFile() { return file; } |
| 102 | void renameFile(const std::string &name); |
| 103 | |
| 104 | void drawRun(); |
| 105 | void launch(const std::string &selectedFile); |
| 106 | }; |
| 107 | |
| 108 | #endif |
| 109 |
Branches:
install_locations
master
opkrun
packages
