Kgapi

contactcreatejob.h
1 /*
2  * This file is part of LibKGAPI library
3  *
4  * SPDX-FileCopyrightText: 2013 Daniel Vrátil <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #pragma once
10 
11 #include "createjob.h"
12 #include "kgapicontacts_export.h"
13 
14 namespace KGAPI2 {
15 
16 /**
17  * @brief A job to create one or more new contacts in Google Contacts addressbook
18  *
19  * @author Daniel Vrátil <[email protected]>
20  * @since 2.0
21  */
22 class KGAPICONTACTS_EXPORT ContactCreateJob : public KGAPI2::CreateJob
23 {
24  Q_OBJECT
25  public:
26 
27  /**
28  * @brief Constructs a job that will create given @p contact in user's
29  * addressbook
30  *
31  * @param contact Contact to store
32  * @param account Account to authenticate the request
33  * @param parent
34  */
35  explicit ContactCreateJob(const ContactPtr &contact, const AccountPtr &account, QObject* parent = nullptr);
36 
37  /**
38  * @brief Constructs a job that will create given @p contacts in user's
39  * addressbook
40  *
41  * @param contacts Contacts to store
42  * @param account Account to authenticate the request
43  * @param parent
44  */
45  explicit ContactCreateJob(const ContactsList &contacts, const AccountPtr &account, QObject* parent = nullptr);
46 
47  /**
48  * @brief Destructor
49  */
50  ~ContactCreateJob() override;
51 
52  protected:
53 
54  /**
55  * @brief KGAPI2::Job::start implementation
56  */
57  void start() override;
58 
59  /**
60  * @brief KGAPI2::Job::dispatchRequest implementation
61  *
62  * @param accessManager
63  * @param request
64  * @param data
65  * @param contentType
66  */
67  void dispatchRequest(QNetworkAccessManager *accessManager,
68  const QNetworkRequest &request,
69  const QByteArray &data,
70  const QString &contentType) override;
71 
72  /**
73  * @brief KGAPI2::Job::handleReply implementation
74  *
75  * @param reply
76  * @param rawData
77  */
78  ObjectsList handleReplyWithItems(const QNetworkReply *reply,
79  const QByteArray& rawData) override;
80 
81  private:
82  class Private;
83  Private * const d;
84  friend class Private;
85 
86 };
87 
88 } // namespace KGAPI2
89 
Abstract superclass for all jobs that create new objects on the server.
Definition: createjob.h:24
A job to create one or more new contacts in Google Contacts addressbook.
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:15
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun May 16 2021 23:11:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.