File indexing completed on 2024-04-21 04:55:26
0001 /* 0002 This file is part of Choqok, the KDE micro-blogging client 0003 0004 SPDX-FileCopyrightText: 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com> 0005 0006 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #ifndef CHOQOKTYPES_H 0010 #define CHOQOKTYPES_H 0011 0012 #include <QDateTime> 0013 #include <QUrl> 0014 0015 #include "choqok_export.h" 0016 0017 namespace Choqok 0018 { 0019 0020 enum JobResult { 0021 Fail = 0, 0022 Success = 1 0023 }; 0024 0025 class CHOQOK_EXPORT User 0026 { 0027 public: 0028 User() 0029 : isProtected(false) 0030 {} 0031 User(const User& u) = default; 0032 User(User&& u) = default; 0033 virtual ~User() {} 0034 User& operator=(const User& u) = default; 0035 User& operator=(User&& u) = default; 0036 0037 QString userId; 0038 QString realName; 0039 QString userName; 0040 QString location; 0041 QString description; 0042 QUrl profileImageUrl; 0043 QUrl homePageUrl; 0044 bool isProtected; 0045 }; 0046 0047 class CHOQOK_EXPORT QuotedPost 0048 { 0049 public: 0050 User user; 0051 QString postId; 0052 QString content; 0053 }; 0054 0055 class CHOQOK_EXPORT Post 0056 { 0057 public: 0058 Post() 0059 : isFavorited(false), isPrivate(false), isError(false), isRead(false), owners(0) 0060 {} 0061 Post(const Post& u) = default; 0062 Post(Post&& u) = default; 0063 virtual ~Post() {} 0064 Post& operator=(const Post& u) = default; 0065 Post& operator=(Post&& u) = default; 0066 0067 QDateTime creationDateTime; 0068 QString postId; 0069 QUrl link; 0070 QString content; 0071 QString source; 0072 QString replyToPostId; 0073 User replyToUser; 0074 bool isFavorited; 0075 User author; 0076 QString type; 0077 bool isPrivate; 0078 bool isError; 0079 bool isRead; 0080 User repeatedFromUser; 0081 QString repeatedPostId; 0082 QDateTime repeatedDateTime; 0083 QString conversationId; 0084 QUrl media; // first Image of Post, if available 0085 QuotedPost quotedPost; 0086 unsigned int owners; // number of associated PostWidgets 0087 }; 0088 /** 0089 Describe an specific timeline, Should use by @ref MicroBlog 0090 */ 0091 class CHOQOK_EXPORT TimelineInfo 0092 { 0093 public: 0094 QString name; 0095 QString description; 0096 QString icon; 0097 }; 0098 0099 } 0100 #endif