Attica

provider.h
1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
5 SPDX-FileCopyrightText: 2011 Laszlo Papp <djszapi@archlinux.us>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8*/
9
10#ifndef ATTICA_PROVIDER_H
11#define ATTICA_PROVIDER_H
12
13#include <QExplicitlySharedDataPointer>
14#include <QSharedPointer>
15#include <QString>
16#include <QStringList>
17
18#include <QUrl>
19
20#include "achievement.h"
21#include "attica_export.h"
22#include "category.h"
23#include "comment.h"
24#include "distribution.h"
25#include "forum.h"
26#include "itemjob.h"
27#include "license.h"
28#include "listjob.h"
29#include "message.h"
30
31class QDate;
32class QUrl;
33
34namespace Attica
35{
36class PlatformDependent;
37
38class PostJobStatus;
39
40class AccountBalance;
41class Activity;
43class BuildServiceJob;
44class BuildService;
45class PrivateData;
46class Config;
47class Content;
48class DownloadItem;
49class Distribution;
50class Event;
51class Folder;
52class HomePageType;
54class License;
55class Person;
56class PostJob;
57class Project;
58class Provider;
59class Publisher;
60class PublisherField;
61class RemoteAccount;
62
63/**
64 * @class Provider provider.h <Attica/Provider>
65 *
66 * The Provider class represents one Open Collaboration Service provider.
67 * Use the ProviderManager to instantiate a Provider.
68 *
69 * Accessing functions of the Provider returns a Job class that
70 * takes care of accessing the server and parsing the result.
71 *
72 * Provider files are xml of the form:
73 <pre>
74 <provider>
75 <id>opendesktop</id>
76 <location>https://api.opendesktop.org/v1/</location>
77 <name>openDesktop.org</name>
78 <icon></icon>
79 <termsofuse>https://opendesktop.org/terms/</termsofuse>
80 <register>https://opendesktop.org/usermanager/new.php</register>
81 <services>
82 <person ocsversion="1.3" />
83 <friend ocsversion="1.3" />
84 <message ocsversion="1.3" />
85 <activity ocsversion="1.3" />
86 <content ocsversion="1.3" />
87 <fan ocsversion="1.3" />
88 <knowledgebase ocsversion="1.3" />
89 <event ocsversion="1.3" />
90 <comment ocsversion="1.2" />
91 </services>
92</provider>
93 </pre>
94 * The server provides the services specified in the services section, not necessarily all of them.
95 */
96class ATTICA_EXPORT Provider
97{
98public:
99 /**
100 * Default construct a Provider. Please note that this provider is incomplete and never valid.
101 */
102 Provider();
103 Provider(const Provider &other);
104 Provider &operator=(const Provider &other);
105 ~Provider();
106
107 /**
108 Returns true if the provider has been set up and can be used.
109 */
110 bool isValid() const;
111
112 /**
113 Test if the provider is enabled by the settings.
114 The application can choose to ignore this, but the user settings should be respected.
115 */
116 bool isEnabled() const;
117 void setEnabled(bool enabled);
118
119 /**
120 * Set a custom identifier for your application (sent along with the requests as
121 * the http agent header in addition to the application name and version).
122 *
123 * For example, you might have an application named SomeApplication, version 23,
124 * and wish to send along the data "lookandfeel.knsrc". Call this function, and
125 * the resulting agent header would be:
126 *
127 * SomeApplication/23 (+lookandfeel.knsrc)
128 *
129 * If you do not set this (or set it to an empty string), the agent string becomes
130 *
131 * SomeApplication/23
132 *
133 * @param additionalAgentInformation The extra string
134 * @since 5.66
135 */
136 void setAdditionalAgentInformation(const QString &additionalInformation);
137 /**
138 * The custom identifier sent along with requests
139 *
140 * @return The custom identifier
141 * @see setAdditionalAgentInformation(const QString&)
142 * @since 5.66
143 */
145
146 /**
147 A url that identifies this provider.
148 This should be used as identifier when referring to this provider but you don't want to use the full provider object.
149 */
150 QUrl baseUrl() const;
151
152 /**
153 A name for the provider that can be displayed to the user
154 */
155 QString name() const;
156
157 /**
158 * An icon used to visually identify this provider
159 * @return A URL for an icon image (or an invalid URL if one was not defined by the provider)
160 * @since 5.85
161 */
162 QUrl icon() const;
163
164 enum SortMode {
165 Newest,
166 Alphabetical,
167 Rating,
168 Downloads,
169 };
170
171 /**
172 Test if the server supports the person part of the API
173 */
174 bool hasPersonService() const;
175 /**
176 Version of the person part of the API
177 */
179
180 /**
181 Test if the server supports the friend part of the API
182 */
183 bool hasFriendService() const;
184
185 /**
186 Version of the friend part of the API
187 */
189
190 /**
191 Test if the server supports the message part of the API
192 */
193 bool hasMessageService() const;
194 /**
195 Version of the message part of the API
196 */
198
199 /**
200 Test if the server supports the achievement part of the API
201 */
202 bool hasAchievementService() const;
203 /**
204 Version of the achievement part of the API
205 */
207
208 /**
209 Test if the server supports the activity part of the API
210 */
211 bool hasActivityService() const;
212 /**
213 Version of the activity part of the API
214 */
216
217 /**
218 Test if the server supports the content part of the API
219 */
220 bool hasContentService() const;
221 /**
222 Version of the content part of the API
223 */
225
226 /**
227 Test if the server supports the fan part of the API
228 */
229 bool hasFanService() const;
230 /**
231 Version of the fan part of the API
232 */
234
235 /**
236 Test if the server supports the forum part of the API
237 */
238 bool hasForumService() const;
239 /**
240 Version of the forum part of the API
241 */
243
244 /**
245 *
246 Test if the server supports the knowledgebase part of the API
247 */
248 bool hasKnowledgebaseService() const;
249 /**
250 Version of the knowledgebase part of the API
251 */
253
254 /**
255 Test if the server supports the comments part of the API
256 */
257 bool hasCommentService() const;
258 /**
259 Version of the comments part of the API
260 */
262
263 /**
264 Test if the provider has user name/password available.
265 This does not yet open kwallet in case the KDE plugin is used.
266 @return true if the provider has login information
267 */
268 bool hasCredentials() const;
269 bool hasCredentials();
270
271 /**
272 Load user name and password from the store.
273 Attica will remember the loaded values and use them from this point on.
274 @param user reference that returns the user name
275 @param password reference that returns the password
276 @return if credentials could be loaded
277 */
278 bool loadCredentials(QString &user, QString &password);
279
280 /**
281 Sets (and remembers) user name and password for this provider.
282 To remove the data an empty username should be passed.
283 @param user the user (login) name
284 @param password the password
285 @return if credentials could be saved
286 */
287 bool saveCredentials(const QString &user, const QString &password);
288
289 /**
290 Test if the server accepts the login/password.
291 This function does not actually set the credentials. Use saveCredentials for that purpose.
292 @param user the user (login) name
293 @param password the password
294 @return the job that will contain the success of the login as metadata
295 */
296 PostJob *checkLogin(const QString &user, const QString &password);
297
298 /**
299 * Fetches server config
300 * @return The job responsible for fetching data
301 */
303
304 // Person part of OCS
305
306 PostJob *registerAccount(const QString &id, const QString &password, const QString &mail, const QString &firstName, const QString &lastName);
307 ItemJob<Person> *requestPerson(const QString &id);
308 ItemJob<Person> *requestPersonSelf();
309 ItemJob<AccountBalance> *requestAccountBalance();
310 ListJob<Person> *requestPersonSearchByName(const QString &name);
311 ListJob<Person> *requestPersonSearchByLocation(qreal latitude, qreal longitude, qreal distance = 0.0, int page = 0, int pageSize = 20);
312 PostJob *postLocation(qreal latitude, qreal longitude, const QString &city = QString(), const QString &country = QString());
313
314 //////////////////////////
315 // PrivateData part of OCS
316
317 /**
318 * Fetches the a given attribute from an OCS-compliant server.
319 * @param app The application name
320 * @param key The key of the attribute to fetch (optional)
321 * @return The job that is responsible for fetching the data
322 */
324
325 /**
326 * Fetches all stored private data.
327 * @return The job responsible for fetching data
328 */
333
334 /**
335 * Sets the value of an attribute.
336 * @param app The application name
337 * @param key The key of the attribute
338 * @param value The new value of the attribute
339 * @return The job responsible for setting data
340 */
341 PostJob *setPrivateData(const QString &app, const QString &key, const QString &value);
342
343 // Friend part of OCS
344
345 ListJob<Person> *requestFriends(const QString &id, int page = 0, int pageSize = 20);
346 ListJob<Person> *requestSentInvitations(int page = 0, int pageSize = 20);
347 ListJob<Person> *requestReceivedInvitations(int page = 0, int pageSize = 20);
348 PostJob *inviteFriend(const QString &to, const QString &message);
349 PostJob *approveFriendship(const QString &to);
350 PostJob *declineFriendship(const QString &to);
351 PostJob *cancelFriendship(const QString &to);
352
353 // Message part of OCS
354
355 ListJob<Folder> *requestFolders();
356 ListJob<Message> *requestMessages(const Folder &folder);
357 ListJob<Message> *requestMessages(const Folder &folder, Message::Status status);
358 ItemJob<Message> *requestMessage(const Folder &folder, const QString &id);
359 PostJob *postMessage(const Message &message);
360
361 // Achievement part of OCS
362 /**
363 * Get a list of achievements
364 * @return ListJob listing Achievements
365 */
366 ListJob<Achievement> *requestAchievements(const QString &contentId, const QString &achievementId, const QString &userId);
367
368 /** Add a new achievement.
369 * @param id id of the achievement entry
370 * @param achievement The new Achievement added
371 * @return item post job for adding the new achievement
372 */
373 ItemPostJob<Achievement> *addNewAchievement(const QString &id, const Achievement &newAchievement);
374
375 /**
376 * Post modifications to an Achievement on the server
377 * @param achievement Achievement to update on the server
378 */
379 PutJob *editAchievement(const QString &contentId, const QString &achievementId, const Achievement &achievement);
380
381 /**
382 * Deletes an achievement on the server. The achievement passed as an argument doesn't need complete
383 * information as just the id() is used.
384 * @param achievement Achievement to delete on the server.
385 */
386 DeleteJob *deleteAchievement(const QString &contentId, const QString &achievementId);
387
388 // PostJob* postAchievement(const Achievement& achievement);
389 PostJob *setAchievementProgress(const QString &id, const QVariant &progress, const QDateTime &timestamp);
390 DeleteJob *resetAchievementProgress(const QString &id);
391
392 // Activity part of OCS
393
394 ListJob<Activity> *requestActivities();
395 PostJob *postActivity(const QString &message);
396
397 // Project part of OCS
398 /**
399 * Get a list of build service projects
400 * @return ListJob listing Projects
401 */
402 ListJob<Project> *requestProjects();
403
404 /**
405 * Get a Project's data
406 * @return ItemJob receiving data
407 */
408 ItemJob<Project> *requestProject(const QString &id);
409
410 /**
411 * Post modifications to a Project on the server. The resulting project ID can be found in
412 * the Attica::MetaData of the finished() PostJob. You can retrieve it using
413 * Attica::MetaData::resultingProjectId().
414 * @param project Project to create on the server
415 */
416 PostJob *createProject(const Project &project);
417
418 /**
419 * Deletes a project on the server. The project passed as an argument doesn't need complete
420 * information as just the id() is used.
421 * @param project Project to delete on the server.
422 */
423 PostJob *deleteProject(const Project &project);
424
425 /**
426 * Post modifications to a Project on the server
427 * @param project Project to update on the server
428 */
429 PostJob *editProject(const Project &project);
430
431 // Buildservice part of OCS
432
433 /**
434 * Get the information for a specific build service instance.
435 * @return ItemJob receiving data
436 */
437 ItemJob<BuildService> *requestBuildService(const QString &id);
438
439 /**
440 * Get the information for a specific publisher.
441 * @return ItemJob receiving data
442 */
443 ItemJob<Publisher> *requestPublisher(const QString &id);
444
445 /**
446 * Save the value of a single publishing field
447 * @return PostJob*
448 */
449 PostJob *savePublisherField(const Project &project, const PublisherField &field);
450
451 /**
452 * Publish the result of a completed build job to a publisher.
453 * @return ItemJob receiving data
454 */
455 PostJob *publishBuildJob(const BuildServiceJob &buildjob, const Publisher &publisher);
456
457 /**
458 * Get the build output for a specific build service job
459 * @return ItemJob receiving and containing the output data
460 */
461 ItemJob<BuildServiceJobOutput> *requestBuildServiceJobOutput(const QString &id);
462
463 /**
464 * Get the information for a specific build service job, such as status and progress.
465 * @return ItemJob receiving and containing the data
466 */
467 ItemJob<BuildServiceJob> *requestBuildServiceJob(const QString &id);
468
469 /**
470 * Get a list of build service build services
471 * @return ListJob listing BuildServices
472 */
473 ListJob<BuildService> *requestBuildServices();
474
475 /**
476 * Get a list of publishers
477 * @return ListJob listing Publishers
478 */
479 ListJob<Publisher> *requestPublishers();
480
481 /**
482 * Get a list of build service projects
483 * @return ListJob listing BuildServiceJobs
484 */
485 ListJob<BuildServiceJob> *requestBuildServiceJobs(const Project &project);
486
487 /**
488 * Create a new job for a given project on a given buildservice for a given target.
489 * Those three items are mandatory for the job to succeed.
490 * @param job Buildservicejob to create on the server
491 */
492 PostJob *createBuildServiceJob(const BuildServiceJob &job);
493
494 /**
495 * Cancel a job.
496 * Setting the ID on the build service parameter is enough for it to work.
497 * @param job Buildservicejob to cancel on the server, needs at least id set.
498 */
499 PostJob *cancelBuildServiceJob(const BuildServiceJob &job);
500
501 /**
502 * Get a list of remote accounts, account for a build service instance
503 * which is stored in the OCS service in order to authenticate with the
504 * build service instance.
505 * @return ListJob listing RemoteAccounts
506 */
507 ListJob<RemoteAccount> *requestRemoteAccounts();
508
509 /**
510 * Deletes a remote account stored on the OCS server.
511 * @param id The ID of the remote account on the OCS instance.
512 */
513 PostJob *deleteRemoteAccount(const QString &id);
514
515 /**
516 * Create a new remote account, an account for a build service instance
517 * which is stored in the OCS service in order to authenticate with the
518 * build service instance.
519 * Type, Type ID, login and password are mandatory.
520 * @param account RemoteAccount to create on the server
521 */
522 PostJob *createRemoteAccount(const RemoteAccount &account);
523
524 /**
525 * Edit an existing remote account.
526 * @param account RemoteAccount to create on the server
527 */
528 PostJob *editRemoteAccount(const RemoteAccount &account);
529
530 /** Get a remote account by its ID.
531 * @param id The ID of the remote account
532 */
533 ItemJob<RemoteAccount> *requestRemoteAccount(const QString &id);
534
535 /** Upload a tarball to the buildservice.
536 * @param projectId The ID of the project this source file belongs to
537 * @param payload A reference to the complete file data
538 * @return A postjob to keep keep track of the upload
539 */
540 Attica::PostJob *uploadTarballToBuildService(const QString &projectId, const QString &fileName, const QByteArray &payload);
541
542 // Content part of OCS
543
544 /**
545 * Get a list of categories (such as wallpaper)
546 * @return the categories of the server
547 */
548 ListJob<Category> *requestCategories();
549
550 /**
551 * Get a list of licenses (such as GPL)
552 * @return the licenses available from the server
553 */
554 ListJob<License> *requestLicenses();
555
556 /**
557 * Get a list of distributions (such as Ark, Debian)
558 * @return the licenses available from the server
559 */
560 ListJob<Distribution> *requestDistributions();
561
562 /**
563 * Get a list of home page types (such as blog, Facebook)
564 * @return the licenses available from the server
565 */
566 ListJob<HomePageType> *requestHomePageTypes();
567
568 /**
569 Request a list of Contents.
570 Note that @p categories is not optional. If left empty, no results will be returned.
571 An empty search string @p search returns the top n items.
572 @param categories categories to search in
573 @param search optional search string (in name/description of the content)
574 @param mode sorting mode
575 @param page request nth page in the list of results
576 @param pageSize requested size of pages when calculating the list of results
577 @return list job for the search results
578 */
580 searchContents(const Category::List &categories, const QString &search = QString(), SortMode mode = Rating, uint page = 0, uint pageSize = 10);
581
582 /**
583 Request a list of Contents.
584 Like @see searchContents, but only contents created by one person.
585 @param person the person-id that created the contents.
586 */
587 ListJob<Content> *searchContentsByPerson(const Category::List &categories,
588 const QString &person,
589 const QString &search = QString(),
590 SortMode mode = Rating,
591 uint page = 0,
592 uint pageSize = 10);
593
594 /**
595 Request a list of Contents. More complete version.
596 Note that @p categories is not optional. If left empty, no results will be returned.
597 An empty search string @p search returns the top n items.
598 @param categories categories to search in
599 @param person the person-id that created the contents
600 @param distributions list of distributions to filter by, if empty no filtering by distribution is done
601 @param licenses list of licenses to filter by, if empty no filtering by license is done
602 @param search optional search string (in name/description of the content)
603 @param mode sorting mode
604 @param page request nth page in the list of results
605 @param pageSize requested size of pages when calculating the list of results
606 @return list job for the search results
607 */
608 ListJob<Content> *searchContents(const Category::List &categories,
609 const QString &person,
610 const Distribution::List &distributions,
611 const License::List &licenses,
612 const QString &search = QString(),
613 SortMode sortMode = Rating,
614 uint page = 0,
615 uint pageSize = 10);
616
617 /**
618 Retrieve a single content.
619 @param contentId the id of the content
620 @return job that retrieves the content object
621 */
622 ItemJob<Content> *requestContent(const QString &contentId);
623
624 ItemJob<DownloadItem> *downloadLink(const QString &contentId, const QString &itemId = QStringLiteral("1"));
625
626 /** Vote for a content item
627 * @param contentId the content which this voting is for
628 * @param rating - the rating, must be between 0 (bad) and 100 (good)
629 * @return the post job for this voting
630 */
631 PostJob *voteForContent(const QString &contentId, uint rating);
632
633 ItemPostJob<Content> *addNewContent(const Category &category, const Content &newContent);
634 ItemPostJob<Content> *editContent(const Category &updatedCategory, const QString &contentId, const Content &updatedContent);
635 PostJob *deleteContent(const QString &contentId);
636
637 PostJob *setDownloadFile(const QString &contentId, const QString &fileName, QIODevice *payload);
638 PostJob *setDownloadFile(const QString &contentId, const QString &fileName, const QByteArray &payload);
639 PostJob *deleteDownloadFile(const QString &contentId);
640
641 /**
642 * Upload an image file as preview for the content
643 * @param contentId
644 * @param previewId each content can have previews with the id 1,2 or 3
645 * @param payload the image file
646 */
647 PostJob *setPreviewImage(const QString &contentId, const QString &previewId, const QString &fileName, const QByteArray &image);
648 PostJob *deletePreviewImage(const QString &contentId, const QString &previewId);
649
650 // KnowledgeBase part of OCS
651
652 ItemJob<KnowledgeBaseEntry> *requestKnowledgeBaseEntry(const QString &id);
653 ListJob<KnowledgeBaseEntry> *searchKnowledgeBase(const Content &content, const QString &search, SortMode, int page, int pageSize);
654
655 // Event part of OCS
656
657 ItemJob<Event> *requestEvent(const QString &id);
658 ListJob<Event> *requestEvent(const QString &country, const QString &search, const QDate &startAt, SortMode mode, int page, int pageSize);
659
660 // Comment part of OCS
661 /** Request a list of comments for a content / forum / knowledgebase / event.
662 * @param comment::Type type of the comment @see Comment::Type (content / forum / knowledgebase / event)
663 * @param id id of the content entry where you want to get the comments is from
664 * @param id2 id of the content entry where you want to get the comments is from
665 * @param page request nth page in the list of results
666 * @param pageSize requested size of pages when calculating the list of results
667 * @return list job for the comments results
668 */
669 ListJob<Comment> *requestComments(const Comment::Type commentType, const QString &id, const QString &id2, int page, int pageSize);
670
671 /** Add a new comment.
672 * @param commentType type of the comment @see CommentType (content / forum / knowledgebase / event)
673 * @param id id of the content entry where you want to get the comments is from
674 * @param id2 id of the sub content entry where you want to get the comments is from
675 * @param parentId the id of the parent comment if the new comment is a reply
676 * @param subject title of the comment
677 * @param message text of the comment
678 * @return item post job for adding the new comment
679 */
680 ItemPostJob<Comment> *addNewComment(const Comment::Type commentType,
681 const QString &id,
682 const QString &id2,
683 const QString &parentId,
684 const QString &subject,
685 const QString &message);
686
687 /** Vote a comment item
688 * @param id the comment id which this voting is for
689 * @param rating the rating, must be between 0 (bad) and 100 (good)
690 * @return the post job for this voting
691 */
692 PostJob *voteForComment(const QString &id, uint rating);
693
694 // Fan part of OCS
695
696 PostJob *becomeFan(const QString &contentId);
697 ListJob<Person> *requestFans(const QString &contentId, uint page = 0, uint pageSize = 10);
698
699 // Forum part of OCS
700 ListJob<Forum> *requestForums(uint page = 0, uint pageSize = 10);
701 ListJob<Topic> *requestTopics(const QString &forum, const QString &search, const QString &description, SortMode mode, int page, int pageSize);
702 PostJob *postTopic(const QString &forumId, const QString &subject, const QString &content);
703
704 const QString &getRegisterAccountUrl() const;
705
706protected:
707 QUrl createUrl(const QString &path);
708 QNetworkRequest createRequest(const QUrl &url);
709 // Convenience overload
710 QNetworkRequest createRequest(const QString &path);
711
712 ItemJob<Config> *doRequestConfig(const QUrl &url);
713 ItemJob<Person> *doRequestPerson(const QUrl &url);
714 ItemJob<AccountBalance> *doRequestAccountBalance(const QUrl &url);
715 ListJob<Person> *doRequestPersonList(const QUrl &url);
716 ListJob<Achievement> *doRequestAchievementList(const QUrl &url);
717 ListJob<Activity> *doRequestActivityList(const QUrl &url);
718 ListJob<Folder> *doRequestFolderList(const QUrl &url);
719 ListJob<Forum> *doRequestForumList(const QUrl &url);
720 ListJob<Topic> *doRequestTopicList(const QUrl &url);
721 ListJob<Message> *doRequestMessageList(const QUrl &url);
722
723private:
724 class Private;
726
727 Provider(PlatformDependent *internals, const QUrl &baseUrl, const QString &name, const QUrl &icon = QUrl());
728 Provider(PlatformDependent *internals,
729 const QUrl &baseUrl,
730 const QString &name,
731 const QUrl &icon,
732 const QString &person,
733 const QString &friendV,
734 const QString &message,
735 const QString &achievements,
736 const QString &activity,
737 const QString &content,
738 const QString &fan,
739 const QString &forum,
740 const QString &knowledgebase,
741 const QString &event,
742 const QString &comment);
743 // kde-SC5: merge with the constructor above (i.e. remove the above one)
744 Provider(PlatformDependent *internals,
745 const QUrl &baseUrl,
746 const QString &name,
747 const QUrl &icon,
748 const QString &person,
749 const QString &friendV,
750 const QString &message,
751 const QString &achievements,
752 const QString &activity,
753 const QString &content,
754 const QString &fan,
755 const QString &forum,
756 const QString &knowledgebase,
757 const QString &event,
758 const QString &comment,
759 const QString &registerUrl);
760 // TODO KF6: merge with the constructor above (i.e. remove the above one - and actually do it this time :P )
761 Provider(PlatformDependent *internals,
762 const QUrl &baseUrl,
763 const QString &name,
764 const QUrl &icon,
765 const QString &person,
766 const QString &friendV,
767 const QString &message,
768 const QString &achievements,
769 const QString &activity,
770 const QString &content,
771 const QString &fan,
772 const QString &forum,
773 const QString &knowledgebase,
774 const QString &event,
775 const QString &comment,
776 const QString &registerUrl,
777 const QString &additionalAgentInformation);
778
779 friend class ProviderManager;
780};
781}
782
783#endif
Represents the money in the account of the user.
Represents an achievement.
Definition achievement.h:28
Represents a single news item (also known as activity)
Definition activity.h:28
Represents the ouput of a build service job.
Represents a build service job.
Represents a build service.
Represents a single content category.
Definition category.h:24
Represents a server config.
Definition config.h:24
Represents a single content.
Definition content.h:33
Represents a delete job.
Definition deletejob.h:26
The Distribution class contains information about one distribution that the server offers.
Represents a download item.
Represents a single event.
Definition event.h:28
Represents a single mail folder.
Definition folder.h:25
The HomePageType class contains information about one home page type.
Represents an item get job.
Definition itemjob.h:30
Represents an item post job.
Definition itemjob.h:66
Represents a knowledge base entry.
The License class contains information about one license that the server offers.
Definition license.h:24
Represents a list job.
Definition listjob.h:28
Represents a message.
Definition message.h:27
Represents a person.
Definition person.h:29
Represents a post job.
Definition postjob.h:30
Represents private data.
Definition privatedata.h:30
Represents a project.
Definition project.h:30
Attica ProviderManager.
The Provider class represents one Open Collaboration Service provider.
Definition provider.h:97
bool hasActivityService() const
Test if the server supports the activity part of the API.
QString name() const
A name for the provider that can be displayed to the user.
Definition provider.cpp:340
QString messageServiceVersion() const
Version of the message part of the API.
QString contentServiceVersion() const
Version of the content part of the API.
QString personServiceVersion() const
Version of the person part of the API.
bool hasCredentials() const
Test if the provider has user name/password available.
Definition provider.cpp:359
QUrl baseUrl() const
A url that identifies this provider.
Definition provider.cpp:302
ItemJob< Config > * requestConfig()
Fetches server config.
Definition provider.cpp:407
QString additionalAgentInformation() const
The custom identifier sent along with requests.
Definition provider.cpp:335
Provider()
Default construct a Provider.
Definition provider.cpp:174
bool hasForumService() const
Test if the server supports the forum part of the API.
bool hasMessageService() const
Test if the server supports the message part of the API.
ItemJob< PrivateData > * requestPrivateData(const QString &app, const QString &key=QString())
Fetches the a given attribute from an OCS-compliant server.
bool saveCredentials(const QString &user, const QString &password)
Sets (and remembers) user name and password for this provider.
Definition provider.cpp:382
bool hasFriendService() const
Test if the server supports the friend part of the API.
bool hasAchievementService() const
Test if the server supports the achievement part of the API.
bool loadCredentials(QString &user, QString &password)
Load user name and password from the store.
Definition provider.cpp:368
QString fanServiceVersion() const
Version of the fan part of the API.
QString achievementServiceVersion() const
Version of the achievement part of the API.
bool isEnabled() const
Test if the provider is enabled by the settings.
Definition provider.cpp:312
QString knowledgebaseServiceVersion() const
Version of the knowledgebase part of the API.
bool hasCommentService() const
Test if the server supports the comments part of the API.
QString forumServiceVersion() const
Version of the forum part of the API.
PostJob * checkLogin(const QString &user, const QString &password)
Test if the server accepts the login/password.
Definition provider.cpp:393
void setAdditionalAgentInformation(const QString &additionalInformation)
Set a custom identifier for your application (sent along with the requests as the http agent header i...
Definition provider.cpp:330
bool hasContentService() const
Test if the server supports the content part of the API.
bool isValid() const
Returns true if the provider has been set up and can be used.
Definition provider.cpp:307
bool hasPersonService() const
Test if the server supports the person part of the API.
ItemJob< PrivateData > * requestPrivateData()
Fetches all stored private data.
Definition provider.h:329
QString friendServiceVersion() const
Version of the friend part of the API.
QString commentServiceVersion() const
Version of the comments part of the API.
bool hasKnowledgebaseService() const
Test if the server supports the knowledgebase part of the API.
bool hasFanService() const
Test if the server supports the fan part of the API.
QString activityServiceVersion() const
Version of the activity part of the API.
QUrl icon() const
An icon used to visually identify this provider.
Definition provider.cpp:345
Represents a publisher field.
Represents a publisher.
Definition publisher.h:44
Represents a put job.
Definition putjob.h:30
Represents a remote account.
Q_SCRIPTABLE CaptureState status()
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:04 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.