MailTransport

precommandjob.h
1/*
2 SPDX-FileCopyrightText: 2007 Volker Krause <vkrause@kde.org>
3
4 Based on KMail code by:
5 SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <taferner@kde.org>
6 SPDX-FileCopyrightText: 2000-2002 Michael Haeckel <haeckel@kde.org>
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
19class PreCommandJobPrivate;
20
21namespace 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 */
31class MAILTRANSPORT_EXPORT PrecommandJob : public KJob
32{
33 Q_OBJECT
34
35public:
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
54protected:
55 /**
56 Reimplemented from KJob.
57 */
58 bool doKill() override;
59
60private:
61 friend class ::PreCommandJobPrivate;
62 std::unique_ptr<PreCommandJobPrivate> const d;
63};
64} // namespace MailTransport
Job to execute a command.
~PrecommandJob() override
Destroys this job.
Q_SCRIPTABLE Q_NOREPLY void start()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.