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

KDE's Doxygen guidelines are available online.