MailTransport

precommandjob.h
1 /*
2  SPDX-FileCopyrightText: 2007 Volker Krause <[email protected]>
3 
4  Based on KMail code by:
5  SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <[email protected]>
6  SPDX-FileCopyrightText: 2000-2002 Michael Haeckel <[email protected]>
7 
8  SPDX-License-Identifier: LGPL-2.0-or-later
9 */
10 
11 #pragma once
12 
13 #include "mailtransport_export.h"
14 
15 #include <KJob>
16 
17 #include <memory>
18 
19 class PreCommandJobPrivate;
20 
21 namespace MailTransport
22 {
23 /**
24  Job to execute a command.
25  This is used often for sending or receiving mails, for example to set up
26  a tunnel of VPN connection.
27  Basically this is just a KJob wrapper around a QProcess.
28 
29  @since 4.4
30  */
31 class MAILTRANSPORT_EXPORT PrecommandJob : public KJob
32 {
33  Q_OBJECT
34 
35 public:
36  /**
37  Creates a new precommand job.
38  @param precommand The command to run.
39  @param parent The parent object.
40  */
41  explicit PrecommandJob(const QString &precommand, QObject *parent = nullptr);
42 
43  /**
44  Destroys this job.
45  */
46  ~PrecommandJob() override;
47 
48  /**
49  Executes the precommand.
50  Reimplemented from KJob.
51  */
52  void start() override;
53 
54 protected:
55  /**
56  Reimplemented from KJob.
57  */
58  bool doKill() override;
59 
60 private:
61  friend class ::PreCommandJobPrivate;
62  std::unique_ptr<PreCommandJobPrivate> const d;
63 };
64 } // namespace MailTransport
Q_SCRIPTABLE Q_NOREPLY void start()
Job to execute a command.
Definition: precommandjob.h:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Feb 5 2023 03:58:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.