Kgapi

locationfetchjob.h
1/*
2 * This file is part of LibKGAPI library
3 *
4 * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
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 "fetchjob.h"
12#include "kgapilatitude_export.h"
13#include "latitude.h"
14
15namespace KGAPI2
16{
17
18/**
19 * @brief A job to fetch current or a specific locations from user's account on
20 * Google Latitude
21 *
22 * @author Daniel Vrátil <dvratil@redhat.com>
23 * @since 2.0
24 */
25class KGAPILATITUDE_DEPRECATED_EXPORT LocationFetchJob : public KGAPI2::FetchJob
26{
27 Q_OBJECT
28
29 /**
30 * @brief Granularity of the results
31 *
32 * Specifies how precise the results should be. By default, Latitude::City
33 * granularity is used.
34 *
35 * This property can be modified only when the job is not running.
36 *
37 * @see setGranularity, granularity
38 */
39 Q_PROPERTY(Latitude::Granularity granularity READ granularity WRITE setGranularity)
40
41public:
42 /**
43 * @brief Constructs a job that will fetch users current locations from
44 * Google Latitude service
45 *
46 * @param account Account to authenticate the requests
47 * @param parent
48 */
49 explicit LocationFetchJob(const AccountPtr &account, QObject *parent = nullptr);
50
51 /**
52 * @brief Constructs a job that will fetch specific past user's location from
53 * Google Latitude service
54 *
55 * @param timestamp Timestamp of the location to fetch
56 * @param account Account to authenticate the requests
57 * @param parent
58 */
59 explicit LocationFetchJob(qlonglong timestamp, const AccountPtr &account, QObject *parent = nullptr);
60
61 /**
62 * @brief Destructor
63 */
64 ~LocationFetchJob() override;
65
66 /**
67 * @brief Sets granularity of the requested result. By default it's City.
68 *
69 * @param granularity
70 */
71 void setGranularity(Latitude::Granularity granularity);
72
73 /**
74 * @brief Returns granularity of the requested location.
75 */
76 Latitude::Granularity granularity() const;
77
78protected:
79 /**
80 * @brief KGAPI2::Job::start implementation
81 */
82 void start() override;
83
84 /**
85 * @brief KGAPI2::FetchJob::handleReplyWithItems implementation
86 *
87 * @param reply
88 * @param rawData
89 */
90 ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
91
92private:
93 class Private;
94 Private *const d;
95 friend class Private;
96};
97
98} // namespace KGAPI2
Abstract superclass for all jobs that fetch resources from Google.
Definition fetchjob.h:25
A job to fetch current or a specific locations from user's account on Google Latitude.
Q_SCRIPTABLE Q_NOREPLY void start()
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:58:18 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.