libmygpo-qt
 All Classes Functions
Public Member Functions | List of all members
mygpo::ApiRequest Class Reference

This Class is the Frontend of libmygpo-qt. More...

#include <ApiRequest.h>

Public Member Functions

 ApiRequest (const QString &username, const QString &password, QNetworkAccessManager *nam)
 
 ApiRequest (QNetworkAccessManager *nam)
 
QNetworkReply * toplistOpml (uint count)
 Returns the OPML Result for the Simple API Call "Downloading Podcast Toplists". More...
 
QNetworkReply * searchOpml (const QString &query)
 Returns the OPML Result for the Simple API Call "Searching for Podcasts". More...
 
QNetworkReply * suggestionsOpml (uint count)
 Returns the OPML Result for the Simple API Call "Downloading podcast suggestions" Requires Authentication. More...
 
QNetworkReply * downloadSubscriptionsOpml (const QString &username, const QString &device)
 
QNetworkReply * toplistTxt (uint count)
 Returns the TXT Result for the Simple API Call "Downloading Podcast Toplists". More...
 
QNetworkReply * searchTxt (const QString &query)
 Returns the TXT Result for the Simple API Call "Searching for Podcasts". More...
 
QNetworkReply * suggestionsTxt (uint count)
 Returns the TXT Result for the Simple API Call "Downloading podcast suggestions" Requires Authentication. More...
 
QNetworkReply * downloadSubscriptionsTxt (const QString &username, const QString &device)
 
QNetworkReply * toplistXml (uint count)
 Returns the TXT Result for the Simple API Call "Downloading Podcast Toplists". More...
 
QNetworkReply * searchXml (const QString &query)
 Returns the XML Result for the Simple API Call "Searching for Podcasts". More...
 
PodcastListPtr toplist (uint count)
 Returns the Result for the Simple API Call "Downloading Podcast Toplists". More...
 
PodcastListPtr search (const QString &query)
 Returns the Result for the Simple API Call "Searching for Podcasts". More...
 
PodcastListPtr suggestions (uint count)
 Returns the Result for the Simple API Call "Downloading podcast suggestions" Requires Authentication. More...
 
QNetworkReply * downloadSubscriptionsJson (const QString &username, const QString &device)
 
PodcastListPtr podcastsOfTag (uint count, const QString &tag)
 Returns the Result for the Advanced API Call "Retrieving Podcasts of a Tag". More...
 
PodcastPtr podcastData (const QUrl &podcasturl)
 Returns the Result for the Advanced API Call "Retrieving Podcast Data". More...
 
EpisodePtr episodeData (const QUrl &podcasturl, const QUrl &episodeurl)
 Returns the Result for the Advanced API Call "Retrieving Episode Data". More...
 
EpisodeListPtr favoriteEpisodes (const QString &username)
 Returns the Result for the Advanced API Call "Listing Favorite Episodes". More...
 
TagListPtr topTags (uint count)
 Returns the Result for the Advanced API Call "Retrieving Top Tags". More...
 
AddRemoveResultPtr addRemoveSubscriptions (const QString &username, const QString &device, const QList< QUrl > &add, const QList< QUrl > &remove)
 Uploads Data & returns the Result for the Advanced API Call "Add/remove subscriptions" Requires Authentication. More...
 
SettingsPtr accountSettings (const QString &username)
 Retrieve settings which are attached to an account. More...
 
SettingsPtr deviceSettings (const QString &username, const QString &device)
 Retrieve settings which are attached to a device. More...
 
SettingsPtr podcastSettings (const QString &username, const QString &podcastUrl)
 Retrieve settings which are attached to a podcast. More...
 
SettingsPtr episodeSettings (const QString &username, const QString &podcastUrl, const QString &episodeUrl)
 Retrieve settings which are attached to an episode. More...
 
SettingsPtr setAccountSettings (const QString &username, QMap< QString, QVariant > &set, const QList< QString > &remove)
 Set and or remove settings which are attached to an account. More...
 
SettingsPtr setDeviceSettings (const QString &username, const QString &device, QMap< QString, QVariant > &set, const QList< QString > &remove)
 Set and or remove settings which are attached to a device. More...
 
SettingsPtr setPodcastSettings (const QString &username, const QString &podcastUrl, QMap< QString, QVariant > &set, const QList< QString > &remove)
 Set and or remove settings which are attached to a podcast. More...
 
SettingsPtr setEpisodeSettings (const QString &username, const QString &podcastUrl, const QString &episodeUrl, QMap< QString, QVariant > &set, const QList< QString > &remove)
 Set and or remove settings which are attached to an episode. More...
 
DeviceUpdatesPtr deviceUpdates (const QString &username, const QString &deviceId, qlonglong timestamp)
 Retrieve episode and subscription updates for a given device. More...
 
QNetworkReply * renameDevice (const QString &username, const QString &deviceId, const QString &caption, Device::Type type)
 Sets a new name and type for a device identified by a given ID. More...
 
DeviceListPtr listDevices (const QString &username)
 Returns the list of devices that belong to a user. More...
 
EpisodeActionListPtr episodeActions (const QString &username, const bool aggregated=false)
 Download episode actions for a given username. More...
 
EpisodeActionListPtr episodeActionsByPodcast (const QString &username, const QString &podcastUrl, const bool aggregated=false)
 Download episode actions for a given podcast. More...
 
EpisodeActionListPtr episodeActionsByDevice (const QString &username, const QString &deviceId, const bool aggregated=false)
 Download episode actions for a given device. More...
 
EpisodeActionListPtr episodeActionsByTimestamp (const QString &username, const qulonglong since)
 Download episode actions for a given username since a given timestamp. More...
 
EpisodeActionListPtr episodeActionsByPodcastAndTimestamp (const QString &username, const QString &podcastUrl, const qulonglong since)
 Download episode actions for a given podcast since a given timestamp. More...
 
EpisodeActionListPtr episodeActionsByDeviceAndTimestamp (const QString &username, const QString &deviceId, const qulonglong since)
 Download episode actions for a given device since a given timestamp. More...
 
AddRemoveResultPtr uploadEpisodeActions (const QString &username, const QList< EpisodeActionPtr > &episodeActions)
 Upload episode actions. More...
 
DeviceSyncResultPtr deviceSynchronizationStatus (const QString &username)
 
DeviceSyncResultPtr setDeviceSynchronizationStatus (const QString &username, const QList< QStringList > &synchronize, const QList< QString > &stopSynchronize)
 

Detailed Description

This Class is the Frontend of libmygpo-qt.

Methods from this Class map the Web API of gpodder.net and return the Results of the Requests. Web API Documentation can be found here: http://wiki.gpodder.org/wiki/Web_Services/API_2

Member Function Documentation

SettingsPtr mygpo::ApiRequest::accountSettings ( const QString &  username)

Retrieve settings which are attached to an account.

Parameters
usernameUsername of the targeted account
Returns
Received settings as key-value-pairs
AddRemoveResultPtr mygpo::ApiRequest::addRemoveSubscriptions ( const QString &  username,
const QString &  device,
const QList< QUrl > &  add,
const QList< QUrl > &  remove 
)

Uploads Data & returns the Result for the Advanced API Call "Add/remove subscriptions" Requires Authentication.

Parameters
usernameUser for which this API Call should be executed
devicegPodder Device for which this API Call should be executed
addURLs of Podcasts that should be added to the Subscriptions of the User
removeURLs of Podcasts that should be removed from the Subscriptions of the User
SettingsPtr mygpo::ApiRequest::deviceSettings ( const QString &  username,
const QString &  device 
)

Retrieve settings which are attached to a device.

Parameters
usernameUsername of the account which owns the device
deviceName of the targeted device
Returns
Received settings as key-value-pairs
DeviceUpdatesPtr mygpo::ApiRequest::deviceUpdates ( const QString &  username,
const QString &  deviceId,
qlonglong  timestamp 
)

Retrieve episode and subscription updates for a given device.

Parameters
usernameUsername of the account which owns the device
deviceIdId of the targeted device
timestampA date in milliseconds, All changes since this timestamp will be retrieved
Returns
A DeviceUpdatesPtr which accesses:
  • a list of subscriptions to be added, with URL, title and descriptions
  • a list of URLs to be unsubscribed
  • a list of updated episodes
EpisodeActionListPtr mygpo::ApiRequest::episodeActions ( const QString &  username,
const bool  aggregated = false 
)

Download episode actions for a given username.

Parameters
Usernameof the targeted user
aggregatedIf aggregated is set to true, only the latest episode action will be returned
Returns
List of all episode actions of the user
EpisodeActionListPtr mygpo::ApiRequest::episodeActionsByDevice ( const QString &  username,
const QString &  deviceId,
const bool  aggregated = false 
)

Download episode actions for a given device.

Parameters
usernameUsername of the account which owns the device
deviceIdThe Id of the targeted device
aggregatedIf aggregated is set to true, only the latest episode action will be returned
Returns
List of all episode actions for the given device
EpisodeActionListPtr mygpo::ApiRequest::episodeActionsByDeviceAndTimestamp ( const QString &  username,
const QString &  deviceId,
const qulonglong  since 
)

Download episode actions for a given device since a given timestamp.

Parameters
usernameUsername of the account which owns the device
deviceIdThe Id of the targeted device
sinceTimestamp in milliseconds, Episode Actions since this time will be retrieved
Returns
List of all new episode actions since the given timestamp
EpisodeActionListPtr mygpo::ApiRequest::episodeActionsByPodcast ( const QString &  username,
const QString &  podcastUrl,
const bool  aggregated = false 
)

Download episode actions for a given podcast.

Parameters
usernameUsername of the account which owns the podcast
podcastUrlUrl which identifies the targeted podcast
aggregatedIf aggregated is set to true, only the latest episode action will be returned
Returns
List of all episode actions for the given podcast
EpisodeActionListPtr mygpo::ApiRequest::episodeActionsByPodcastAndTimestamp ( const QString &  username,
const QString &  podcastUrl,
const qulonglong  since 
)

Download episode actions for a given podcast since a given timestamp.

Parameters
usernameUsername of the account which owns the podcast
podcastUrlUrl which identifies the targeted podcast
sinceTimestamp in milliseconds, Episode Actions since this time will be retrieved
Returns
List of all new episode actions since the given timestamp
EpisodeActionListPtr mygpo::ApiRequest::episodeActionsByTimestamp ( const QString &  username,
const qulonglong  since 
)

Download episode actions for a given username since a given timestamp.

Parameters
Usernameof the targeted user
sinceTimestamp in milliseconds, Episode Actions since this time will be retrieved
Returns
List of all new episode actions since the given timestamp
EpisodePtr mygpo::ApiRequest::episodeData ( const QUrl &  podcasturl,
const QUrl &  episodeurl 
)

Returns the Result for the Advanced API Call "Retrieving Episode Data".

Parameters
podcasturlUrl of the Podcast that contains the Episode
episodeurlUrl of the Episode Data for which Data should be retrieved
Returns
Episode Object containing the Data from gPodder
SettingsPtr mygpo::ApiRequest::episodeSettings ( const QString &  username,
const QString &  podcastUrl,
const QString &  episodeUrl 
)

Retrieve settings which are attached to an episode.

Parameters
usernameUsername of the account which owns the episode
podcastUrlUrl as String which identifies the podcast to which the episode belongs to
episodeUrlUrl as String which identifies the targeted episode
Returns
Received settings as key-value-pairs
EpisodeListPtr mygpo::ApiRequest::favoriteEpisodes ( const QString &  username)

Returns the Result for the Advanced API Call "Listing Favorite Episodes".

Parameters
usernameThe User whose Favorite Episodes should be retrieved
Returns
List of Episode Objects containing the Data from gPodder
DeviceListPtr mygpo::ApiRequest::listDevices ( const QString &  username)

Returns the list of devices that belong to a user.

Parameters
usernameUsername of the targeted user
Returns
List of devices
PodcastPtr mygpo::ApiRequest::podcastData ( const QUrl &  podcasturl)

Returns the Result for the Advanced API Call "Retrieving Podcast Data".

Parameters
podcasturlUrl of the Podcast for which Data should be retrieved
Returns
Podcast Object containing the Data from gPodder
SettingsPtr mygpo::ApiRequest::podcastSettings ( const QString &  username,
const QString &  podcastUrl 
)

Retrieve settings which are attached to a podcast.

Parameters
usernameUsername of the account which owns the podcast
podcastUrlUrl which identifies the targeted podcast
Returns
Received settings as key-value-pairs
PodcastListPtr mygpo::ApiRequest::podcastsOfTag ( uint  count,
const QString &  tag 
)

Returns the Result for the Advanced API Call "Retrieving Podcasts of a Tag".

Parameters
queryThe number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
tagThe Tag for which Podcasts should be retrieved
Returns
List of Podcast Objects containing the Data from gPodder
QNetworkReply* mygpo::ApiRequest::renameDevice ( const QString &  username,
const QString &  deviceId,
const QString &  caption,
Device::Type  type 
)

Sets a new name and type for a device identified by a given ID.

Parameters
usernameUsername of the account which owns the device
deviceIdThe id of the targeted device
captionThe new name of the device
typeThe new type of the device
Returns
A Pointer to a QNetworkReply which receives network signals
PodcastListPtr mygpo::ApiRequest::search ( const QString &  query)

Returns the Result for the Simple API Call "Searching for Podcasts".

Parameters
queryThe String you want to search for
Returns
List of Podcast Objects containing the Data from gPodder
QNetworkReply* mygpo::ApiRequest::searchOpml ( const QString &  query)

Returns the OPML Result for the Simple API Call "Searching for Podcasts".

Parameters
queryThe String you want to search for
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
QNetworkReply* mygpo::ApiRequest::searchTxt ( const QString &  query)

Returns the TXT Result for the Simple API Call "Searching for Podcasts".

Parameters
queryThe String you want to search for
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
QNetworkReply* mygpo::ApiRequest::searchXml ( const QString &  query)

Returns the XML Result for the Simple API Call "Searching for Podcasts".

Parameters
queryThe String you want to search for
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
SettingsPtr mygpo::ApiRequest::setAccountSettings ( const QString &  username,
QMap< QString, QVariant > &  set,
const QList< QString > &  remove 
)

Set and or remove settings which are attached to an account.

Parameters
usernameUsername of the targeted account
setA set of settings as key-value-pairs which shall be set
setA set of exisiting settings as key-value-pairs which shall be removed
Returns
All settings as key-value-pairs which are stored after the update
SettingsPtr mygpo::ApiRequest::setDeviceSettings ( const QString &  username,
const QString &  device,
QMap< QString, QVariant > &  set,
const QList< QString > &  remove 
)

Set and or remove settings which are attached to a device.

Parameters
usernameUsername of the account which owns the device
deviceName of the targeted device
setA set of settings as key-value-pairs which shall be set
setA set of exisiting settings as key-value-pairs which shall be removed
Returns
All settings as key-value-pairs which are stored after the update
SettingsPtr mygpo::ApiRequest::setEpisodeSettings ( const QString &  username,
const QString &  podcastUrl,
const QString &  episodeUrl,
QMap< QString, QVariant > &  set,
const QList< QString > &  remove 
)

Set and or remove settings which are attached to an episode.

Parameters
usernameUsername of the account which owns the episode
podcastUrlUrl as String which identifies the podcast to which the episode belongs to
episodeUrlUrl as String which identifies the targeted episode
setA set of settings as key-value-pairs which shall be set
setA set of exisiting settings as key-value-pairs which shall be removed
Returns
All settings as key-value-pairs which are stored after the update
SettingsPtr mygpo::ApiRequest::setPodcastSettings ( const QString &  username,
const QString &  podcastUrl,
QMap< QString, QVariant > &  set,
const QList< QString > &  remove 
)

Set and or remove settings which are attached to a podcast.

Parameters
usernameUsername of the account which owns the podcast
podcastUrlUrl which identifies the targeted podcast
setA set of settings as key-value-pairs which shall be set
setA set of exisiting settings as key-value-pairs which shall be removed
Returns
All settings as key-value-pairs which are stored after the update
PodcastListPtr mygpo::ApiRequest::suggestions ( uint  count)

Returns the Result for the Simple API Call "Downloading podcast suggestions" Requires Authentication.

Parameters
countThe maximum number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
Returns
List of Podcast Objects containing the Data from gPodder
QNetworkReply* mygpo::ApiRequest::suggestionsOpml ( uint  count)

Returns the OPML Result for the Simple API Call "Downloading podcast suggestions" Requires Authentication.

Parameters
countThe maximum number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
QNetworkReply* mygpo::ApiRequest::suggestionsTxt ( uint  count)

Returns the TXT Result for the Simple API Call "Downloading podcast suggestions" Requires Authentication.

Parameters
countThe maximum number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
PodcastListPtr mygpo::ApiRequest::toplist ( uint  count)

Returns the Result for the Simple API Call "Downloading Podcast Toplists".

Parameters
countThe number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
Returns
List of Podcast Objects containing the Data from gPodder
QNetworkReply* mygpo::ApiRequest::toplistOpml ( uint  count)

Returns the OPML Result for the Simple API Call "Downloading Podcast Toplists".

Parameters
countThe number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
QNetworkReply* mygpo::ApiRequest::toplistTxt ( uint  count)

Returns the TXT Result for the Simple API Call "Downloading Podcast Toplists".

Parameters
countThe number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
QNetworkReply* mygpo::ApiRequest::toplistXml ( uint  count)

Returns the TXT Result for the Simple API Call "Downloading Podcast Toplists".

Parameters
countThe number of Podcasts that should be returned - will be set to to 100 if > 100 or < 1
Returns
A Pointer to a QNetworkReply which receives network signals and will contain the data
TagListPtr mygpo::ApiRequest::topTags ( uint  count)

Returns the Result for the Advanced API Call "Retrieving Top Tags".

Parameters
countThe number of Tags that should be returned - will be set to to 100 if > 100 or < 1
Returns
List of Tag Objects containing the Data from gPodder
AddRemoveResultPtr mygpo::ApiRequest::uploadEpisodeActions ( const QString &  username,
const QList< EpisodeActionPtr > &  episodeActions 
)

Upload episode actions.

Parameters
episodeActionsThe list of episode actions which shall be uploaded
Returns
An AddRemoveResultPtr which contains information about the updated Urls

The documentation for this class was generated from the following file: