Akonadi Contacts

addemailaddressjob.h
1 /*
2  SPDX-FileCopyrightText: 2010 Tobias Koenig <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "akonadi-contact_export.h"
10 
11 #include <KJob>
12 
13 #include <memory>
14 
15 namespace Akonadi
16 {
17 class Item;
18 class AddEmailAddressJobPrivate;
19 
20 /**
21  * @short A job to add a new contact with a given email address to Akonadi.
22  *
23  * The job will check whether a contact with the given email address already
24  * exists in Akonadi and inform the user about it, if it does not exist yet,
25  * a new contact is added.
26  */
27 class AKONADI_CONTACT_EXPORT AddEmailAddressJob : public KJob
28 {
29  Q_OBJECT
30 
31 public:
32  /**
33  * Creates a new add email address job.
34  *
35  * @param email The email address.
36  * @param parentWidget The widget that will be used as parent for dialog.
37  * @param parent The parent object.
38  */
39  explicit AddEmailAddressJob(const QString &email, QWidget *parentWidget, QObject *parent = nullptr);
40 
41  /**
42  * Destroys the add email address job.
43  */
44  ~AddEmailAddressJob() override;
45 
46  /**
47  * Starts the job.
48  */
49  void start() override;
50 
51  /**
52  * Returns the item that represents the new contact.
53  */
54  Q_REQUIRED_RESULT Akonadi::Item contact() const;
55 
56  void setInteractive(bool b);
57 Q_SIGNALS:
58  void successMessage(const QString &message);
59 
60 private:
61  //@cond PRIVATE
62  friend class AddEmailAddressJobPrivate;
63  std::unique_ptr<AddEmailAddressJobPrivate> const d;
64  //@endcond
65 };
66 }
Q_SCRIPTABLE Q_NOREPLY void start()
A job to add a new contact with a given email address to Akonadi.
QString message
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:09:04 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.