diff --git a/Mainpage.dox b/Mainpage.dox index 7acf16c..0b78290 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -1,37 +1,40 @@ /** @mainpage LibKGAPI \section purpose Purpose LibKGAPI is a library that implements various Google APIs so that 3rd party applications can easily integrate with Google services. \section desc Description

Suppoerted Services

LibKGAPI currently supports following Google APIs: +Deprecated APIs: +

Examples

For examples of how to use LibKGAPI in KDE applications, please refer to example programs in the examples folder. To compile examples, pass -DBUILD_EXAMPLES=TRUE to CMake. @authors Daniel Vrátil \ Jan Grulich \ @maintainers Daniel Vrátil \ @licenses @gplv2 // DOXYGEN_PROJECTNAME=LibKGAPI diff --git a/README b/README index 9014a11..2d490bf 100644 --- a/README +++ b/README @@ -1,37 +1,39 @@ LibKGAPI ======================== LibKGAPI (previously called LibKGoogle) is a C++ library that implements APIs for various Google services. Currently supported APIs: - Calendar API v3 (https://developers.google.com/google-apps/calendar) - Contacts API v3 (https://developers.google.com/google-apps/contacts/v3/) - Tasks API v1 (https://developers.google.com/google-apps/tasks) - - Latitude API v1 (https://developers.google.com/latitude/v1/) - Static Google Maps API v2 (https://developers.google.com/maps/documentation/staticmaps/) - Drive API v2 (https://developers.google.com/drive/v2/reference) - Blogger API v3 (https://developers.google.com/blogger/docs/3.0/reference/) +Deprecated APIs: + - Latitude API v1 (https://developers.google.com/latitude/v1/) + Compiling: ---------- mkdir build cd build cmake ../ -DCMAKE_INSTALL_PREFIX=/usr make # As root: make install To compile example applications, run cmake with -DKGAPI_BUILD_EXAMPLES=TRUE argument. To compile automated tests, run 'make buildtests'. To run automated tests, run 'make test' BUGS: ----- Submit bugs and feature requests to KDE bugzilla, product libkgapi: https://bugs.kde.org/enter_bug.cgi?product=libkgapi API Documentation: ------------------ http://api.kde.org/extragear-api/libs-apidocs/libkgapi/html/index.html diff --git a/src/latitude/latitude.h b/src/latitude/latitude.h index 3ac9b58..2e176c0 100644 --- a/src/latitude/latitude.h +++ b/src/latitude/latitude.h @@ -1,48 +1,48 @@ /* Copyright (C) 2014 Daniel Vrátil This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef LIBKGAPI2_LATITUDE_H #define LIBKGAPI2_LATITUDE_H #include #include "kgapilatitude_export.h" namespace KGAPI2 { /** * @brief A Helper QObject */ -class KGAPILATITUDE_EXPORT Latitude: public QObject +class KGAPILATITUDE_DEPRECATED_EXPORT Latitude: public QObject { Q_OBJECT Q_ENUMS(Granularity) public: enum Granularity { City, Best }; }; } // namespace KGAPI2 #endif diff --git a/src/latitude/latitudeservice.h b/src/latitude/latitudeservice.h index f46c97e..2974090 100644 --- a/src/latitude/latitudeservice.h +++ b/src/latitude/latitudeservice.h @@ -1,126 +1,126 @@ /* Copyright (C) 2012 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef LIBKGAPI2_LATITUDESERVICE_H #define LIBKGAPI2_LATITUDESERVICE_H #include "types.h" #include "latitude.h" #include "kgapilatitude_export.h" namespace KGAPI2 { /** * @brief Additional methods for implementing support for Google Latitude service * * You should never need to use these methods, unless implementing your own Job */ namespace LatitudeService { /** * @brief Parses JSON data into a Location object * * @param jsonData */ - KGAPILATITUDE_EXPORT LocationPtr JSONToLocation(const QByteArray& jsonData); + KGAPILATITUDE_DEPRECATED_EXPORT LocationPtr JSONToLocation(const QByteArray& jsonData); /** * @brief Serializes a Location object to JSON * * @param location */ - KGAPILATITUDE_EXPORT QByteArray locationToJSON(const LocationPtr &location); + KGAPILATITUDE_DEPRECATED_EXPORT QByteArray locationToJSON(const LocationPtr &location); /** * @brief Parses a JSON feed into list of Locations * * @param jsonFeed * @param feedData The structure will be filled with additional data about * the feed */ - KGAPILATITUDE_EXPORT ObjectsList parseLocationJSONFeed(const QByteArray& jsonFeed, FeedData& feedData); + KGAPILATITUDE_DEPRECATED_EXPORT ObjectsList parseLocationJSONFeed(const QByteArray& jsonFeed, FeedData& feedData); /** * @brief Supported version of API */ - KGAPILATITUDE_EXPORT QString APIVersion(); + KGAPILATITUDE_DEPRECATED_EXPORT QString APIVersion(); /** * @brief Returns URL for fetch current user's location * * @param granularity */ - KGAPILATITUDE_EXPORT QUrl retrieveCurrentLocationUrl(const Latitude::Granularity granularity = Latitude::City); + KGAPILATITUDE_DEPRECATED_EXPORT QUrl retrieveCurrentLocationUrl(const Latitude::Granularity granularity = Latitude::City); /** * @brief Returns URL for deleting user's current location */ - KGAPILATITUDE_EXPORT QUrl deleteCurrentLocationUrl(); + KGAPILATITUDE_DEPRECATED_EXPORT QUrl deleteCurrentLocationUrl(); /** * @brief Returns URL for uploading user's current location */ - KGAPILATITUDE_EXPORT QUrl insertCurrentLocationUrl(); + KGAPILATITUDE_DEPRECATED_EXPORT QUrl insertCurrentLocationUrl(); /** * @brief Returns URL for fetching history of user's locations * * @param granularity Precision of the coordinates * @param maxResults Maximum amount of results to return * @param maxTime Maximum timestamp since epoch (in ms) * @param minTime Minimum timestamp since epoch (in ms) */ - KGAPILATITUDE_EXPORT QUrl locationHistoryUrl(const Latitude::Granularity granularity, + KGAPILATITUDE_DEPRECATED_EXPORT QUrl locationHistoryUrl(const Latitude::Granularity granularity, const int maxResults = 0, const qlonglong maxTime = 0, const qlonglong minTime = 0); /** * @brief URL for fetching a specific location * * @param id * @param granularity; */ - KGAPILATITUDE_EXPORT QUrl retrieveLocationUrl(const qlonglong id, + KGAPILATITUDE_DEPRECATED_EXPORT QUrl retrieveLocationUrl(const qlonglong id, const Latitude::Granularity granularity = Latitude::City); /** * @brief Returns URL for uploading a location */ - KGAPILATITUDE_EXPORT QUrl insertLocationUrl(); + KGAPILATITUDE_DEPRECATED_EXPORT QUrl insertLocationUrl(); /** * @brief Returns URL to delete a specific location * * @param id */ - KGAPILATITUDE_EXPORT QUrl deleteLocationUrl(const qlonglong id); + KGAPILATITUDE_DEPRECATED_EXPORT QUrl deleteLocationUrl(const qlonglong id); } // namespace LatitudeService } // namespace KGAPI2 #endif // LIBKGAPI2_LATITUDESERVICE_H diff --git a/src/latitude/location.h b/src/latitude/location.h index 3162908..9fd754f 100644 --- a/src/latitude/location.h +++ b/src/latitude/location.h @@ -1,154 +1,154 @@ /* Copyright (C) 2012 Jan Grulich This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef LIBKGAPI2_OBJECTS_LOCATION_H #define LIBKGAPI2_OBJECTS_LOCATION_H #include "object.h" #include "types.h" #include "kgapilatitude_export.h" #include #include namespace KGAPI2 { /** * @brief Represents a single record about geographical location provided * by Google Latitude service. * * @author Jan Grulich * @since 0.4 */ -class KGAPILATITUDE_EXPORT Location : public KGAPI2::Object, +class KGAPILATITUDE_DEPRECATED_EXPORT Location : public KGAPI2::Object, public KContacts::Geo { public: /** * @brief Constructor */ Location(); /** * @brief Constructor * * @param latitude * @param longitude */ Location(float latitude, float longitude); /** * @brief Copy constructor */ Location(const Location &other); /** * @brief Destructor */ ~Location() override; /** * @brief Timestamp of when this location has been recorded. * * Also serves as location unique ID */ qulonglong timestamp() const; /** * @brief Sets timestamp of this location. */ void setTimestamp(qulonglong timestamp); /** * @brief Returns accuracy of the latitude and longitude in meters. * * @return Returns -1 when accuracy is not defined. */ qint32 accuracy() const; /** * @brief Sets accuracy of this location. */ void setAccuracy(qint32 accuracy); /** * @brief Returns ground speed of the user at the time this location was * recorded. * * @return Returns -1 when speed is not defined. */ qint32 speed() const; /** * @brief Sets speed of this location. */ void setSpeed(qint32 speed); /** * @brief Returns direction of travel of the user when this location was * recorded. * * @return Returns -1 when heading is not defined. */ qint32 heading() const; /** * @brief Sets heading of this location. */ void setHeading(qint32 heading); /** * @brief Returns altitude of this location. * * @return Returns 0 when altitude is not defined. */ qint32 altitude() const; /** * @brief Sets altitude of this location. */ void setAltitude(qint32 altitude); /** * @brief Returns altitude accuracy. * * @return Returns -1 when altitude accuracy is not defined. */ qint32 altitudeAccuracy() const; /** * @brief Sets altitude accuracy of this location. */ void setAltitudeAccuracy(qint32 altitudeAccuracy); private: class Private; Private * const d; friend class Private; }; } // namespace KGAPI2 #endif // LOCATION_H diff --git a/src/latitude/locationcreatejob.h b/src/latitude/locationcreatejob.h index 3992325..4fcd58f 100644 --- a/src/latitude/locationcreatejob.h +++ b/src/latitude/locationcreatejob.h @@ -1,85 +1,85 @@ /* * This file is part of LibKGAPI library * * Copyright (C) 2013 Daniel Vrátil * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) version 3, or any * later version accepted by the membership of KDE e.V. (or its * successor approved by the membership of KDE e.V.), which shall * act as a proxy defined in Section 6 of version 3 of the license. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef LIBKGAPI2_LOCATIONCREATEJOB_H #define LIBKGAPI2_LOCATIONCREATEJOB_H #include "createjob.h" #include "kgapilatitude_export.h" namespace KGAPI2 { /** * @brief A job to stores one or more Locations in Google Latitude service * * @author Daniel Vrátil * @since 2.0 */ -class KGAPILATITUDE_EXPORT LocationCreateJob : public KGAPI2::CreateJob +class KGAPILATITUDE_DEPRECATED_EXPORT LocationCreateJob : public KGAPI2::CreateJob { Q_OBJECT public: /** * @brief Constructs a job that will store given @p location in user's * Google Latitude account * * @param location Location to store * @param isCurrent Whether the location is user's current location * @param account Account to authenticate the request * @param parent */ explicit LocationCreateJob(const LocationPtr &location, bool isCurrent, const AccountPtr &account, QObject* parent = nullptr); /** * @brief Destructor */ ~LocationCreateJob() override; protected: /** * @brief KGAPI2::Job::start implementation */ void start() override; /** * @brief KGAPI2::CreateJob::handleReplyWithItems implementation * * @param reply * @param rawData */ ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray& rawData) override; private: class Private; Private * const d; friend class Private; }; } // namespace KGAPI2 #endif // LIBKGAPI2_LOCATIONCREATEJOB_H diff --git a/src/latitude/locationdeletejob.h b/src/latitude/locationdeletejob.h index e320ed7..20e6cc8 100644 --- a/src/latitude/locationdeletejob.h +++ b/src/latitude/locationdeletejob.h @@ -1,98 +1,98 @@ /* * This file is part of LibKGAPI library * * Copyright (C) 2013 Daniel Vrátil * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) version 3, or any * later version accepted by the membership of KDE e.V. (or its * successor approved by the membership of KDE e.V.), which shall * act as a proxy defined in Section 6 of version 3 of the license. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef LIBKGAPI2_LOCATIONDELETEJOB_H #define LIBKGAPI2_LOCATIONDELETEJOB_H #include "deletejob.h" #include "kgapilatitude_export.h" namespace KGAPI2 { /** * @brief A job to delete one or more location from user's account on * Google Latitude service * * Note that operation is irreversible. * * @author Daniel Vrátil * @since 2.0 */ -class KGAPILATITUDE_EXPORT LocationDeleteJob : public KGAPI2::DeleteJob +class KGAPILATITUDE_DEPRECATED_EXPORT LocationDeleteJob : public KGAPI2::DeleteJob { Q_OBJECT public: /** * @brief Constructs a job that will delete user's current location from * his/her Google Latitude account. * * @param account Account to authenticate the request * @param parent */ explicit LocationDeleteJob(const AccountPtr &account, QObject* parent); /** * @brief Constructs a job that will delete given @p location from user's * Google Latitude account. * * @param location Location to delete * @param account Account to authenticate the request * @param parent */ explicit LocationDeleteJob(const LocationPtr &location, const AccountPtr &account, QObject* parent); /** * @brief Constructs a job that will delete given location with given * @p timestamp from user'sGoogle Latitude account. * * @param timestamp Timestamp of location to delete * @param account Account to authenticate the request * @param parent */ explicit LocationDeleteJob(qulonglong timestamp, const AccountPtr &account, QObject* parent); /** * @brief Destructor */ ~LocationDeleteJob() override; protected: /** * @brief KGAPI2::Job::start implementation */ void start() override; private: class Private; Private * const d; friend class Private; }; } // namespace KGAPI2 #endif // LIBKGAPI2_LOCATIONDELETEJOB_H diff --git a/src/latitude/locationfetchhistoryjob.h b/src/latitude/locationfetchhistoryjob.h index 3aa9354..c99e108 100644 --- a/src/latitude/locationfetchhistoryjob.h +++ b/src/latitude/locationfetchhistoryjob.h @@ -1,177 +1,177 @@ /* * This file is part of LibKGAPI library * * Copyright (C) 2013 Daniel Vrátil * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) version 3, or any * later version accepted by the membership of KDE e.V. (or its * successor approved by the membership of KDE e.V.), which shall * act as a proxy defined in Section 6 of version 3 of the license. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef LIBKGAPI2_LOCATIONFETCHHISTORYJOB_H #define LIBKGAPI2_LOCATIONFETCHHISTORYJOB_H #include "fetchjob.h" #include "latitude.h" #include "kgapilatitude_export.h" namespace KGAPI2 { /** * @brief A job to fetch all past locations from user's account on Google Latitude * * @author Daniel Vrátil * @since 2.0 */ -class KGAPILATITUDE_EXPORT LocationFetchHistoryJob : public KGAPI2::FetchJob +class KGAPILATITUDE_DEPRECATED_EXPORT LocationFetchHistoryJob : public KGAPI2::FetchJob { Q_OBJECT /** * @brief Granularity of the results * * Specifies how precise the results should be. By default, Latitude::City * granularity is used. * * This property can be modified only when the job is not running. * * @see setGranularity, granularity */ Q_PROPERTY(Latitude::Granularity granularity READ granularity WRITE setGranularity) /** * @brief Maximum number of results to fetch * * Specifies up to how many locations should the job fetch. Default value is * 0, which means that the job will fetch all available locations. * * This property can be modified only when the job is not running. * * @see setMaxResults, maxResults */ Q_PROPERTY(int maxResults READ maxResults WRITE setMaxResults) /** * @brief Oldest location to fetch * * Specifies timestamp of recording of the oldest location to be fetched. * * This property can be modified only when the job is not running. * * @see minTimestamp, setMinTimestamp */ Q_PROPERTY(qlonglong minTimestamp READ minTimestamp WRITE setMinTimestamp) /** * @brief Newest location to fetch * * Specifies timestamp of recording of the newest location to be fetched. * * This property can be modified only when the job is not running. * * @see maxTimestamp, setMaxTimestamp */ Q_PROPERTY(qlonglong maxTimestamp READ maxTimestamp WRITE setMaxTimestamp) public: /** * @brief Constructs a job that will fetch all past user's locations from * Google Latitude service * * @param account Account to authenticate the requests * @param parent */ explicit LocationFetchHistoryJob(const AccountPtr &account, QObject* parent = nullptr); /** * @brief Destructor */ ~LocationFetchHistoryJob() override; /** * @brief Returns granularity of the requested locations. */ Latitude::Granularity granularity() const; /** * @brief Sets granularity of the requested results. By default it's City. * * @param granularity */ void setGranularity(Latitude::Granularity granularity); /** * @brief Returns maximum number of locations the job will fetch */ int maxResults() const; /** * @brief Sets maximum number of locations to fetch * * @param results Maximum number of results or 0 to fetch all locations. */ void setMaxResults(int results); /** * @brief Returns lower date limit for fetched locations. */ qlonglong minTimestamp() const; /** * @brief Sets lower date limit for locations to fetch. * * @param minTimestamp */ void setMinTimestamp(qlonglong minTimestamp); /** * @brief Returns upper date limit for fetched locations. */ qlonglong maxTimestamp() const; /** * @brief Sets upper date limit for locations to fetch. * * @param maxTimestamp */ void setMaxTimestamp(qlonglong maxTimestamp); protected: /** * @brief KGAPI2::Job::start implementation */ void start() override; /** * @brief KGAPI2::Job::handleReplyWithItems * * @param reply * @param rawData */ ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray& rawData) override; private: class Private; Private * const d; friend class Private; }; } // namespace KGAPI2 #endif // LIBKGAPI2_LOCATIONFETCHHISTORYJOB_H diff --git a/src/latitude/locationfetchjob.h b/src/latitude/locationfetchjob.h index ee53850..3391e28 100644 --- a/src/latitude/locationfetchjob.h +++ b/src/latitude/locationfetchjob.h @@ -1,118 +1,118 @@ /* * This file is part of LibKGAPI library * * Copyright (C) 2013 Daniel Vrátil * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) version 3, or any * later version accepted by the membership of KDE e.V. (or its * successor approved by the membership of KDE e.V.), which shall * act as a proxy defined in Section 6 of version 3 of the license. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef LIBKGAPI2_LOCATIONFETCHJOB_H #define LIBKGAPI2_LOCATIONFETCHJOB_H #include "fetchjob.h" #include "latitude.h" #include "kgapilatitude_export.h" namespace KGAPI2 { /** * @brief A job to fetch current or a specific locations from user's account on * Google Latitude * * @author Daniel Vrátil * @since 2.0 */ -class KGAPILATITUDE_EXPORT LocationFetchJob : public KGAPI2::FetchJob +class KGAPILATITUDE_DEPRECATED_EXPORT LocationFetchJob : public KGAPI2::FetchJob { Q_OBJECT /** * @brief Granularity of the results * * Specifies how precise the results should be. By default, Latitude::City * granularity is used. * * This property can be modified only when the job is not running. * * @see setGranularity, granularity */ Q_PROPERTY(Latitude::Granularity granularity READ granularity WRITE setGranularity) public: /** * @brief Constructs a job that will fetch users current locations from * Google Latitude service * * @param account Account to authenticate the requests * @param parent */ explicit LocationFetchJob(const AccountPtr &account, QObject* parent = nullptr); /** * @brief Constructs a job that will fetch specific past user's location from * Google Latitude service * * @param timestamp Timestamp of the location to fetch * @param account Account to authenticate the requests * @param parent */ explicit LocationFetchJob(qlonglong timestamp, const AccountPtr &account, QObject* parent = nullptr); /** * @brief Destructor */ ~LocationFetchJob() override; /** * @brief Sets granularity of the requested result. By default it's City. * * @param granularity */ void setGranularity(Latitude::Granularity granularity); /** * @brief Returns granularity of the requested location. */ Latitude::Granularity granularity() const; protected: /** * @brief KGAPI2::Job::start implementation */ void start() override; /** * @brief KGAPI2::FetchJob::handleReplyWithItems implementation * * @param reply * @param rawData */ ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray& rawData) override; private: class Private; Private * const d; friend class Private; }; } // namespace KGAPI2 #endif // LIBKGAPI2_LOCATIONFETCHJOB_H