| content.h | | content.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| #define ATTICA_CONTENT_H | | #define ATTICA_CONTENT_H | |
| | | | |
| #include <QtCore/QList> | | #include <QtCore/QList> | |
| #include <QtCore/QString> | | #include <QtCore/QString> | |
| #include <QtCore/QMap> | | #include <QtCore/QMap> | |
| #include <QtCore/QSharedDataPointer> | | #include <QtCore/QSharedDataPointer> | |
| #include <QtCore/QUrl> | | #include <QtCore/QUrl> | |
| | | | |
| #include "atticaclient_export.h" | | #include "atticaclient_export.h" | |
| #include "downloaddescription.h" | | #include "downloaddescription.h" | |
|
| | | #include "homepageentry.h" | |
| | | #include "icon.h" | |
| | | | |
| class QDateTime; | | class QDateTime; | |
| | | | |
| namespace Attica { | | namespace Attica { | |
| | | | |
| /** | | /** | |
| * Represents a single content | | * Represents a single content | |
| */ | | */ | |
| class ATTICA_EXPORT Content | | class ATTICA_EXPORT Content | |
| { | | { | |
| | | | |
| skipping to change at line 122 | | skipping to change at line 124 | |
| */ | | */ | |
| void setDownloads(int downloads); | | void setDownloads(int downloads); | |
| | | | |
| /** | | /** | |
| * Gets the number of downloads for the Content (how often this has bee
n downloaded from the server). | | * Gets the number of downloads for the Content (how often this has bee
n downloaded from the server). | |
| * @return the number of downloads | | * @return the number of downloads | |
| */ | | */ | |
| int downloads() const; | | int downloads() const; | |
| | | | |
| /** | | /** | |
|
| | | * Sets the number of comments for the Content. | |
| | | * @param numComments the new number of downloads | |
| | | */ | |
| | | void setNumberOfComments(int numComments); | |
| | | | |
| | | /** | |
| | | * Gets the number of comments for the Content. | |
| | | * @return the number of comments | |
| | | */ | |
| | | int numberOfComments() const; | |
| | | | |
| | | /** | |
| * Sets the date and time the Content has been created. | | * Sets the date and time the Content has been created. | |
| * @param created the new creation date and time | | * @param created the new creation date and time | |
| */ | | */ | |
| void setCreated(const QDateTime& created); | | void setCreated(const QDateTime& created); | |
| | | | |
| /** | | /** | |
| * Gets the date and time the Content has been created. | | * Gets the date and time the Content has been created. | |
| * @return the date and time of the last update | | * @return the date and time of the last update | |
| */ | | */ | |
| QDateTime created() const; | | QDateTime created() const; | |
| | | | |
| skipping to change at line 146 | | skipping to change at line 160 | |
| */ | | */ | |
| void setUpdated(const QDateTime& updated); | | void setUpdated(const QDateTime& updated); | |
| | | | |
| /** | | /** | |
| * Gets the date and time the Content has been last updated. | | * Gets the date and time the Content has been last updated. | |
| * @return the date and time of the last update | | * @return the date and time of the last update | |
| */ | | */ | |
| QDateTime updated() const; | | QDateTime updated() const; | |
| | | | |
| /** | | /** | |
|
| | | * A summary description of this content. | |
| | | */ | |
| | | QString summary() const; | |
| | | | |
| | | /** | |
| * A description of this content. | | * A description of this content. | |
| */ | | */ | |
| QString description() const; | | QString description() const; | |
| | | | |
| /** | | /** | |
| * A webpage with the detailed description of this content. | | * A webpage with the detailed description of this content. | |
| */ | | */ | |
| QUrl detailpage() const; | | QUrl detailpage() const; | |
| | | | |
| QString changelog() const; | | QString changelog() const; | |
| | | | |
| skipping to change at line 171 | | skipping to change at line 190 | |
| This is not very helpful if we don't know the allowed numbers. | | This is not very helpful if we don't know the allowed numbers. | |
| */ | | */ | |
| DownloadDescription downloadUrlDescription(int number) const; | | DownloadDescription downloadUrlDescription(int number) const; | |
| | | | |
| /** | | /** | |
| Get all possible downloads. | | Get all possible downloads. | |
| This is slow searching through lots of strings, so beware and don't c
all it too often. | | This is slow searching through lots of strings, so beware and don't c
all it too often. | |
| */ | | */ | |
| QList<DownloadDescription> downloadUrlDescriptions() const; | | QList<DownloadDescription> downloadUrlDescriptions() const; | |
| | | | |
|
| | | /** | |
| | | Get the details about a home page (a content can have multiple home p | |
| | | ages, blog, bugs, ...). | |
| | | This is not very helpful if we don't know the allowed numbers. | |
| | | */ | |
| | | HomePageEntry homePageEntry(int number) const; | |
| | | | |
| | | /** | |
| | | Get all home pages for this content. | |
| | | This is slow searching through lots of strings, so beware and don't c | |
| | | all it too often. | |
| | | */ | |
| | | QList<HomePageEntry> homePageEntries(); | |
| | | | |
| QString previewPicture(const QString& number = QLatin1String("1")) cons
t; | | QString previewPicture(const QString& number = QLatin1String("1")) cons
t; | |
| QString smallPreviewPicture(const QString& number = QLatin1String("1"))
const; | | QString smallPreviewPicture(const QString& number = QLatin1String("1"))
const; | |
| QString license() const; | | QString license() const; | |
|
| | | QString licenseName() const; | |
| QString author() const; | | QString author() const; | |
| | | | |
| /** | | /** | |
|
| | | Get all icons for this content. | |
| | | */ | |
| | | QList<Icon> icons(); | |
| | | /** | |
| | | * Set list of icons. | |
| | | * @param icons list of icons for this content | |
| | | */ | |
| | | void setIcons(QList<Icon> icons); | |
| | | | |
| | | /** | |
| | | Get all videos for this content. | |
| | | */ | |
| | | QList<QUrl> videos(); | |
| | | /** | |
| | | * Set list of videos. | |
| | | * @param videos list of videos for this content | |
| | | */ | |
| | | void setVideos(QList<QUrl> videos); | |
| | | | |
| | | /** | |
| * Add an attribute that is not included in the basis set of attributes
exposed by the Content class. | | * Add an attribute that is not included in the basis set of attributes
exposed by the Content class. | |
| * If the attribute already exists it gets overwritten. | | * If the attribute already exists it gets overwritten. | |
| * @param key the key of the attribute | | * @param key the key of the attribute | |
| * @param value the value of the attribute | | * @param value the value of the attribute | |
| */ | | */ | |
| void addAttribute( const QString &key, const QString &value ); | | void addAttribute( const QString &key, const QString &value ); | |
| | | | |
| /** | | /** | |
| * Get an attribute that is not included in the basis set of attributes
exposed by the Content class. | | * Get an attribute that is not included in the basis set of attributes
exposed by the Content class. | |
| * @param key the key of the attribute | | * @param key the key of the attribute | |
| | | | |
End of changes. 6 change blocks. |
| 0 lines changed or deleted | | 54 lines changed or added | |
|
| provider.h | | provider.h | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| #include <QtCore/QSharedPointer> | | #include <QtCore/QSharedPointer> | |
| #include <QtCore/QString> | | #include <QtCore/QString> | |
| | | | |
| #include <QtCore/QUrl> | | #include <QtCore/QUrl> | |
| | | | |
| #include "atticaclient_export.h" | | #include "atticaclient_export.h" | |
| #include "category.h" | | #include "category.h" | |
| #include "itemjob.h" | | #include "itemjob.h" | |
| #include "listjob.h" | | #include "listjob.h" | |
| #include "message.h" | | #include "message.h" | |
|
| | | #include "comment.h" | |
| | | #include "distribution.h" | |
| | | #include "license.h" | |
| | | | |
| class QDate; | | class QDate; | |
| class QUrl; | | class QUrl; | |
| | | | |
| namespace Attica { | | namespace Attica { | |
| | | | |
| class PlatformDependent; | | class PlatformDependent; | |
| | | | |
| class PostJobStatus; | | class PostJobStatus; | |
| | | | |
|
| | | class AccountBalance; | |
| class Activity; | | class Activity; | |
|
| | | class PrivateData; | |
| class Content; | | class Content; | |
| class DownloadItem; | | class DownloadItem; | |
|
| | | class Distribution; | |
| class Event; | | class Event; | |
| class Folder; | | class Folder; | |
|
| | | class HomePageType; | |
| class KnowledgeBaseEntry; | | class KnowledgeBaseEntry; | |
| class License; | | class License; | |
| class Person; | | class Person; | |
| class PostJob; | | class PostJob; | |
| class Provider; | | class Provider; | |
|
| class AccountBalance; | | | |
| | | | |
| /** | | /** | |
| * The Provider class represents one Open Collaboration Service provider. | | * The Provider class represents one Open Collaboration Service provider. | |
| * Use the ProviderManager to instanciate a Provider. | | * Use the ProviderManager to instanciate a Provider. | |
| * | | * | |
| * Accessing functions of the Provider returns a Job class that | | * Accessing functions of the Provider returns a Job class that | |
| * takes care of accessing the server and parsing the result. | | * takes care of accessing the server and parsing the result. | |
| * | | * | |
| * Provider files are xml of the form: | | * Provider files are xml of the form: | |
| <pre> | | <pre> | |
| | | | |
| skipping to change at line 247 | | skipping to change at line 253 | |
| // Person part of OCS | | // Person part of OCS | |
| | | | |
| PostJob* registerAccount(const QString& id, const QString& password, co
nst QString& mail, const QString& firstName, const QString& lastName); | | PostJob* registerAccount(const QString& id, const QString& password, co
nst QString& mail, const QString& firstName, const QString& lastName); | |
| ItemJob<Person>* requestPerson(const QString& id); | | ItemJob<Person>* requestPerson(const QString& id); | |
| ItemJob<Person>* requestPersonSelf(); | | ItemJob<Person>* requestPersonSelf(); | |
| ItemJob<AccountBalance>* requestAccountBalance(); | | ItemJob<AccountBalance>* requestAccountBalance(); | |
| ListJob<Person>* requestPersonSearchByName(const QString& name); | | ListJob<Person>* requestPersonSearchByName(const QString& name); | |
| ListJob<Person>* requestPersonSearchByLocation(qreal latitude, qreal lo
ngitude, qreal distance = 0.0, int page = 0, int pageSize = 20); | | ListJob<Person>* requestPersonSearchByLocation(qreal latitude, qreal lo
ngitude, qreal distance = 0.0, int page = 0, int pageSize = 20); | |
| PostJob* postLocation(qreal latitude, qreal longitude, const QString& c
ity = QString(), const QString& country = QString()); | | PostJob* postLocation(qreal latitude, qreal longitude, const QString& c
ity = QString(), const QString& country = QString()); | |
| | | | |
|
| | | ////////////////////////// | |
| | | // PrivateData part of OCS | |
| | | | |
| | | /** | |
| | | * Fetches the a given attribute from an OCS-compliant server. | |
| | | * @param app The application name | |
| | | * @param key The key of the attribute to fetch (optional) | |
| | | * @return The job that is responsible for fetching the data | |
| | | */ | |
| | | ItemJob<PrivateData>* requestPrivateData(const QString& app, const QStr | |
| | | ing& key = QString()); | |
| | | | |
| | | /** | |
| | | * Fetches all stored private data. | |
| | | * @return The job responsible for fetching data | |
| | | */ | |
| | | ItemJob<PrivateData>* requestPrivateData() { return requestPrivateData( | |
| | | QString(), QString()); } | |
| | | | |
| | | /** | |
| | | * Sets the value of an attribute. | |
| | | * @param app The application name | |
| | | * @param key The key of the attribute | |
| | | * @param value The new value of the attribute | |
| | | * @return The job responsible for setting data | |
| | | */ | |
| | | PostJob* setPrivateData(const QString &app, const QString &key, const Q | |
| | | String &value); | |
| | | | |
| // Friend part of OCS | | // Friend part of OCS | |
| | | | |
| ListJob<Person>* requestFriends(const QString& id, int page = 0, int pa
geSize = 20); | | ListJob<Person>* requestFriends(const QString& id, int page = 0, int pa
geSize = 20); | |
| PostJob* postFriendInvitation(const QString& to, const QString& message
); | | PostJob* postFriendInvitation(const QString& to, const QString& message
); | |
| ListJob<Person>* requestSentInvitations(int page = 0, int pageSize = 20
); | | ListJob<Person>* requestSentInvitations(int page = 0, int pageSize = 20
); | |
| ListJob<Person>* requestReceivedInvitations(int page = 0, int pageSize
= 20); | | ListJob<Person>* requestReceivedInvitations(int page = 0, int pageSize
= 20); | |
| PostJob* inviteFriend(const QString& to, const QString& message); | | PostJob* inviteFriend(const QString& to, const QString& message); | |
| PostJob* approveFriendship(const QString& to); | | PostJob* approveFriendship(const QString& to); | |
| PostJob* declineFriendship(const QString& to); | | PostJob* declineFriendship(const QString& to); | |
| PostJob* cancelFriendship(const QString& to); | | PostJob* cancelFriendship(const QString& to); | |
| | | | |
| skipping to change at line 286 | | skipping to change at line 318 | |
| */ | | */ | |
| ListJob<Category>* requestCategories(); | | ListJob<Category>* requestCategories(); | |
| | | | |
| /** | | /** | |
| * Get a list of licenses (such as GPL) | | * Get a list of licenses (such as GPL) | |
| * @return the licenses available from the server | | * @return the licenses available from the server | |
| */ | | */ | |
| ListJob<License>* requestLicenses(); | | ListJob<License>* requestLicenses(); | |
| | | | |
| /** | | /** | |
|
| | | * Get a list of distributions (such as Ark, Debian) | |
| | | * @return the licenses available from the server | |
| | | */ | |
| | | ListJob<Distribution>* requestDistributions(); | |
| | | | |
| | | /** | |
| | | * Get a list of home page types (such as blog, Facebook) | |
| | | * @return the licenses available from the server | |
| | | */ | |
| | | ListJob<HomePageType>* requestHomePageTypes(); | |
| | | | |
| | | /** | |
| Request a list of Contents. | | Request a list of Contents. | |
| Note that @p categories is not optional. If left empty, no results wi
ll be returned. | | Note that @p categories is not optional. If left empty, no results wi
ll be returned. | |
| An empty search string @p search returns the top n items. | | An empty search string @p search returns the top n items. | |
| @param categories categories to search in | | @param categories categories to search in | |
| @param search optional search string (in name/description of the cont
ent) | | @param search optional search string (in name/description of the cont
ent) | |
| @param mode sorting mode | | @param mode sorting mode | |
| @param page request nth page in the list of results | | @param page request nth page in the list of results | |
| @param pageSize requested size of pages when calculating the list of
results | | @param pageSize requested size of pages when calculating the list of
results | |
| @return list job for the search results | | @return list job for the search results | |
| */ | | */ | |
| ListJob<Content>* searchContents(const Category::List& categories, cons
t QString& search = QString(), SortMode mode = Rating, uint page = 0, uint
pageSize = 10); | | ListJob<Content>* searchContents(const Category::List& categories, cons
t QString& search = QString(), SortMode mode = Rating, uint page = 0, uint
pageSize = 10); | |
| | | | |
| /** | | /** | |
| Request a list of Contents. | | Request a list of Contents. | |
| Like @see searchContents, but only contents created by one person. | | Like @see searchContents, but only contents created by one person. | |
| @param person the person-id that created the contents. | | @param person the person-id that created the contents. | |
| */ | | */ | |
| ListJob<Content>* searchContentsByPerson(const Category::List& categori
es, const QString& person, const QString& search = QString(), SortMode mode
= Rating, uint page = 0, uint pageSize = 10); | | ListJob<Content>* searchContentsByPerson(const Category::List& categori
es, const QString& person, const QString& search = QString(), SortMode mode
= Rating, uint page = 0, uint pageSize = 10); | |
| | | | |
| /** | | /** | |
|
| | | Request a list of Contents. More complete version. | |
| | | Note that @p categories is not optional. If left empty, no results wi | |
| | | ll be returned. | |
| | | An empty search string @p search returns the top n items. | |
| | | @param categories categories to search in | |
| | | @param person the person-id that created the contents | |
| | | @param distributions list of distributions to filter by, if empty no | |
| | | filtering by distribution is done | |
| | | @param licenses list of licenses to filter by, if empty no filtering | |
| | | by license is done | |
| | | @param search optional search string (in name/description of the cont | |
| | | ent) | |
| | | @param mode sorting mode | |
| | | @param page request nth page in the list of results | |
| | | @param pageSize requested size of pages when calculating the list of | |
| | | results | |
| | | @return list job for the search results | |
| | | */ | |
| | | ListJob<Content>* searchContents(const Category::List& categories, cons | |
| | | t QString& person, const Distribution::List& distributions, const License:: | |
| | | List& licenses, const QString& search = QString(), SortMode sortMode = Rati | |
| | | ng, uint page = 0, uint pageSize = 10); | |
| | | | |
| | | /** | |
| Retrieve a single content. | | Retrieve a single content. | |
| @param contentId the id of the content | | @param contentId the id of the content | |
| @return job that retrieves the content object | | @return job that retrieves the content object | |
| */ | | */ | |
| ItemJob<Content>* requestContent(const QString& contentId); | | ItemJob<Content>* requestContent(const QString& contentId); | |
| | | | |
| ItemJob<DownloadItem>* downloadLink(const QString& contentId, const QSt
ring& itemId = QLatin1String("1")); | | ItemJob<DownloadItem>* downloadLink(const QString& contentId, const QSt
ring& itemId = QLatin1String("1")); | |
| | | | |
|
| PostJob* voteForContent(const QString& contentId, bool positiveVote); | | /** Vote for a content item | |
| | | * This version is for the old OCS API < 1.6 | |
| | | * @param contentId the content which this voting is for | |
| | | * @param positiveVote whether the voting is positive or negative | |
| | | * @return the post job for this voting | |
| | | */ | |
| | | Q_DECL_DEPRECATED PostJob* voteForContent(const QString& contentId, boo | |
| | | l positiveVote); | |
| | | | |
| | | /** Vote for a content item | |
| | | * @param contentId the content which this voting is for | |
| | | * @param rating - the rating, must be between 0 (bad) and 100 (good) | |
| | | * @return the post job for this voting | |
| | | */ | |
| | | PostJob* voteForContent(const QString& contentId, uint rating); | |
| | | | |
| ItemPostJob<Content>* addNewContent(const Category& category, const Con
tent& newContent); | | ItemPostJob<Content>* addNewContent(const Category& category, const Con
tent& newContent); | |
| ItemPostJob<Content>* editContent(const Category& updatedCategory, cons
t QString& contentId, const Content& updatedContent); | | ItemPostJob<Content>* editContent(const Category& updatedCategory, cons
t QString& contentId, const Content& updatedContent); | |
| PostJob* deleteContent(const QString& contentId); | | PostJob* deleteContent(const QString& contentId); | |
| | | | |
| PostJob* setDownloadFile(const QString& contentId, const QString& fileN
ame, QIODevice* payload); | | PostJob* setDownloadFile(const QString& contentId, const QString& fileN
ame, QIODevice* payload); | |
| PostJob* setDownloadFile(const QString& contentId, const QString& fileN
ame, const QByteArray& payload); | | PostJob* setDownloadFile(const QString& contentId, const QString& fileN
ame, const QByteArray& payload); | |
| PostJob* deleteDownloadFile(const QString& contentId); | | PostJob* deleteDownloadFile(const QString& contentId); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 343 | | skipping to change at line 416 | |
| // KnowledgeBase part of OCS | | // KnowledgeBase part of OCS | |
| | | | |
| ItemJob<KnowledgeBaseEntry>* requestKnowledgeBaseEntry(const QString& i
d); | | ItemJob<KnowledgeBaseEntry>* requestKnowledgeBaseEntry(const QString& i
d); | |
| ListJob<KnowledgeBaseEntry>* searchKnowledgeBase(const Content& content
, const QString& search, SortMode, int page, int pageSize); | | ListJob<KnowledgeBaseEntry>* searchKnowledgeBase(const Content& content
, const QString& search, SortMode, int page, int pageSize); | |
| | | | |
| // Event part of OCS | | // Event part of OCS | |
| | | | |
| ItemJob<Event>* requestEvent(const QString& id); | | ItemJob<Event>* requestEvent(const QString& id); | |
| ListJob<Event>* requestEvent(const QString& country, const QString& sea
rch, const QDate& startAt, SortMode mode, int page, int pageSize); | | ListJob<Event>* requestEvent(const QString& country, const QString& sea
rch, const QDate& startAt, SortMode mode, int page, int pageSize); | |
| | | | |
|
| | | // Comment part of OCS | |
| | | /** Request a list of comments for a content / forum / knowledgebase / | |
| | | event. | |
| | | * @param comment::Type type of the comment @see Comment::Type (content | |
| | | / forum / knowledgebase / event) | |
| | | * @param id id of the content entry where you want to get the comments | |
| | | is from | |
| | | * @param id2 id of the content entry where you want to get the comment | |
| | | s is from | |
| | | * @param page request nth page in the list of results | |
| | | * @param pageSize requested size of pages when calculating the list of | |
| | | results | |
| | | * @return list job for the comments results | |
| | | */ | |
| | | ListJob<Comment>* requestComments(const Comment::Type commentType, cons | |
| | | t QString& id, const QString& id2, int page, int pageSize); | |
| | | | |
| | | /** Add a new comment. | |
| | | * @param commentType type of the comment @see CommentType (content / f | |
| | | orum / knowledgebase / event) | |
| | | * @param id id of the content entry where you want to get the comments | |
| | | is from | |
| | | * @param id2 id of the sub content entry where you want to get the com | |
| | | ments is from | |
| | | * @param parentId the id of the parent comment if the new comment is a | |
| | | reply | |
| | | * @param subject title of the comment | |
| | | * @param message text of the comment | |
| | | * @return item post job for adding the new comment | |
| | | */ | |
| | | ItemPostJob<Comment>* addNewComment(const Comment::Type commentType, co | |
| | | nst QString& id, const QString& id2, const QString& parentId, const QString | |
| | | &subject, const QString& message); | |
| | | | |
| | | /** Vote a comment item | |
| | | * @param id the comment id which this voting is for | |
| | | * @param rating the rating, must be between 0 (bad) and 100 (good) | |
| | | * @return the post job for this voting | |
| | | */ | |
| | | PostJob* voteForComment(const QString & id, uint rating); | |
| | | | |
| // Fan part of OCS | | // Fan part of OCS | |
| | | | |
| PostJob* becomeFan(const QString& contentId); | | PostJob* becomeFan(const QString& contentId); | |
| ListJob<Person>* requestFans(const QString& contentId, uint page = 0, u
int pageSize = 10); | | ListJob<Person>* requestFans(const QString& contentId, uint page = 0, u
int pageSize = 10); | |
| | | | |
| protected: | | protected: | |
| QUrl createUrl(const QString& path); | | QUrl createUrl(const QString& path); | |
| QNetworkRequest createRequest(const QUrl& url); | | QNetworkRequest createRequest(const QUrl& url); | |
| // Convenience overload | | // Convenience overload | |
| QNetworkRequest createRequest(const QString& path); | | QNetworkRequest createRequest(const QString& path); | |
| | | | |
End of changes. 11 change blocks. |
| 2 lines changed or deleted | | 128 lines changed or added | |
|