Kgapi

tasksservice.h
1/*
2 SPDX-FileCopyrightText: 2012-2018 Daniel Vrátil <dvratil@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#pragma once
8
9#include "kgapitasks_export.h"
10#include "types.h"
11
12namespace KGAPI2
13{
14
15/**
16 * @brief Additional methods for implementing support for Google Tasks service
17 *
18 * You should never need to use these methods, unless implementing your own Job
19 */
20namespace TasksService
21{
22
23/**
24 * @brief Parses JSON data into a Task object
25 *
26 * @param jsonData
27 */
28KGAPITASKS_EXPORT TaskPtr JSONToTask(const QByteArray &jsonData);
29
30/**
31 * @brief Serializes a Task object into JSON
32 *
33 * @param task
34 */
35KGAPITASKS_EXPORT QByteArray taskToJSON(const TaskPtr &task);
36
37/**
38 * @brief Parses JSON data into a TaskList object
39 *
40 * @param jsonData
41 */
42KGAPITASKS_EXPORT TaskListPtr JSONToTaskList(const QByteArray &jsonData);
43
44/**
45 * @brief Serializes a TaskList into JSON data
46 *
47 * @param taskList
48 */
49KGAPITASKS_EXPORT QByteArray taskListToJSON(const TaskListPtr &taskList);
50
51/**
52 * @brief Parses JSON feed into list of Tasks or TaskLists
53 *
54 * @param jsonFeed
55 * @param feedData The structure will be filled with additional information
56 * about the feed
57 */
58KGAPITASKS_EXPORT ObjectsList parseJSONFeed(const QByteArray &jsonFeed, FeedData &feedData);
59
60/**
61 * @brief Returns URL to create a single task
62 *
63 * @param tasklistID ID of parent task list
64 */
65KGAPITASKS_EXPORT QUrl createTaskUrl(const QString &tasklistID);
66
67/**
68 * @brief Returns URL to fetch all tasks from a single tasklist
69 *
70 * @param tasklistID ID of parent task list
71 */
72KGAPITASKS_EXPORT QUrl fetchAllTasksUrl(const QString &tasklistID);
73
74/**
75 * @brief Returns URL for fetching a single task
76 *
77 * @param tasklistID ID of parent task list
78 * @param taskID ID of task to fetch
79 */
80KGAPITASKS_EXPORT QUrl fetchTaskUrl(const QString &tasklistID, const QString &taskID);
81
82/**
83 * @brief Returns URL for updating a task
84 *
85 * @param tasklistID ID of parent task list
86 * @param taskID ID of task to update
87 */
88KGAPITASKS_EXPORT QUrl updateTaskUrl(const QString &tasklistID, const QString &taskID);
89
90/**
91 * @brief Returns URL for removing a task
92 *
93 * @param tasklistID ID of parent task list
94 * @param taskID ID of task to remove
95 */
96KGAPITASKS_EXPORT QUrl removeTaskUrl(const QString &tasklistID, const QString &taskID);
97
98/**
99 * @brief Returns URL to reparent task.
100 *
101 * @param tasklistID ID of parent task list
102 * @param taskID ID of task to move
103 * @param newParent UID of new parent item
104 */
105KGAPITASKS_EXPORT QUrl moveTaskUrl(const QString &tasklistID, const QString &taskID, const QString &newParent);
106
107/**
108 * @brief Returns URL for fetching all tasklists
109 */
110KGAPITASKS_EXPORT QUrl fetchTaskListsUrl();
111
112/**
113 * @brief Returns URL for creating a new tasklist
114 */
115KGAPITASKS_EXPORT QUrl createTaskListUrl();
116
117/**
118 * @brief Returns URL for modifying a tasklist
119 *
120 * @param tasklistID ID of task list to update
121 */
122KGAPITASKS_EXPORT QUrl updateTaskListUrl(const QString &tasklistID);
123
124/**
125 * @brief Returns URL for deleting a tasklist
126 *
127 * @param tasklistID ID of task list to remove
128 */
129KGAPITASKS_EXPORT QUrl removeTaskListUrl(const QString &tasklistID);
130
131} /* namespace TasksServices */
132
133} /* namespace KGAPI2 */
QUrl updateTaskListUrl(const QString &tasklistID)
Returns URL for modifying a tasklist.
QByteArray taskListToJSON(const TaskListPtr &taskList)
Serializes a TaskList into JSON data.
QByteArray taskToJSON(const TaskPtr &task)
Serializes a Task object into JSON.
QUrl createTaskUrl(const QString &tasklistID)
Returns URL to create a single task.
ObjectsList parseJSONFeed(const QByteArray &jsonFeed, FeedData &feedData)
Parses JSON feed into list of Tasks or TaskLists.
QUrl fetchAllTasksUrl(const QString &tasklistID)
Returns URL to fetch all tasks from a single tasklist.
QUrl removeTaskListUrl(const QString &tasklistID)
Returns URL for deleting a tasklist.
QUrl fetchTaskUrl(const QString &tasklistID, const QString &taskID)
Returns URL for fetching a single task.
TaskPtr JSONToTask(const QByteArray &jsonData)
Parses JSON data into a Task object.
TaskListPtr JSONToTaskList(const QByteArray &jsonData)
Parses JSON data into a TaskList object.
QUrl removeTaskUrl(const QString &tasklistID, const QString &taskID)
Returns URL for removing a task.
QUrl createTaskListUrl()
Returns URL for creating a new tasklist.
QUrl fetchTaskListsUrl()
Returns URL for fetching all tasklists.
QUrl moveTaskUrl(const QString &tasklistID, const QString &taskID, const QString &newParent)
Returns URL to reparent task.
QUrl updateTaskUrl(const QString &tasklistID, const QString &taskID)
Returns URL for updating a task.
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 Nov 29 2024 11:54:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.