KIO

applicationlauncherjob.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2020 David Faure <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 
8 #ifndef KIO_APPLICATIONLAUNCHERJOB_H
9 #define KIO_APPLICATIONLAUNCHERJOB_H
10 
11 #include "kiogui_export.h"
12 #include <KJob>
13 #include <KService>
14 #include <QUrl>
15 
16 class KRun; // KF6 REMOVE
17 class ApplicationLauncherJobTest; // KF6 REMOVE
18 
19 namespace KIO {
20 
21 class ApplicationLauncherJobPrivate;
22 
51 class KIOGUI_EXPORT ApplicationLauncherJob : public KJob
52 {
53 public:
59  explicit ApplicationLauncherJob(const KService::Ptr &service, QObject *parent = nullptr);
60 
66  explicit ApplicationLauncherJob(const KServiceAction &serviceAction, QObject *parent = nullptr);
67 
74  explicit ApplicationLauncherJob(QObject *parent = nullptr);
75 
82  ~ApplicationLauncherJob() override;
83 
91  void setUrls(const QList<QUrl> &urls);
92 
96  enum RunFlag {
97  DeleteTemporaryFiles = 0x1,
98  };
102  Q_DECLARE_FLAGS(RunFlags, RunFlag)
103 
104 
108  void setRunFlags(RunFlags runFlags);
109 
118  void setSuggestedFileName(const QString &suggestedFileName);
119 
124  void setStartupId(const QByteArray &startupId);
125 
131  void start() override;
132 
140  qint64 pid() const;
141 
147  QVector<qint64> pids() const;
148 
149 private:
150  friend class ::KRun; // KF6 REMOVE
151  friend class ::ApplicationLauncherJobTest; // KF6 REMOVE
155  bool waitForStarted();
156  void emitUnauthorizedError();
157  void proceedAfterSecurityChecks();
158 
159  friend class ApplicationLauncherJobPrivate;
160  QScopedPointer<ApplicationLauncherJobPrivate> d;
161 };
162 
163 } // namespace KIO
164 
165 #endif
A namespace for KIO globals.
Definition: authinfo.h:21
To open files with their associated applications in KDE, use KRun.
Definition: krun.h:52
ApplicationLauncherJob runs an application and watches it while running.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Nov 21 2020 23:01:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.