exefile.h
1 //------------------------------------------------------------------------------
2 // exefile.h
3 //------------------------------------------------------------------------------
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301 USA
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2013 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef id97064B0C_7D3A_489E_B2241AD6943450FB
24 #define id97064B0C_7D3A_489E_B2241AD6943450FB
25 
26 #include "dptr.h"
27 #include "global.h"
28 #include <QHash>
29 #include <QObject>
30 #include <QString>
31 
32 class Message;
33 
48 class MAIN_EXPORT ExeFile : public QObject
49 {
50  Q_OBJECT
51 
52 public:
53  ExeFile();
54  virtual ~ExeFile() override;
55 
60  const QString &configKey() const;
64  const QString &exeTypeName() const;
92  virtual Message install(QWidget *parent);
96  const QString &programName() const;
97 
109  virtual QString pathToExe(Message &message);
110 
114  void setConfigKey(const QString &keyName);
118  void setExeTypeName(const QString &name);
122  void setProgramName(const QString &name);
123 
135  virtual QString workingDirectory(Message &message);
136 
137 private:
138  DPtr<ExeFile> d;
139 
140  QString obtainBinary(Message &message) const;
141 };
142 
147 class MAIN_EXPORT ExeFilePath
148 {
149 public:
150  ExeFilePath();
154  ExeFilePath(const QString &path);
155  ExeFilePath(const ExeFilePath &other);
156  virtual ~ExeFilePath();
157  ExeFilePath &operator=(const ExeFilePath &other);
158 
159  QString path() const;
160  ExeFilePath &setPath(const QString &path);
161 
162  QString workingDir() const;
163  ExeFilePath &setWorkingDir(const QString &path);
164 
165 private:
167 };
168 
169 #endif
Message object used to pass messages throughout the Doomseeker&#39;s system.
Definition: message.h:63
A simple executable path & working dir structure.
Definition: exefile.h:147
Access to external program executables (game clients, servers, and so on).
Definition: exefile.h:48