Akonadi Contacts

addcontactjob.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 KContacts
16 {
17 class Addressee;
18 }
19 
20 namespace Akonadi
21 {
22 class Collection;
23 class AddContactJobPrivate;
24 
25 /**
26  * @short A job to add a new contact to Akonadi.
27  *
28  * The job will check whether a contact with the given email address already
29  * exists in Akonadi and adds it if it does not exist yet.
30  */
31 class AKONADI_CONTACT_EXPORT AddContactJob : public KJob
32 {
33  Q_OBJECT
34 
35 public:
36  /**
37  * Creates a new add contact job.
38  *
39  * If the contact is not found, the user will be presented a dialog to
40  * choose the address book where the new contact shall be stored.
41  *
42  * @param contact The contact to add.
43  * @param parentWidget The widget that will be used as parent for dialog.
44  * @param parent The parent object.
45  */
46  AddContactJob(const KContacts::Addressee &contact, QWidget *parentWidget, QObject *parent = nullptr);
47 
48  /**
49  * Creates a new add contact job.
50  *
51  * @param contact The contact to add.
52  * @param collection The address book collection where the contact shall be stored in.
53  * @param parent The parent object.
54  */
55  AddContactJob(const KContacts::Addressee &contact, const Akonadi::Collection &collection, QObject *parent = nullptr);
56 
57  /**
58  * Destroys the add email address job.
59  */
60  ~AddContactJob() override;
61 
62  /**
63  * Starts the job.
64  */
65  void start() override;
66 
67  void showMessageBox(bool b);
68 
69 private:
70  //@cond PRIVATE
71  friend class AddContactJobPrivate;
72  std::unique_ptr<AddContactJobPrivate> const d;
73  //@endcond
74 };
75 }
Q_SCRIPTABLE Q_NOREPLY void start()
A job to add a new contact to Akonadi.
Definition: addcontactjob.h:31
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.