| content.h | | content.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| License along with this library. If not, see <http://www.gnu.org/licen
ses/>. | | License along with this library. If not, see <http://www.gnu.org/licen
ses/>. | |
| | | | |
| */ | | */ | |
| #ifndef ATTICA_CONTENT_H | | #ifndef ATTICA_CONTENT_H | |
| #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 "atticaclient_export.h" | | #include "atticaclient_export.h" | |
| #include "downloaddescription.h" | | #include "downloaddescription.h" | |
|
| #include <qurl.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 116 | | skipping to change at line 116 | |
| */ | | */ | |
| int rating() const; | | int rating() const; | |
| | | | |
| /** | | /** | |
| * Sets the number of downloads for the Content. | | * Sets the number of downloads for the Content. | |
| * @param downloads the new number of downloads | | * @param downloads the new number of downloads | |
| */ | | */ | |
| void setDownloads(int downloads); | | void setDownloads(int downloads); | |
| | | | |
| /** | | /** | |
|
| * Gets the number of downloads for the Content. | | * 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 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); | |
| | | | |
| | | | |
| skipping to change at line 158 | | skipping to change at line 158 | |
| 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; | |
| QString version() const; | | QString version() const; | |
| QString depend() const; | | QString depend() const; | |
|
| | | | |
| | | /** | |
| | | Get the details about a download (a content can have multiple links, | |
| | | eg for different distros). | |
| | | 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. | |
| | | This is slow searching through lots of strings, so beware and don't c | |
| | | all it too often. | |
| | | */ | |
| | | QList<DownloadDescription> downloadUrlDescriptions() const; | |
| | | | |
| 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 author() const; | | QString author() const; | |
| | | | |
| /** | | /** | |
| * 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 | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 15 lines changed or added | |
|
| downloaddescription.h | | downloaddescription.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| class ATTICA_EXPORT DownloadDescription | | class ATTICA_EXPORT DownloadDescription | |
| { | | { | |
| public: | | public: | |
| | | | |
| DownloadDescription(); | | DownloadDescription(); | |
| DownloadDescription(const DownloadDescription& other); | | DownloadDescription(const DownloadDescription& other); | |
| | | | |
| DownloadDescription& operator=(const DownloadDescription& other); | | DownloadDescription& operator=(const DownloadDescription& other); | |
| ~DownloadDescription(); | | ~DownloadDescription(); | |
| | | | |
|
| | | /** | |
| | | The id of the description - as one Content can have multiple download | |
| | | descriptions associated. | |
| | | This will simply be 1, 2, ... | |
| | | */ | |
| | | int id(); | |
| bool isDownloadtypLink(); | | bool isDownloadtypLink(); | |
| bool hasPrice(); | | bool hasPrice(); | |
| QString category(); | | QString category(); | |
| QString name(); | | QString name(); | |
| QString link(); | | QString link(); | |
| QString distributionType(); | | QString distributionType(); | |
| QString priceReason(); | | QString priceReason(); | |
| QString priceAmount(); | | QString priceAmount(); | |
| | | | |
|
| | | void setId(int id); | |
| void setDownloadtypLink(bool isLink); | | void setDownloadtypLink(bool isLink); | |
| void setHasPrice(bool hasPrice); | | void setHasPrice(bool hasPrice); | |
| void setCategory(const QString& category); | | void setCategory(const QString& category); | |
| void setName(const QString& name); | | void setName(const QString& name); | |
| void setLink(const QString& link); | | void setLink(const QString& link); | |
| void setDistributionType(const QString& distributionType); | | void setDistributionType(const QString& distributionType); | |
| void setPriceReason(const QString& priceReason); | | void setPriceReason(const QString& priceReason); | |
| void setPriceAmount(const QString& priceAmount); | | void setPriceAmount(const QString& priceAmount); | |
| | | | |
| private: | | private: | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 7 lines changed or added | |
|
| itemjob.h | | itemjob.h | |
| | | | |
| skipping to change at line 41 | | skipping to change at line 41 | |
| class Provider; | | class Provider; | |
| | | | |
| template <class T> | | template <class T> | |
| class ATTICA_EXPORT ItemJob : public GetJob | | class ATTICA_EXPORT ItemJob : public GetJob | |
| { | | { | |
| public: | | public: | |
| T result() const; | | T result() const; | |
| | | | |
| private: | | private: | |
| ItemJob(const QSharedPointer<PlatformDependent>& internals, const QNetw
orkRequest& request); | | ItemJob(const QSharedPointer<PlatformDependent>& internals, const QNetw
orkRequest& request); | |
|
| | | ItemJob(PlatformDependent*, const QNetworkRequest& request); | |
| virtual void parse(const QString& xml); | | virtual void parse(const QString& xml); | |
| T m_item; | | T m_item; | |
| friend class Attica::Provider; | | friend class Attica::Provider; | |
| }; | | }; | |
| | | | |
| template <class T> | | template <class T> | |
| class ATTICA_EXPORT ItemPostJob : public PostJob | | class ATTICA_EXPORT ItemPostJob : public PostJob | |
| { | | { | |
| public: | | public: | |
| T result() const; | | T result() const; | |
| | | | |
| private: | | private: | |
| ItemPostJob(const QSharedPointer<PlatformDependent>& internals, const Q
NetworkRequest& request, QIODevice * data); | | ItemPostJob(const QSharedPointer<PlatformDependent>& internals, const Q
NetworkRequest& request, QIODevice * data); | |
| ItemPostJob(const QSharedPointer<PlatformDependent>& internals, const Q
NetworkRequest& request, const StringMap& parameters = StringMap()); | | ItemPostJob(const QSharedPointer<PlatformDependent>& internals, const Q
NetworkRequest& request, const StringMap& parameters = StringMap()); | |
|
| | | ItemPostJob(PlatformDependent* internals, const QNetworkRequest& reques | |
| | | t, QIODevice * data); | |
| | | ItemPostJob(PlatformDependent* internals, const QNetworkRequest& reques | |
| | | t, const StringMap& parameters = StringMap()); | |
| | | | |
| virtual void parse(const QString& xml); | | virtual void parse(const QString& xml); | |
| T m_item; | | T m_item; | |
| friend class Attica::Provider; | | friend class Attica::Provider; | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 0 lines changed or deleted | | 5 lines changed or added | |
|
| provider.h | | provider.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| | | | |
| */ | | */ | |
| | | | |
| #ifndef ATTICA_PROVIDER_H | | #ifndef ATTICA_PROVIDER_H | |
| #define ATTICA_PROVIDER_H | | #define ATTICA_PROVIDER_H | |
| | | | |
| #include <QtCore/QExplicitlySharedDataPointer> | | #include <QtCore/QExplicitlySharedDataPointer> | |
| #include <QtCore/QSharedPointer> | | #include <QtCore/QSharedPointer> | |
| #include <QtCore/QString> | | #include <QtCore/QString> | |
| | | | |
|
| #include <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" | |
| | | | |
| class QDate; | | class QDate; | |
| class QUrl; | | class QUrl; | |
| | | | |
| | | | |
| skipping to change at line 54 | | skipping to change at line 54 | |
| class PlatformDependent; | | class PlatformDependent; | |
| | | | |
| class PostJobStatus; | | class PostJobStatus; | |
| | | | |
| class Activity; | | class Activity; | |
| class Content; | | class Content; | |
| class DownloadItem; | | class DownloadItem; | |
| class Event; | | class Event; | |
| class Folder; | | class Folder; | |
| class KnowledgeBaseEntry; | | class KnowledgeBaseEntry; | |
|
| | | class License; | |
| class Person; | | class Person; | |
| class PostJob; | | class PostJob; | |
| class Provider; | | class Provider; | |
| class AccountBalance; | | 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 funtions 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. | |
| */ | | */ | |
| class ATTICA_EXPORT Provider | | class ATTICA_EXPORT Provider | |
| { | | { | |
| public: | | public: | |
| Provider(); | | Provider(); | |
| Provider(const Provider& other); | | Provider(const Provider& other); | |
| Provider& operator=(const Provider& other); | | Provider& operator=(const Provider& other); | |
| ~Provider(); | | ~Provider(); | |
| | | | |
| | | | |
| skipping to change at line 133 | | skipping to change at line 134 | |
| ListJob<Activity>* requestActivities(); | | ListJob<Activity>* requestActivities(); | |
| PostJob* postActivity(const QString& message); | | PostJob* postActivity(const QString& message); | |
| | | | |
| // Content part of OCS | | // Content part of OCS | |
| | | | |
| /** | | /** | |
| * Get a list of categories (such as wallpaper) | | * Get a list of categories (such as wallpaper) | |
| * @return the categories of the server | | * @return the categories of the server | |
| */ | | */ | |
| ListJob<Category>* requestCategories(); | | ListJob<Category>* requestCategories(); | |
|
| ListJob<Content>* searchContents(const Category::List& categories, cons | | | |
| t QString& search = QString(), SortMode mode = Rating, uint page = 1, uint | | /** | |
| pageSize = 10); | | * Get a list of licenses (such as GPL) | |
| | | * @return the licenses available from the server | |
| | | */ | |
| | | ListJob<License>* requestLicenses(); | |
| | | | |
| | | /** | |
| | | Request a list of Contents. | |
| | | 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 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& search = QString(), SortMode mode = Rating, uint page = 0, uint | |
| | | pageSize = 10); | |
| | | | |
| | | /** | |
| | | Request a list of Contents. | |
| | | Like @see searchContents, but only contents created by one person. | |
| | | @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); | |
| | | | |
| | | /** | |
| | | Retrieve a single content. | |
| | | @param contentId the id of the content | |
| | | @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); | | PostJob* voteForContent(const QString& contentId, bool positiveVote); | |
| | | | |
| 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); | |
| | | | |
| | | | |
| skipping to change at line 170 | | skipping to change at line 202 | |
| 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); | |
| | | | |
| // 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); | |
| | | | |
| 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); | |
| | | | |
| ItemJob<Person>* doRequestPerson(const QUrl& url); | | ItemJob<Person>* doRequestPerson(const QUrl& url); | |
| ItemJob<AccountBalance>* doRequestAccountBalance(const QUrl& url); | | ItemJob<AccountBalance>* doRequestAccountBalance(const QUrl& url); | |
| ListJob<Person>* doRequestPersonList(const QUrl& url); | | ListJob<Person>* doRequestPersonList(const QUrl& url); | |
| ListJob<Activity>* doRequestActivityList(const QUrl& url); | | ListJob<Activity>* doRequestActivityList(const QUrl& url); | |
| ListJob<Folder>* doRequestFolderList(const QUrl& url); | | ListJob<Folder>* doRequestFolderList(const QUrl& url); | |
| ListJob<Message>* doRequestMessageList(const QUrl& url); | | ListJob<Message>* doRequestMessageList(const QUrl& url); | |
| | | | |
| private: | | private: | |
| class Private; | | class Private; | |
| QExplicitlySharedDataPointer<Private> d; | | QExplicitlySharedDataPointer<Private> d; | |
| | | | |
|
| // FIXME use baseUrl as id | | // old constructor: used to pass internals as QSharedPointer, but chang | |
| | | ed to pointer | |
| | | // deleting the root objects of plugins is evil (see QPluginLoaded docs | |
| | | ) | |
| Provider(const QSharedPointer<PlatformDependent>& internals, const QUrl
& baseUrl, const QString& name, const QUrl& icon = QUrl()); | | Provider(const QSharedPointer<PlatformDependent>& internals, const QUrl
& baseUrl, const QString& name, const QUrl& icon = QUrl()); | |
|
| | | // FIXME use baseUrl as id | |
| | | Provider(PlatformDependent* internals, const QUrl& baseUrl, const QStri | |
| | | ng& name, const QUrl& icon = QUrl()); | |
| | | | |
| // TODO remove | | // TODO remove | |
| friend class ProviderManager; | | friend class ProviderManager; | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 6 lines changed or deleted | | 50 lines changed or added | |
|
| version.h | | version.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
| * Boston, MA 02110-1301, USA. | | * Boston, MA 02110-1301, USA. | |
| */ | | */ | |
| | | | |
| #ifndef _ATTICA_VERSION_H_ | | #ifndef _ATTICA_VERSION_H_ | |
| #define _ATTICA_VERSION_H_ | | #define _ATTICA_VERSION_H_ | |
| | | | |
| #include "atticaclient_export.h" | | #include "atticaclient_export.h" | |
| | | | |
| /// @brief Attica version as string at compile time. | | /// @brief Attica version as string at compile time. | |
|
| #define LIBATTICA_VERSION_STRING "0.1.2" | | #define LIBATTICA_VERSION_STRING "0.1.3" | |
| | | | |
| /// @brief The major Attica version number at compile time | | /// @brief The major Attica version number at compile time | |
| #define LIBATTICA_VERSION_MAJOR 0 | | #define LIBATTICA_VERSION_MAJOR 0 | |
| | | | |
| /// @brief The minor Attica version number at compile time | | /// @brief The minor Attica version number at compile time | |
| #define LIBATTICA_VERSION_MINOR 1 | | #define LIBATTICA_VERSION_MINOR 1 | |
| | | | |
| /// @brief The Attica release version number at compile time | | /// @brief The Attica release version number at compile time | |
| #define LIBATTICA_VERSION_RELEASE | | #define LIBATTICA_VERSION_RELEASE | |
| | | | |
| | | | |
End of changes. 1 change blocks. |
| 1 lines changed or deleted | | 1 lines changed or added | |
|