Akonadi Contacts

addcontactjob.h
1/*
2 SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "akonadi-contact-widgets_export.h"
10
11#include <KJob>
12
13#include <memory>
14
15namespace KContacts
16{
17class Addressee;
18}
19
20namespace Akonadi
21{
22class Collection;
23}
24namespace Akonadi
25{
26class AddContactJobPrivate;
27
28/**
29 * @short A job to add a new contact to Akonadi.
30 *
31 * The job will check whether a contact with the given email address already
32 * exists in Akonadi and adds it if it does not exist yet.
33 */
34class AKONADI_CONTACT_WIDGETS_EXPORT AddContactJob : public KJob
35{
36 Q_OBJECT
37
38public:
39 /**
40 * Creates a new add contact job.
41 *
42 * If the contact is not found, the user will be presented a dialog to
43 * choose the address book where the new contact shall be stored.
44 *
45 * @param contact The contact to add.
46 * @param parentWidget The widget that will be used as parent for dialog.
47 * @param parent The parent object.
48 */
49 AddContactJob(const KContacts::Addressee &contact, QWidget *parentWidget, QObject *parent = nullptr);
50
51 /**
52 * Creates a new add contact job.
53 *
54 * @param contact The contact to add.
55 * @param collection The address book collection where the contact shall be stored in.
56 * @param parent The parent object.
57 */
58 AddContactJob(const KContacts::Addressee &contact, const Akonadi::Collection &collection, QObject *parent = nullptr);
59
60 /**
61 * Destroys the add email address job.
62 */
63 ~AddContactJob() override;
64
65 /**
66 * Starts the job.
67 */
68 void start() override;
69
70 void showMessageBox(bool b);
71
72private:
73 //@cond PRIVATE
74 friend class AddContactJobPrivate;
75 std::unique_ptr<AddContactJobPrivate> const d;
76 //@endcond
77};
78}
A job to add a new contact to Akonadi.
~AddContactJob() override
Destroys the add email address job.
Q_SCRIPTABLE Q_NOREPLY void start()
A widget for editing the display name of a contact.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.