File indexing completed on 2019-04-16 11:59:10

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     Copyright (C) 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com>
0005 
0006     This program is free software; you can redistribute it and/or
0007     modify it under the terms of the GNU General Public License as
0008     published by the Free Software Foundation; either version 2 of
0009     the License or (at your option) version 3 or any later version
0010     accepted by the membership of KDE e.V. (or its successor approved
0011     by the membership of KDE e.V.), which shall act as a proxy
0012     defined in Section 14 of version 3 of the license.
0013 
0014     This program is distributed in the hope that it will be useful,
0015     but WITHOUT ANY WARRANTY; without even the implied warranty of
0016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0017     GNU General Public License for more details.
0018 
0019     You should have received a copy of the GNU General Public License
0020     along with this program; if not, see http://www.gnu.org/licenses/
0021 
0022 */
0023 
0024 #ifndef CHOQOKTYPES_H
0025 #define CHOQOKTYPES_H
0026 
0027 #include <QDateTime>
0028 #include <QUrl>
0029 
0030 #include "choqok_export.h"
0031 
0032 namespace Choqok
0033 {
0034 
0035 enum JobResult {
0036     Fail = 0,
0037     Success = 1
0038 };
0039 
0040 class CHOQOK_EXPORT User
0041 {
0042 public:
0043     User()
0044         : isProtected(false)
0045     {}
0046     User(const User& u) = default;
0047     User(User&& u) = default;
0048     virtual ~User() {}
0049     User& operator=(const User& u) = default;
0050     User& operator=(User&& u) = default;
0051 
0052     QString userId;
0053     QString realName;
0054     QString userName;
0055     QString location;
0056     QString description;
0057     QUrl profileImageUrl;
0058     QUrl homePageUrl;
0059     bool isProtected;
0060 };
0061 
0062 class CHOQOK_EXPORT QuotedPost
0063 {
0064 public:
0065     User user;
0066     QString postId;
0067     QString content;
0068 };
0069 
0070 class CHOQOK_EXPORT Post
0071 {
0072 public:
0073     Post()
0074         : isFavorited(false), isPrivate(false), isError(false), isRead(false), owners(0)
0075     {}
0076     Post(const Post& u) = default;
0077     Post(Post&& u) = default;
0078     virtual ~Post() {}
0079     Post& operator=(const Post& u) = default;
0080     Post& operator=(Post&& u) = default;
0081     
0082     QDateTime creationDateTime;
0083     QString postId;
0084     QUrl link;
0085     QString content;
0086     QString source;
0087     QString replyToPostId;
0088     User replyToUser;
0089     bool isFavorited;
0090     User author;
0091     QString type;
0092     bool isPrivate;
0093     bool isError;
0094     bool isRead;
0095     User repeatedFromUser;
0096     QString repeatedPostId;
0097     QDateTime repeatedDateTime;
0098     QString conversationId;
0099     QUrl media;          // first Image of Post, if available
0100     QuotedPost quotedPost;
0101     unsigned int owners; // number of associated PostWidgets
0102 };
0103 /**
0104 Describe an specific timeline, Should use by @ref MicroBlog
0105 */
0106 class CHOQOK_EXPORT TimelineInfo
0107 {
0108 public:
0109     QString name;
0110     QString description;
0111     QString icon;
0112 };
0113 
0114 }
0115 #endif