Attica::Provider

Search for usage in LXR

#include <Attica/Provider>

Public Types

enum  SortMode { Newest , Alphabetical , Rating , Downloads }
 

Public Member Functions

 Provider ()
 
 Provider (const Provider &other)
 
QString achievementServiceVersion () const
 
QString activityServiceVersion () const
 
QString additionalAgentInformation () const
 
ItemPostJob< Achievement > * addNewAchievement (const QString &id, const Achievement &newAchievement)
 
ItemPostJob< Comment > * addNewComment (const Comment::Type commentType, const QString &id, const QString &id2, const QString &parentId, const QString &subject, const QString &message)
 
ItemPostJob< Content > * addNewContent (const Category &category, const Content &newContent)
 
PostJobapproveFriendship (const QString &to)
 
QUrl baseUrl () const
 
PostJobbecomeFan (const QString &contentId)
 
PostJobcancelBuildServiceJob (const BuildServiceJob &job)
 
PostJobcancelFriendship (const QString &to)
 
PostJobcheckLogin (const QString &user, const QString &password)
 
QString commentServiceVersion () const
 
QString contentServiceVersion () const
 
PostJobcreateBuildServiceJob (const BuildServiceJob &job)
 
PostJobcreateProject (const Project &project)
 
PostJobcreateRemoteAccount (const RemoteAccount &account)
 
PostJobdeclineFriendship (const QString &to)
 
DeleteJobdeleteAchievement (const QString &contentId, const QString &achievementId)
 
PostJobdeleteContent (const QString &contentId)
 
PostJobdeleteDownloadFile (const QString &contentId)
 
PostJobdeletePreviewImage (const QString &contentId, const QString &previewId)
 
PostJobdeleteProject (const Project &project)
 
PostJobdeleteRemoteAccount (const QString &id)
 
ItemJob< DownloadItem > * downloadLink (const QString &contentId, const QString &itemId=QStringLiteral("1"))
 
PutJobeditAchievement (const QString &contentId, const QString &achievementId, const Achievement &achievement)
 
ItemPostJob< Content > * editContent (const Category &updatedCategory, const QString &contentId, const Content &updatedContent)
 
PostJobeditProject (const Project &project)
 
PostJobeditRemoteAccount (const RemoteAccount &account)
 
QString fanServiceVersion () const
 
QString forumServiceVersion () const
 
QString friendServiceVersion () const
 
const QStringgetRegisterAccountUrl () const
 
bool hasAchievementService () const
 
bool hasActivityService () const
 
bool hasCommentService () const
 
bool hasContentService () const
 
bool hasCredentials ()
 
bool hasCredentials () const
 
bool hasFanService () const
 
bool hasForumService () const
 
bool hasFriendService () const
 
bool hasKnowledgebaseService () const
 
bool hasMessageService () const
 
bool hasPersonService () const
 
QUrl icon () const
 
PostJobinviteFriend (const QString &to, const QString &message)
 
bool isEnabled () const
 
bool isValid () const
 
QString knowledgebaseServiceVersion () const
 
bool loadCredentials (QString &user, QString &password)
 
QString messageServiceVersion () const
 
QString name () const
 
Provideroperator= (const Provider &other)
 
QString personServiceVersion () const
 
PostJobpostActivity (const QString &message)
 
PostJobpostLocation (qreal latitude, qreal longitude, const QString &city=QString(), const QString &country=QString())
 
PostJobpostMessage (const Message &message)
 
PostJobpostTopic (const QString &forumId, const QString &subject, const QString &content)
 
PostJobpublishBuildJob (const BuildServiceJob &buildjob, const Publisher &publisher)
 
PostJobregisterAccount (const QString &id, const QString &password, const QString &mail, const QString &firstName, const QString &lastName)
 
ItemJob< AccountBalance > * requestAccountBalance ()
 
ListJob< Achievement > * requestAchievements (const QString &contentId, const QString &achievementId, const QString &userId)
 
ListJob< Activity > * requestActivities ()
 
ItemJob< BuildService > * requestBuildService (const QString &id)
 
ItemJob< BuildServiceJob > * requestBuildServiceJob (const QString &id)
 
ItemJob< BuildServiceJobOutput > * requestBuildServiceJobOutput (const QString &id)
 
ListJob< BuildServiceJob > * requestBuildServiceJobs (const Project &project)
 
ListJob< BuildService > * requestBuildServices ()
 
ListJob< Category > * requestCategories ()
 
ListJob< Comment > * requestComments (const Comment::Type commentType, const QString &id, const QString &id2, int page, int pageSize)
 
ItemJob< Config > * requestConfig ()
 
ItemJob< Content > * requestContent (const QString &contentId)
 
ListJob< Distribution > * requestDistributions ()
 
ListJob< Event > * requestEvent (const QString &country, const QString &search, const QDate &startAt, SortMode mode, int page, int pageSize)
 
ItemJob< Event > * requestEvent (const QString &id)
 
ListJob< Person > * requestFans (const QString &contentId, uint page=0, uint pageSize=10)
 
ListJob< Folder > * requestFolders ()
 
ListJob< Forum > * requestForums (uint page=0, uint pageSize=10)
 
ListJob< Person > * requestFriends (const QString &id, int page=0, int pageSize=20)
 
ListJob< HomePageType > * requestHomePageTypes ()
 
ItemJob< KnowledgeBaseEntry > * requestKnowledgeBaseEntry (const QString &id)
 
ListJob< License > * requestLicenses ()
 
ItemJob< Message > * requestMessage (const Folder &folder, const QString &id)
 
ListJob< Message > * requestMessages (const Folder &folder)
 
ListJob< Message > * requestMessages (const Folder &folder, Message::Status status)
 
ItemJob< Person > * requestPerson (const QString &id)
 
ListJob< Person > * requestPersonSearchByLocation (qreal latitude, qreal longitude, qreal distance=0.0, int page=0, int pageSize=20)
 
ListJob< Person > * requestPersonSearchByName (const QString &name)
 
ItemJob< Person > * requestPersonSelf ()
 
ItemJob< PrivateData > * requestPrivateData ()
 
ItemJob< PrivateData > * requestPrivateData (const QString &app, const QString &key=QString())
 
ItemJob< Project > * requestProject (const QString &id)
 
ListJob< Project > * requestProjects ()
 
ItemJob< Publisher > * requestPublisher (const QString &id)
 
ListJob< Publisher > * requestPublishers ()
 
ListJob< Person > * requestReceivedInvitations (int page=0, int pageSize=20)
 
ItemJob< RemoteAccount > * requestRemoteAccount (const QString &id)
 
ListJob< RemoteAccount > * requestRemoteAccounts ()
 
ListJob< Person > * requestSentInvitations (int page=0, int pageSize=20)
 
ListJob< Topic > * requestTopics (const QString &forum, const QString &search, const QString &description, SortMode mode, int page, int pageSize)
 
DeleteJobresetAchievementProgress (const QString &id)
 
bool saveCredentials (const QString &user, const QString &password)
 
PostJobsavePublisherField (const Project &project, const PublisherField &field)
 
ListJob< Content > * searchContents (const Category::List &categories, const QString &person, const Distribution::List &distributions, const License::List &licenses, const QString &search=QString(), SortMode sortMode=Rating, uint page=0, uint pageSize=10)
 
ListJob< Content > * searchContents (const Category::List &categories, const QString &search=QString(), SortMode mode=Rating, uint page=0, uint pageSize=10)
 
ListJob< Content > * searchContentsByPerson (const Category::List &categories, const QString &person, const QString &search=QString(), SortMode mode=Rating, uint page=0, uint pageSize=10)
 
ListJob< KnowledgeBaseEntry > * searchKnowledgeBase (const Content &content, const QString &search, SortMode, int page, int pageSize)
 
PostJobsetAchievementProgress (const QString &id, const QVariant &progress, const QDateTime &timestamp)
 
void setAdditionalAgentInformation (const QString &additionalInformation)
 
PostJobsetDownloadFile (const QString &contentId, const QString &fileName, const QByteArray &payload)
 
PostJobsetDownloadFile (const QString &contentId, const QString &fileName, QIODevice *payload)
 
void setEnabled (bool enabled)
 
PostJobsetPreviewImage (const QString &contentId, const QString &previewId, const QString &fileName, const QByteArray &image)
 
PostJobsetPrivateData (const QString &app, const QString &key, const QString &value)
 
Attica::PostJobuploadTarballToBuildService (const QString &projectId, const QString &fileName, const QByteArray &payload)
 
PostJobvoteForComment (const QString &id, uint rating)
 
PostJobvoteForContent (const QString &contentId, uint rating)
 

Protected Member Functions

QNetworkRequest createRequest (const QString &path)
 
QNetworkRequest createRequest (const QUrl &url)
 
QUrl createUrl (const QString &path)
 
ItemJob< AccountBalance > * doRequestAccountBalance (const QUrl &url)
 
ListJob< Achievement > * doRequestAchievementList (const QUrl &url)
 
ListJob< Activity > * doRequestActivityList (const QUrl &url)
 
ItemJob< Config > * doRequestConfig (const QUrl &url)
 
ListJob< Folder > * doRequestFolderList (const QUrl &url)
 
ListJob< Forum > * doRequestForumList (const QUrl &url)
 
ListJob< Message > * doRequestMessageList (const QUrl &url)
 
ItemJob< Person > * doRequestPerson (const QUrl &url)
 
ListJob< Person > * doRequestPersonList (const QUrl &url)
 
ListJob< Topic > * doRequestTopicList (const QUrl &url)
 

Detailed Description

The Provider class represents one Open Collaboration Service provider.

Use the ProviderManager to instantiate a Provider.

Accessing functions of the Provider returns a Job class that takes care of accessing the server and parsing the result.

Provider files are xml of the form:

 <provider>
 <id>opendesktop</id>
 <location>https://api.opendesktop.org/v1/</location>
 <name>openDesktop.org</name>
 <icon></icon>
 <termsofuse>https://opendesktop.org/terms/</termsofuse>
 <register>https://opendesktop.org/usermanager/new.php</register>
 <services>
   <person ocsversion="1.3" >
   <friend ocsversion="1.3" >
   <message ocsversion="1.3" >
   <activity ocsversion="1.3" >
   <content ocsversion="1.3" >
   <fan ocsversion="1.3" >
   <knowledgebase ocsversion="1.3" >
   <event ocsversion="1.3" >
   <comment ocsversion="1.2" >
 </services>
</provider>
 

The server provides the services specified in the services section, not necessarily all of them.

Definition at line 96 of file provider.h.

Member Enumeration Documentation

◆ SortMode

enum Attica::Provider::SortMode

Definition at line 164 of file provider.h.

Constructor & Destructor Documentation

◆ Provider() [1/2]

Provider::Provider ( )

Default construct a Provider.

Please note that this provider is incomplete and never valid.

Definition at line 174 of file provider.cpp.

◆ Provider() [2/2]

Provider::Provider ( const Provider & other)

Definition at line 179 of file provider.cpp.

◆ ~Provider()

Provider::~Provider ( )

Definition at line 298 of file provider.cpp.

Member Function Documentation

◆ achievementServiceVersion()

QString Provider::achievementServiceVersion ( ) const

Version of the achievement part of the API.

Definition at line 1776 of file provider.cpp.

◆ activityServiceVersion()

QString Provider::activityServiceVersion ( ) const

Version of the activity part of the API.

Definition at line 1781 of file provider.cpp.

◆ additionalAgentInformation()

QString Provider::additionalAgentInformation ( ) const

The custom identifier sent along with requests.

Returns
The custom identifier
See also
setAdditionalAgentInformation(const QString&)
Since
5.66

Definition at line 335 of file provider.cpp.

◆ addNewAchievement()

ItemPostJob< Achievement > * Provider::addNewAchievement ( const QString & id,
const Achievement & newAchievement )

Add a new achievement.

Parameters
idid of the achievement entry
achievementThe new Achievement added
Returns
item post job for adding the new achievement

Definition at line 560 of file provider.cpp.

◆ addNewComment()

ItemPostJob< Comment > * Provider::addNewComment ( const Comment::Type commentType,
const QString & id,
const QString & id2,
const QString & parentId,
const QString & subject,
const QString & message )

Add a new comment.

Parameters
commentTypetype of the comment
See also
CommentType (content / forum / knowledgebase / event)
Parameters
idid of the content entry where you want to get the comments is from
id2id of the sub content entry where you want to get the comments is from
parentIdthe id of the parent comment if the new comment is a reply
subjecttitle of the comment
messagetext of the comment
Returns
item post job for adding the new comment

Definition at line 1625 of file provider.cpp.

◆ addNewContent()

ItemPostJob< Content > * Provider::addNewContent ( const Category & category,
const Content & newContent )

Definition at line 1265 of file provider.cpp.

◆ approveFriendship()

PostJob * Provider::approveFriendship ( const QString & to)

Definition at line 1028 of file provider.cpp.

◆ baseUrl()

QUrl Provider::baseUrl ( ) const

A url that identifies this provider.

This should be used as identifier when referring to this provider but you don't want to use the full provider object.

Definition at line 302 of file provider.cpp.

◆ becomeFan()

PostJob * Provider::becomeFan ( const QString & contentId)

Definition at line 1398 of file provider.cpp.

◆ cancelBuildServiceJob()

PostJob * Provider::cancelBuildServiceJob ( const BuildServiceJob & job)

Cancel a job.

Setting the ID on the build service parameter is enough for it to work.

Parameters
jobBuildservicejob to cancel on the server, needs at least id set.

Definition at line 858 of file provider.cpp.

◆ cancelFriendship()

PostJob * Provider::cancelFriendship ( const QString & to)

Definition at line 1046 of file provider.cpp.

◆ checkLogin()

PostJob * Provider::checkLogin ( const QString & user,
const QString & password )

Test if the server accepts the login/password.

This function does not actually set the credentials. Use saveCredentials for that purpose.

Parameters
userthe user (login) name
passwordthe password
Returns
the job that will contain the success of the login as metadata

Definition at line 393 of file provider.cpp.

◆ commentServiceVersion()

QString Provider::commentServiceVersion ( ) const

Version of the comments part of the API.

Definition at line 1785 of file provider.cpp.

◆ contentServiceVersion()

QString Provider::contentServiceVersion ( ) const

Version of the content part of the API.

Definition at line 1789 of file provider.cpp.

◆ createBuildServiceJob()

PostJob * Provider::createBuildServiceJob ( const BuildServiceJob & job)

Create a new job for a given project on a given buildservice for a given target.

Those three items are mandatory for the job to succeed.

Parameters
jobBuildservicejob to create on the server

Definition at line 870 of file provider.cpp.

◆ createProject()

PostJob * Provider::createProject ( const Project & project)

Post modifications to a Project on the server.

The resulting project ID can be found in the Attica::MetaData of the finished() PostJob. You can retrieve it using Attica::MetaData::resultingProjectId().

Parameters
projectProject to create on the server

Definition at line 737 of file provider.cpp.

◆ createRemoteAccount()

PostJob * Provider::createRemoteAccount ( const RemoteAccount & account)

Create a new remote account, an account for a build service instance which is stored in the OCS service in order to authenticate with the build service instance.

Type, Type ID, login and password are mandatory.

Parameters
accountRemoteAccount to create on the server

Definition at line 932 of file provider.cpp.

◆ createRequest() [1/2]

QNetworkRequest Provider::createRequest ( const QString & path)
protected

Definition at line 1721 of file provider.cpp.

◆ createRequest() [2/2]

QNetworkRequest Provider::createRequest ( const QUrl & url)
protected

Definition at line 1698 of file provider.cpp.

◆ createUrl()

QUrl Provider::createUrl ( const QString & path)
protected

Definition at line 1692 of file provider.cpp.

◆ declineFriendship()

PostJob * Provider::declineFriendship ( const QString & to)

Definition at line 1037 of file provider.cpp.

◆ deleteAchievement()

DeleteJob * Provider::deleteAchievement ( const QString & contentId,
const QString & achievementId )

Deletes an achievement on the server.

The achievement passed as an argument doesn't need complete information as just the id() is used.

Parameters
achievementAchievement to delete on the server.

Definition at line 628 of file provider.cpp.

◆ deleteContent()

PostJob * Provider::deleteContent ( const QString & contentId)

Definition at line 1312 of file provider.cpp.

◆ deleteDownloadFile()

PostJob * Provider::deleteDownloadFile ( const QString & contentId)

Definition at line 1338 of file provider.cpp.

◆ deletePreviewImage()

PostJob * Provider::deletePreviewImage ( const QString & contentId,
const QString & previewId )

Definition at line 1367 of file provider.cpp.

◆ deleteProject()

PostJob * Provider::deleteProject ( const Project & project)

Deletes a project on the server.

The project passed as an argument doesn't need complete information as just the id() is used.

Parameters
projectProject to delete on the server.

Definition at line 755 of file provider.cpp.

◆ deleteRemoteAccount()

PostJob * Provider::deleteRemoteAccount ( const QString & id)

Deletes a remote account stored on the OCS server.

Parameters
idThe ID of the remote account on the OCS instance.

Definition at line 981 of file provider.cpp.

◆ doRequestAccountBalance()

ItemJob< AccountBalance > * Provider::doRequestAccountBalance ( const QUrl & url)
protected

Definition at line 1736 of file provider.cpp.

◆ doRequestAchievementList()

ListJob< Achievement > * Provider::doRequestAchievementList ( const QUrl & url)
protected

Definition at line 1746 of file provider.cpp.

◆ doRequestActivityList()

ListJob< Activity > * Provider::doRequestActivityList ( const QUrl & url)
protected

Definition at line 1751 of file provider.cpp.

◆ doRequestConfig()

ItemJob< Config > * Provider::doRequestConfig ( const QUrl & url)
protected

Definition at line 1726 of file provider.cpp.

◆ doRequestFolderList()

ListJob< Folder > * Provider::doRequestFolderList ( const QUrl & url)
protected

Definition at line 1756 of file provider.cpp.

◆ doRequestForumList()

ListJob< Forum > * Provider::doRequestForumList ( const QUrl & url)
protected

Definition at line 1761 of file provider.cpp.

◆ doRequestMessageList()

ListJob< Message > * Provider::doRequestMessageList ( const QUrl & url)
protected

Definition at line 1771 of file provider.cpp.

◆ doRequestPerson()

ItemJob< Person > * Provider::doRequestPerson ( const QUrl & url)
protected

Definition at line 1731 of file provider.cpp.

◆ doRequestPersonList()

ListJob< Person > * Provider::doRequestPersonList ( const QUrl & url)
protected

Definition at line 1741 of file provider.cpp.

◆ doRequestTopicList()

ListJob< Topic > * Provider::doRequestTopicList ( const QUrl & url)
protected

Definition at line 1766 of file provider.cpp.

◆ downloadLink()

ItemJob< DownloadItem > * Provider::downloadLink ( const QString & contentId,
const QString & itemId = QStringLiteral("1") )

Definition at line 1487 of file provider.cpp.

◆ editAchievement()

PutJob * Provider::editAchievement ( const QString & contentId,
const QString & achievementId,
const Achievement & achievement )

Post modifications to an Achievement on the server.

Parameters
achievementAchievement to update on the server

Definition at line 592 of file provider.cpp.

◆ editContent()

ItemPostJob< Content > * Provider::editContent ( const Category & updatedCategory,
const QString & contentId,
const Content & updatedContent )

Definition at line 1282 of file provider.cpp.

◆ editProject()

PostJob * Provider::editProject ( const Project & project)

Post modifications to a Project on the server.

Parameters
projectProject to update on the server

Definition at line 746 of file provider.cpp.

◆ editRemoteAccount()

PostJob * Provider::editRemoteAccount ( const RemoteAccount & account)

Edit an existing remote account.

Parameters
accountRemoteAccount to create on the server

Definition at line 951 of file provider.cpp.

◆ fanServiceVersion()

QString Provider::fanServiceVersion ( ) const

Version of the fan part of the API.

Definition at line 1793 of file provider.cpp.

◆ forumServiceVersion()

QString Provider::forumServiceVersion ( ) const

Version of the forum part of the API.

Definition at line 1797 of file provider.cpp.

◆ friendServiceVersion()

QString Provider::friendServiceVersion ( ) const

Version of the friend part of the API.

Definition at line 1801 of file provider.cpp.

◆ getRegisterAccountUrl()

const QString & Provider::getRegisterAccountUrl ( ) const

Definition at line 434 of file provider.cpp.

◆ hasAchievementService()

bool Provider::hasAchievementService ( ) const

Test if the server supports the achievement part of the API.

Definition at line 1818 of file provider.cpp.

◆ hasActivityService()

bool Provider::hasActivityService ( ) const

Test if the server supports the activity part of the API.

Definition at line 1823 of file provider.cpp.

◆ hasCommentService()

bool Provider::hasCommentService ( ) const

Test if the server supports the comments part of the API.

Definition at line 1827 of file provider.cpp.

◆ hasContentService()

bool Provider::hasContentService ( ) const

Test if the server supports the content part of the API.

Definition at line 1831 of file provider.cpp.

◆ hasCredentials() [1/2]

bool Provider::hasCredentials ( )

Definition at line 350 of file provider.cpp.

◆ hasCredentials() [2/2]

bool Provider::hasCredentials ( ) const

Test if the provider has user name/password available.

This does not yet open kwallet in case the KDE plugin is used.

Returns
true if the provider has login information

Definition at line 359 of file provider.cpp.

◆ hasFanService()

bool Provider::hasFanService ( ) const

Test if the server supports the fan part of the API.

Definition at line 1835 of file provider.cpp.

◆ hasForumService()

bool Provider::hasForumService ( ) const

Test if the server supports the forum part of the API.

Definition at line 1839 of file provider.cpp.

◆ hasFriendService()

bool Provider::hasFriendService ( ) const

Test if the server supports the friend part of the API.

Definition at line 1843 of file provider.cpp.

◆ hasKnowledgebaseService()

bool Provider::hasKnowledgebaseService ( ) const

Test if the server supports the knowledgebase part of the API.

Definition at line 1847 of file provider.cpp.

◆ hasMessageService()

bool Provider::hasMessageService ( ) const

Test if the server supports the message part of the API.

Definition at line 1851 of file provider.cpp.

◆ hasPersonService()

bool Provider::hasPersonService ( ) const

Test if the server supports the person part of the API.

Definition at line 1855 of file provider.cpp.

◆ icon()

QUrl Attica::Provider::icon ( ) const

An icon used to visually identify this provider.

Returns
A URL for an icon image (or an invalid URL if one was not defined by the provider)
Since
5.85

Definition at line 345 of file provider.cpp.

◆ inviteFriend()

PostJob * Provider::inviteFriend ( const QString & to,
const QString & message )

Definition at line 1017 of file provider.cpp.

◆ isEnabled()

bool Provider::isEnabled ( ) const

Test if the provider is enabled by the settings.

The application can choose to ignore this, but the user settings should be respected.

Definition at line 312 of file provider.cpp.

◆ isValid()

bool Provider::isValid ( ) const

Returns true if the provider has been set up and can be used.

Definition at line 307 of file provider.cpp.

◆ knowledgebaseServiceVersion()

QString Provider::knowledgebaseServiceVersion ( ) const

Version of the knowledgebase part of the API.

Definition at line 1805 of file provider.cpp.

◆ loadCredentials()

bool Provider::loadCredentials ( QString & user,
QString & password )

Load user name and password from the store.

Attica will remember the loaded values and use them from this point on.

Parameters
userreference that returns the user name
passwordreference that returns the password
Returns
if credentials could be loaded

Definition at line 368 of file provider.cpp.

◆ messageServiceVersion()

QString Provider::messageServiceVersion ( ) const

Version of the message part of the API.

Definition at line 1809 of file provider.cpp.

◆ name()

QString Provider::name ( ) const

A name for the provider that can be displayed to the user.

Definition at line 340 of file provider.cpp.

◆ operator=()

Provider & Provider::operator= ( const Provider & other)

Definition at line 292 of file provider.cpp.

◆ personServiceVersion()

QString Provider::personServiceVersion ( ) const

Version of the person part of the API.

Definition at line 1813 of file provider.cpp.

◆ postActivity()

PostJob * Provider::postActivity ( const QString & message)

Definition at line 1006 of file provider.cpp.

◆ postLocation()

PostJob * Provider::postLocation ( qreal latitude,
qreal longitude,
const QString & city = QString(),
const QString & country = QString() )

Definition at line 1055 of file provider.cpp.

◆ postMessage()

PostJob * Provider::postMessage ( const Message & message)

Definition at line 1109 of file provider.cpp.

◆ postTopic()

PostJob * Provider::postTopic ( const QString & forumId,
const QString & subject,
const QString & content )

Definition at line 1474 of file provider.cpp.

◆ publishBuildJob()

PostJob * Provider::publishBuildJob ( const BuildServiceJob & buildjob,
const Publisher & publisher )

Publish the result of a completed build job to a publisher.

Returns
ItemJob receiving data

Definition at line 801 of file provider.cpp.

◆ registerAccount()

PostJob * Provider::registerAccount ( const QString & id,
const QString & password,
const QString & mail,
const QString & firstName,
const QString & lastName )

Definition at line 417 of file provider.cpp.

◆ requestAccountBalance()

ItemJob< AccountBalance > * Provider::requestAccountBalance ( )

Definition at line 459 of file provider.cpp.

◆ requestAchievements()

ListJob< Achievement > * Provider::requestAchievements ( const QString & contentId,
const QString & achievementId,
const QString & userId )

Get a list of achievements.

Returns
ListJob listing Achievements

Definition at line 547 of file provider.cpp.

◆ requestActivities()

ListJob< Activity > * Provider::requestActivities ( )

Definition at line 668 of file provider.cpp.

◆ requestBuildService()

ItemJob< BuildService > * Provider::requestBuildService ( const QString & id)

Get the information for a specific build service instance.

Returns
ItemJob receiving data

Definition at line 764 of file provider.cpp.

◆ requestBuildServiceJob()

ItemJob< BuildServiceJob > * Provider::requestBuildServiceJob ( const QString & id)

Get the information for a specific build service job, such as status and progress.

Returns
ItemJob receiving and containing the data

Definition at line 827 of file provider.cpp.

◆ requestBuildServiceJobOutput()

ItemJob< BuildServiceJobOutput > * Provider::requestBuildServiceJobOutput ( const QString & id)

Get the build output for a specific build service job.

Returns
ItemJob receiving and containing the output data

Definition at line 816 of file provider.cpp.

◆ requestBuildServiceJobs()

ListJob< BuildServiceJob > * Provider::requestBuildServiceJobs ( const Project & project)

Get a list of build service projects.

Returns
ListJob listing BuildServiceJobs

Definition at line 910 of file provider.cpp.

◆ requestBuildServices()

ListJob< BuildService > * Provider::requestBuildServices ( )

Get a list of build service build services.

Returns
ListJob listing BuildServices

Definition at line 888 of file provider.cpp.

◆ requestCategories()

ListJob< Category > * Provider::requestCategories ( )

Get a list of categories (such as wallpaper)

Returns
the categories of the server

Definition at line 1122 of file provider.cpp.

◆ requestComments()

ListJob< Comment > * Provider::requestComments ( const Comment::Type commentType,
const QString & id,
const QString & id2,
int page,
int pageSize )

Request a list of comments for a content / forum / knowledgebase / event.

Parameters
comment::Typetype of the comment
See also
Comment::Type (content / forum / knowledgebase / event)
Parameters
idid of the content entry where you want to get the comments is from
id2id of the content entry where you want to get the comments is from
pagerequest nth page in the list of results
pageSizerequested size of pages when calculating the list of results
Returns
list job for the comments results

Definition at line 1602 of file provider.cpp.

◆ requestConfig()

ItemJob< Config > * Provider::requestConfig ( )

Fetches server config.

Returns
The job responsible for fetching data

Definition at line 407 of file provider.cpp.

◆ requestContent()

ItemJob< Content > * Provider::requestContent ( const QString & contentId)

Retrieve a single content.

Parameters
contentIdthe id of the content
Returns
job that retrieves the content object

Definition at line 1254 of file provider.cpp.

◆ requestDistributions()

ListJob< Distribution > * Provider::requestDistributions ( )

Get a list of distributions (such as Ark, Debian)

Returns
the licenses available from the server

Definition at line 1154 of file provider.cpp.

◆ requestEvent() [1/2]

ListJob< Event > * Provider::requestEvent ( const QString & country,
const QString & search,
const QDate & startAt,
Provider::SortMode mode,
int page,
int pageSize )

Definition at line 1560 of file provider.cpp.

◆ requestEvent() [2/2]

ItemJob< Event > * Provider::requestEvent ( const QString & id)

Definition at line 1550 of file provider.cpp.

◆ requestFans()

ListJob< Person > * Provider::requestFans ( const QString & contentId,
uint page = 0,
uint pageSize = 10 )

Definition at line 1410 of file provider.cpp.

◆ requestFolders()

ListJob< Folder > * Provider::requestFolders ( )

Definition at line 1069 of file provider.cpp.

◆ requestForums()

ListJob< Forum > * Provider::requestForums ( uint page = 0,
uint pageSize = 10 )

Definition at line 1426 of file provider.cpp.

◆ requestFriends()

ListJob< Person > * Provider::requestFriends ( const QString & id,
int page = 0,
int pageSize = 20 )

Definition at line 502 of file provider.cpp.

◆ requestHomePageTypes()

ListJob< HomePageType > * Provider::requestHomePageTypes ( )

Get a list of home page types (such as blog, Facebook)

Returns
the licenses available from the server

Definition at line 1165 of file provider.cpp.

◆ requestKnowledgeBaseEntry()

ItemJob< KnowledgeBaseEntry > * Provider::requestKnowledgeBaseEntry ( const QString & id)

Definition at line 1498 of file provider.cpp.

◆ requestLicenses()

ListJob< License > * Provider::requestLicenses ( )

Get a list of licenses (such as GPL)

Returns
the licenses available from the server

Definition at line 1143 of file provider.cpp.

◆ requestMessage()

ItemJob< Message > * Provider::requestMessage ( const Folder & folder,
const QString & id )

Definition at line 1100 of file provider.cpp.

◆ requestMessages() [1/2]

ListJob< Message > * Provider::requestMessages ( const Folder & folder)

Definition at line 1078 of file provider.cpp.

◆ requestMessages() [2/2]

ListJob< Message > * Provider::requestMessages ( const Folder & folder,
Message::Status status )

Definition at line 1087 of file provider.cpp.

◆ requestPerson()

ItemJob< Person > * Provider::requestPerson ( const QString & id)

Definition at line 439 of file provider.cpp.

◆ requestPersonSearchByLocation()

ListJob< Person > * Provider::requestPersonSearchByLocation ( qreal latitude,
qreal longitude,
qreal distance = 0.0,
int page = 0,
int pageSize = 20 )

Definition at line 482 of file provider.cpp.

◆ requestPersonSearchByName()

ListJob< Person > * Provider::requestPersonSearchByName ( const QString & name)

Definition at line 469 of file provider.cpp.

◆ requestPersonSelf()

ItemJob< Person > * Provider::requestPersonSelf ( )

Definition at line 449 of file provider.cpp.

◆ requestPrivateData() [1/2]

ItemJob< PrivateData > * Attica::Provider::requestPrivateData ( )
inline

Fetches all stored private data.

Returns
The job responsible for fetching data

Definition at line 329 of file provider.h.

◆ requestPrivateData() [2/2]

ItemJob< PrivateData > * Provider::requestPrivateData ( const QString & app,
const QString & key = QString() )

Fetches the a given attribute from an OCS-compliant server.

Parameters
appThe application name
keyThe key of the attribute to fetch (optional)
Returns
The job that is responsible for fetching the data

Definition at line 1681 of file provider.cpp.

◆ requestProject()

ItemJob< Project > * Provider::requestProject ( const QString & id)

Get a Project's data.

Returns
ItemJob receiving data

Definition at line 690 of file provider.cpp.

◆ requestProjects()

ListJob< Project > * Provider::requestProjects ( )

Get a list of build service projects.

Returns
ListJob listing Projects

Definition at line 679 of file provider.cpp.

◆ requestPublisher()

ItemJob< Publisher > * Provider::requestPublisher ( const QString & id)

Get the information for a specific publisher.

Returns
ItemJob receiving data

Definition at line 774 of file provider.cpp.

◆ requestPublishers()

ListJob< Publisher > * Provider::requestPublishers ( )

Get a list of publishers.

Returns
ListJob listing Publishers

Definition at line 899 of file provider.cpp.

◆ requestReceivedInvitations()

ListJob< Person > * Provider::requestReceivedInvitations ( int page = 0,
int pageSize = 20 )

Definition at line 532 of file provider.cpp.

◆ requestRemoteAccount()

ItemJob< RemoteAccount > * Provider::requestRemoteAccount ( const QString & id)

Get a remote account by its ID.

Parameters
idThe ID of the remote account

Definition at line 970 of file provider.cpp.

◆ requestRemoteAccounts()

ListJob< RemoteAccount > * Provider::requestRemoteAccounts ( )

Get a list of remote accounts, account for a build service instance which is stored in the OCS service in order to authenticate with the build service instance.

Returns
ListJob listing RemoteAccounts

Definition at line 921 of file provider.cpp.

◆ requestSentInvitations()

ListJob< Person > * Provider::requestSentInvitations ( int page = 0,
int pageSize = 20 )

Definition at line 517 of file provider.cpp.

◆ requestTopics()

ListJob< Topic > * Provider::requestTopics ( const QString & forum,
const QString & search,
const QString & description,
Provider::SortMode mode,
int page,
int pageSize )

Definition at line 1442 of file provider.cpp.

◆ resetAchievementProgress()

DeleteJob * Provider::resetAchievementProgress ( const QString & id)

Definition at line 655 of file provider.cpp.

◆ saveCredentials()

bool Provider::saveCredentials ( const QString & user,
const QString & password )

Sets (and remembers) user name and password for this provider.

To remove the data an empty username should be passed.

Parameters
userthe user (login) name
passwordthe password
Returns
if credentials could be saved

Definition at line 382 of file provider.cpp.

◆ savePublisherField()

PostJob * Provider::savePublisherField ( const Project & project,
const PublisherField & field )

Save the value of a single publishing field.

Returns
PostJob*

Definition at line 785 of file provider.cpp.

◆ searchContents() [1/2]

ListJob< Content > * Provider::searchContents ( const Category::List & categories,
const QString & person,
const Distribution::List & distributions,
const License::List & licenses,
const QString & search = QString(),
SortMode sortMode = Rating,
uint page = 0,
uint pageSize = 10 )

Request a list of Contents.

More complete version. Note that categories is not optional. If left empty, no results will be returned. An empty search string search returns the top n items.

Parameters
categoriescategories to search in
personthe person-id that created the contents
distributionslist of distributions to filter by, if empty no filtering by distribution is done
licenseslist of licenses to filter by, if empty no filtering by license is done
searchoptional search string (in name/description of the content)
modesorting mode
pagerequest nth page in the list of results
pageSizerequested size of pages when calculating the list of results
Returns
list job for the search results

Definition at line 1187 of file provider.cpp.

◆ searchContents() [2/2]

ListJob< Content > * Provider::searchContents ( const Category::List & categories,
const QString & search = QString(),
SortMode mode = Rating,
uint page = 0,
uint pageSize = 10 )

Request a list of Contents.

Note that categories is not optional. If left empty, no results will be returned. An empty search string search returns the top n items.

Parameters
categoriescategories to search in
searchoptional search string (in name/description of the content)
modesorting mode
pagerequest nth page in the list of results
pageSizerequested size of pages when calculating the list of results
Returns
list job for the search results

Definition at line 1176 of file provider.cpp.

◆ searchContentsByPerson()

ListJob< Content > * Provider::searchContentsByPerson ( const Category::List & categories,
const QString & person,
const QString & search = QString(),
SortMode mode = Rating,
uint page = 0,
uint pageSize = 10 )

Request a list of Contents.

Like

See also
searchContents, but only contents created by one person.
Parameters
personthe person-id that created the contents.

Definition at line 1182 of file provider.cpp.

◆ searchKnowledgeBase()

ListJob< KnowledgeBaseEntry > * Provider::searchKnowledgeBase ( const Content & content,
const QString & search,
Provider::SortMode sortMode,
int page,
int pageSize )

Definition at line 1509 of file provider.cpp.

◆ setAchievementProgress()

PostJob * Provider::setAchievementProgress ( const QString & id,
const QVariant & progress,
const QDateTime & timestamp )

Definition at line 641 of file provider.cpp.

◆ setAdditionalAgentInformation()

void Provider::setAdditionalAgentInformation ( const QString & additionalInformation)

Set a custom identifier for your application (sent along with the requests as the http agent header in addition to the application name and version).

For example, you might have an application named SomeApplication, version 23, and wish to send along the data "lookandfeel.knsrc". Call this function, and the resulting agent header would be:

SomeApplication/23 (+lookandfeel.knsrc)

If you do not set this (or set it to an empty string), the agent string becomes

SomeApplication/23

Parameters
additionalAgentInformationThe extra string
Since
5.66

Definition at line 330 of file provider.cpp.

◆ setDownloadFile()

PostJob * Provider::setDownloadFile ( const QString & contentId,
const QString & fileName,
const QByteArray & payload )

Definition at line 1324 of file provider.cpp.

◆ setEnabled()

void Provider::setEnabled ( bool enabled)

Definition at line 321 of file provider.cpp.

◆ setPreviewImage()

PostJob * Provider::setPreviewImage ( const QString & contentId,
const QString & previewId,
const QString & fileName,
const QByteArray & image )

Upload an image file as preview for the content.

Parameters
contentId
previewIdeach content can have previews with the id 1,2 or 3
payloadthe image file

Definition at line 1350 of file provider.cpp.

◆ setPrivateData()

PostJob * Provider::setPrivateData ( const QString & app,
const QString & key,
const QString & value )

Sets the value of an attribute.

Parameters
appThe application name
keyThe key of the attribute
valueThe new value of the attribute
Returns
The job responsible for setting data

Definition at line 1667 of file provider.cpp.

◆ uploadTarballToBuildService()

PostJob * Provider::uploadTarballToBuildService ( const QString & projectId,
const QString & fileName,
const QByteArray & payload )

Upload a tarball to the buildservice.

Parameters
projectIdThe ID of the project this source file belongs to
payloadA reference to the complete file data
Returns
A postjob to keep keep track of the upload

Definition at line 991 of file provider.cpp.

◆ voteForComment()

PostJob * Provider::voteForComment ( const QString & id,
uint rating )

Vote a comment item.

Parameters
idthe comment id which this voting is for
ratingthe rating, must be between 0 (bad) and 100 (good)
Returns
the post job for this voting

Definition at line 1654 of file provider.cpp.

◆ voteForContent()

PostJob * Provider::voteForContent ( const QString & contentId,
uint rating )

Vote for a content item.

Parameters
contentIdthe content which this voting is for
rating- the rating, must be between 0 (bad) and 100 (good)
Returns
the post job for this voting

Definition at line 1380 of file provider.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 1 2024 18:48:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.