Root/src/linkapp.h

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
28class GMenu2X;
29
30/**
31Parses links files.
32
33    @author Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
34*/
35class LinkApp : public Link {
36private:
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, metadata;
49#endif
50
51    void start();
52
53protected:
54    virtual const std::string &searchIcon();
55
56public:
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,
63                struct OPK *opk = NULL, const char *metadata = NULL);
64#else
65    LinkApp(GMenu2X *gmenu2x, const char* linkfile);
66    bool isOpk() { return false; }
67#endif
68
69    virtual void loadIcon();
70
71#if defined(PLATFORM_A320) || defined(PLATFORM_GCW0)
72    bool consoleApp;
73#endif
74
75    const std::string &getExec();
76    void setExec(const std::string &exec);
77    const std::string &getParams();
78    void setParams(const std::string &params);
79    const std::string &getManual();
80    void setManual(const std::string &manual);
81    const std::string &getSelectorDir();
82    void setSelectorDir(const std::string &selectordir);
83    bool getSelectorBrowser();
84    void setSelectorBrowser(bool value);
85    const std::string &getSelectorScreens();
86    void setSelectorScreens(const std::string &selectorscreens);
87    const std::string &getSelectorFilter();
88    void setSelectorFilter(const std::string &selectorfilter);
89    const std::string &getAliasFile();
90    void setAliasFile(const std::string &aliasfile);
91
92    int clock();
93    const std::string &clockStr(int maxClock);
94    void setClock(int mhz);
95
96    bool save();
97    void showManual();
98    void selector(int startSelection=0, const std::string &selectorDir="");
99    bool targetExists();
100    bool isEditable() { return editable; }
101
102    const std::string &getFile() { return file; }
103    void renameFile(const std::string &name);
104
105    void drawRun();
106    void launch(const std::string &selectedFile);
107};
108
109#endif
110

Archive Download this file



interactive