/usr/include/akonadi/socialutils/socialfeeditem.h is in kdepimlibs5-dev 4:4.14.10-1ubuntu7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | /*
Copyright (C) 2012 Martin Klapetek <martin.klapetek@gmail.com>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef AKONADI_SOCIALUTILS_SOCIALFEEDITEM_H
#define AKONADI_SOCIALUTILS_SOCIALFEEDITEM_H
#include "libakonadisocialutils_export.h"
#include <QSharedPointer>
#include <QVariant>
#include <QUrl>
class KDateTime;
namespace Akonadi {
class SocialFeedItemPrivate;
/**
* Class representing one entry in the social feed
*/
class LIBAKONADISOCIALUTILS_EXPORT SocialFeedItem
{
public:
SocialFeedItem();
SocialFeedItem( const SocialFeedItem &other );
~SocialFeedItem();
SocialFeedItem &operator=(const SocialFeedItem &other);
/**
* This returns the service string such as "on Facebook", "on Twitter"
* It's used in the feed as the first line of the item
* eg. "Marty on Twitter:"
*
* @return Network string
*/
QString networkString() const;
/**
* Sets the network string for this item
*
* @param networkString The network string
*/
void setNetworkString( const QString &networkString );
/**
* @return Original post id (eg. Facebook post id, Twitter post id etc).
*/
QString postId() const;
/**
* Sets the original post id
*
* @param postId Post id from the network (eg. Facebook post id, Twitter post id etc).
*/
void setPostId( const QString &postId );
/**
* @return The text of the post that is displayed in the feed
*/
QString postText() const;
/**
* Sets the post text to be displayed in the feed
*
* @param text The post text in the feed
*/
void setPostText( const QString &text );
/**
* @return Link from the post
*/
QUrl postLink() const;
/**
* Sets the link the posts links to
*
* @param link URL of the link
*/
void setPostLink( const QUrl &link );
/**
* @return Link title from the post
*/
QString postLinkTitle() const;
/**
* Sets the link title the posts links to
*
* @param linkTitle Title of the link
*/
void setPostLinkTitle( const QString &linkTitle );
/**
* @return URL of an image associated with this post
*/
QUrl postImageUrl() const;
/**
* Sets the URL of an image associated with this post,
* it can be an image thumb, link thumb etc.
*
* @param imageUrl The URL of the image
*/
void setPostImageUrl( const QUrl &imageUrl );
/**
* @return Post user name
*/
QString userName() const;
/**
* Sets the network user name associated with this post
*
* @param userName Network user name
*/
void setUserName( const QString &userName );
/**
* @return Name that is displayed to the user
*/
QString userDisplayName() const;
/**
* Sets the name to be displayed to the user (full name usually)
*
* @param userDisplayName Display name
*/
void setUserDisplayName( const QString &userDisplayName );
/**
* @return Network user id
*/
QString userId() const;
/**
* Sets the network user id associated with this post
*
* @param userId Network user id
*/
void setUserId( const QString &userId );
/**
* @return Time of the post
*/
KDateTime postTime() const;
/**
* Sets the time string which was received from the network together with the format
* which could be received from the network as well or custom-supplied
*
* @param postTimeString The time string
* @param postTimeFormat The time format of the string
*/
void setPostTime( const QString &postTimeString, const QString &postTimeFormat );
/**
* @return The time format of the time string for this post
*/
QString postTimeFormat() const;
/**
* @return The original time string as received from the network
*/
QString postTimeString() const;
/**
* @return Additional info for the post, like number of comments, likes, retweed from etc
*/
QString postInfo() const;
/**
* Sets additional info for the post, like number of comments, likes, retweed from etc
*
* For now all just in one string
* @param postInfo The string with the info
*/
void setPostInfo( const QString &postInfo );
/**
* @return True if this post was shared from other user
*/
bool isShared() const;
/**
* Sets if this post was shared from other user
*
* @param shared True if shared, false if not
*/
void setShared( bool shared );
/**
* @return Display name of the user which was this post shared from
*/
QString sharedFrom() const;
/**
* Sets the display name of the user which was the original author of this post
*
* @param sharedFrom User which was this post shared from
*/
void setSharedFrom( const QString &sharedFrom );
/**
* @return User id of the user this was shared from
*/
QString sharedFromId() const;
/**
* Sets the user id of the user this was shared from
*
* @param sharedFromId User id of the original author
*/
void setSharedFromId( const QString &sharedFromId );
/**
* Sets if the user has liked/favorited the post or not
*
* @param liked True if the post was liked/favorited, false otherwise
*/
void setLiked( bool liked );
/**
* @return True if the post was liked/favorited by the signed-in user, false otherwise
*/
bool isLiked() const;
/**
* @return The whole original data as received from the network mapped in QVariantMap
*/
QVariantMap itemSourceMap() const;
/**
* Sets the original data which was received from the network and then mapped to a QVariantMap.
* This allows the full original data to be serialized along with the social feed item
* and reused later for whatever purpose
*
* @param itemSourceMap The original data in a QVariantMap
*
*/
void setItemSourceMap( const QVariantMap &itemSourceMap );
/**
* @return Url of the avatar picture
*/
QUrl avatarUrl() const;
/**
* Sets the url of the avatar picture to be displayed next to the post in the feed
*
* @param url Avatar url
*/
void setAvatarUrl( const QUrl &url );
/**
* Sets replies/comments for this post
* @param replies List of replies
*/
void setPostReplies( const QList<SocialFeedItem> &replies );
/**
* @return List of replies/comments to this post
*/
QList<SocialFeedItem> postReplies() const;
private:
QSharedDataPointer<SocialFeedItemPrivate> d;
};
}
Q_DECLARE_METATYPE( Akonadi::SocialFeedItem )
#endif // SOCIALFEEDITEM_H
|