1 /* 2 This file is part of Choqok, the KDE micro-blogging client 3 4 Copyright (C) 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com> 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License as 8 published by the Free Software Foundation; either version 2 of 9 the License or (at your option) version 3 or any later version 10 accepted by the membership of KDE e.V. (or its successor approved 11 by the membership of KDE e.V.), which shall act as a proxy 12 defined in Section 14 of version 3 of the license. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, see http://www.gnu.org/licenses/ 21 22 */ 23 24 #ifndef CHOQOKTYPES_H 25 #define CHOQOKTYPES_H 26 27 #include <QDateTime> 28 #include <QUrl> 29 30 #include "choqok_export.h" 31 32 namespace Choqok 33 { 34 35 enum JobResult { 36 Fail = 0, 37 Success = 1 38 }; 39 40 class CHOQOK_EXPORT User 41 { 42 public: User()43 User() 44 : isProtected(false) 45 {} 46 User(const User& u) = default; 47 User(User&& u) = default; ~User()48 virtual ~User() {} 49 User& operator=(const User& u) = default; 50 User& operator=(User&& u) = default; 51 52 QString userId; 53 QString realName; 54 QString userName; 55 QString location; 56 QString description; 57 QUrl profileImageUrl; 58 QUrl homePageUrl; 59 bool isProtected; 60 }; 61 62 class CHOQOK_EXPORT QuotedPost 63 { 64 public: 65 User user; 66 QString postId; 67 QString content; 68 }; 69 70 class CHOQOK_EXPORT Post 71 { 72 public: Post()73 Post() 74 : isFavorited(false), isPrivate(false), isError(false), isRead(false), owners(0) 75 {} 76 Post(const Post& u) = default; 77 Post(Post&& u) = default; ~Post()78 virtual ~Post() {} 79 Post& operator=(const Post& u) = default; 80 Post& operator=(Post&& u) = default; 81 82 QDateTime creationDateTime; 83 QString postId; 84 QUrl link; 85 QString content; 86 QString source; 87 QString replyToPostId; 88 User replyToUser; 89 bool isFavorited; 90 User author; 91 QString type; 92 bool isPrivate; 93 bool isError; 94 bool isRead; 95 User repeatedFromUser; 96 QString repeatedPostId; 97 QDateTime repeatedDateTime; 98 QString conversationId; 99 QUrl media; // first Image of Post, if available 100 QuotedPost quotedPost; 101 unsigned int owners; // number of associated PostWidgets 102 }; 103 /** 104 Describe an specific timeline, Should use by @ref MicroBlog 105 */ 106 class CHOQOK_EXPORT TimelineInfo 107 { 108 public: 109 QString name; 110 QString description; 111 QString icon; 112 }; 113 114 } 115 #endif 116