• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
  • socialutils
socialfeeditem.cpp
1 /*
2  Copyright (C) 2012 Martin Klapetek <martin.klapetek@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Lesser General Public License as published by
6  the Free Software Foundation; either version 2.1 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #include "socialfeeditem.h"
21 #include "socialfeeditem_p.h"
22 
23 #include <KDateTime>
24 
25 #include <qjson/qobjecthelper.h>
26 
27 Akonadi::SocialFeedItem::SocialFeedItem()
28  : d( new SocialFeedItemPrivate )
29 {
30 }
31 
32 Akonadi::SocialFeedItem::SocialFeedItem( const Akonadi::SocialFeedItem &other )
33 {
34  d = other.d;
35 }
36 
37 Akonadi::SocialFeedItem::~SocialFeedItem()
38 {
39 }
40 
41 Akonadi::SocialFeedItem& Akonadi::SocialFeedItem::operator=(const Akonadi::SocialFeedItem& other)
42 {
43  if ( this == &other ) return *this; //Protect against self-assignment
44  d = other.d;
45  return *this;
46 }
47 
48 QString Akonadi::SocialFeedItem::networkString() const
49 {
50  return d->networkString;
51 }
52 
53 void Akonadi::SocialFeedItem::setNetworkString( const QString &networkString )
54 {
55  d->networkString = networkString;
56 }
57 
58 QString Akonadi::SocialFeedItem::postId() const
59 {
60  return d->postId;
61 }
62 
63 void Akonadi::SocialFeedItem::setPostId( const QString &postId )
64 {
65  d->postId = postId;
66 }
67 
68 QString Akonadi::SocialFeedItem::postText() const
69 {
70  return d->postText;
71 }
72 
73 void Akonadi::SocialFeedItem::setPostText( const QString &postText )
74 {
75  d->postText = postText;
76 }
77 
78 QUrl Akonadi::SocialFeedItem::postLink() const
79 {
80  return d->postLink;
81 }
82 
83 void Akonadi::SocialFeedItem::setPostLink( const QUrl &link )
84 {
85  d->postLink = link;
86 }
87 
88 QString Akonadi::SocialFeedItem::postLinkTitle() const
89 {
90  return d->postLinkTitle;
91 }
92 
93 void Akonadi::SocialFeedItem::setPostLinkTitle( const QString &linkTitle )
94 {
95  d->postLinkTitle = linkTitle;
96 }
97 
98 QUrl Akonadi::SocialFeedItem::postImageUrl() const
99 {
100  return d->postImageUrl;
101 }
102 
103 void Akonadi::SocialFeedItem::setPostImageUrl( const QUrl &imageUrl )
104 {
105  d->postImageUrl = imageUrl;
106 }
107 
108 KDateTime Akonadi::SocialFeedItem::postTime() const
109 {
110  return d->postTime;
111 }
112 
113 QString Akonadi::SocialFeedItem::postTimeString() const
114 {
115  return d->postTimeString;
116 }
117 
118 QString Akonadi::SocialFeedItem::postInfo() const
119 {
120  return d->postInfo;
121 }
122 
123 void Akonadi::SocialFeedItem::setPostInfo( const QString &postInfo )
124 {
125  d->postInfo = postInfo;
126 }
127 
128 void Akonadi::SocialFeedItem::setPostTime( const QString &postTimeString,
129  const QString &postTimeFormat )
130 {
131  d->postTimeString = postTimeString;
132  d->postTimeFormat = postTimeFormat;
133  d->postTime = KDateTime::fromString( d->postTimeString, d->postTimeFormat );
134 }
135 
136 QString Akonadi::SocialFeedItem::postTimeFormat() const
137 {
138  return d->postTimeFormat;
139 }
140 
141 QString Akonadi::SocialFeedItem::userId() const
142 {
143  return d->userId;
144 }
145 
146 void Akonadi::SocialFeedItem::setUserId( const QString &userId )
147 {
148  d->userId = userId;
149 }
150 
151 QString Akonadi::SocialFeedItem::userName() const
152 {
153  return d->userName;
154 }
155 
156 void Akonadi::SocialFeedItem::setUserName( const QString &userName )
157 {
158  d->userName = userName;
159 }
160 
161 QString Akonadi::SocialFeedItem::userDisplayName() const
162 {
163  return d->userDisplayName;
164 }
165 
166 void Akonadi::SocialFeedItem::setUserDisplayName ( const QString &userDisplayName )
167 {
168  d->userDisplayName = userDisplayName;
169 }
170 
171 bool Akonadi::SocialFeedItem::isShared() const
172 {
173  return d->shared;
174 }
175 
176 void Akonadi::SocialFeedItem::setShared( bool shared )
177 {
178  d->shared = shared;
179 }
180 
181 QString Akonadi::SocialFeedItem::sharedFrom() const
182 {
183  return d->sharedFrom;
184 }
185 
186 void Akonadi::SocialFeedItem::setSharedFrom( const QString &sharedFrom )
187 {
188  d->sharedFrom = sharedFrom;
189 }
190 
191 QString Akonadi::SocialFeedItem::sharedFromId() const
192 {
193  return d->sharedFromId;
194 }
195 
196 void Akonadi::SocialFeedItem::setSharedFromId( const QString &sharedFromId )
197 {
198  d->sharedFromId = sharedFromId;
199 }
200 
201 QVariantMap Akonadi::SocialFeedItem::itemSourceMap() const
202 {
203  return d->itemSourceMap;
204 }
205 
206 void Akonadi::SocialFeedItem::setItemSourceMap( const QVariantMap &itemSourceMap )
207 {
208  d->itemSourceMap = itemSourceMap;
209 }
210 
211 QUrl Akonadi::SocialFeedItem::avatarUrl() const
212 {
213  return d->avatarUrl;
214 }
215 
216 void Akonadi::SocialFeedItem::setAvatarUrl( const QUrl &url )
217 {
218  d->avatarUrl = url;
219 }
220 
221 bool Akonadi::SocialFeedItem::isLiked() const
222 {
223  return d->liked;
224 }
225 
226 void Akonadi::SocialFeedItem::setLiked( bool liked )
227 {
228  d->liked = liked;
229 }
230 
231 QList<Akonadi::SocialFeedItem> Akonadi::SocialFeedItem::postReplies() const
232 {
233  return d->replies;
234 }
235 
236 void Akonadi::SocialFeedItem::setPostReplies( const QList<Akonadi::SocialFeedItem> &replies )
237 {
238  d->replies = replies;
239 }
Akonadi::SocialFeedItem::userName
QString userName() const
Definition: socialfeeditem.cpp:151
Akonadi::SocialFeedItem::setPostReplies
void setPostReplies(const QList< SocialFeedItem > &replies)
Sets replies/comments for this post.
Definition: socialfeeditem.cpp:236
Akonadi::SocialFeedItem::sharedFrom
QString sharedFrom() const
Definition: socialfeeditem.cpp:181
Akonadi::SocialFeedItem::postLink
QUrl postLink() const
Definition: socialfeeditem.cpp:78
Akonadi::SocialFeedItem::setUserDisplayName
void setUserDisplayName(const QString &userDisplayName)
Sets the name to be displayed to the user (full name usually)
Definition: socialfeeditem.cpp:166
Akonadi::SocialFeedItem::postId
QString postId() const
Definition: socialfeeditem.cpp:58
Akonadi::SocialFeedItem::setSharedFrom
void setSharedFrom(const QString &sharedFrom)
Sets the display name of the user which was the original author of this post.
Definition: socialfeeditem.cpp:186
Akonadi::SocialFeedItem::userId
QString userId() const
Definition: socialfeeditem.cpp:141
Akonadi::SocialFeedItem::itemSourceMap
QVariantMap itemSourceMap() const
Definition: socialfeeditem.cpp:201
Akonadi::SocialFeedItem::setPostLinkTitle
void setPostLinkTitle(const QString &linkTitle)
Sets the link title the posts links to.
Definition: socialfeeditem.cpp:93
Akonadi::SocialFeedItem::setLiked
void setLiked(bool liked)
Sets if the user has liked/favorited the post or not.
Definition: socialfeeditem.cpp:226
Akonadi::SocialFeedItem::postReplies
QList< SocialFeedItem > postReplies() const
Definition: socialfeeditem.cpp:231
Akonadi::SocialFeedItem::setPostImageUrl
void setPostImageUrl(const QUrl &imageUrl)
Sets the URL of an image associated with this post, it can be an image thumb, link thumb etc...
Definition: socialfeeditem.cpp:103
Akonadi::SocialFeedItem::userDisplayName
QString userDisplayName() const
Definition: socialfeeditem.cpp:161
Akonadi::SocialFeedItem::postTime
KDateTime postTime() const
Definition: socialfeeditem.cpp:108
Akonadi::SocialFeedItem::setNetworkString
void setNetworkString(const QString &networkString)
Sets the network string for this item.
Definition: socialfeeditem.cpp:53
Akonadi::SocialFeedItem::postImageUrl
QUrl postImageUrl() const
Definition: socialfeeditem.cpp:98
Akonadi::SocialFeedItem::setSharedFromId
void setSharedFromId(const QString &sharedFromId)
Sets the user id of the user this was shared from.
Definition: socialfeeditem.cpp:196
Akonadi::SocialFeedItem::setPostLink
void setPostLink(const QUrl &link)
Sets the link the posts links to.
Definition: socialfeeditem.cpp:83
Akonadi::SocialFeedItem::setItemSourceMap
void setItemSourceMap(const QVariantMap &itemSourceMap)
Sets the original data which was received from the network and then mapped to a QVariantMap.
Definition: socialfeeditem.cpp:206
Akonadi::SocialFeedItem::postInfo
QString postInfo() const
Definition: socialfeeditem.cpp:118
Akonadi::SocialFeedItem::isLiked
bool isLiked() const
Definition: socialfeeditem.cpp:221
Akonadi::SocialFeedItem::setPostTime
void setPostTime(const QString &postTimeString, const QString &postTimeFormat)
Sets the time string which was received from the network together with the format which could be rece...
Definition: socialfeeditem.cpp:128
Akonadi::SocialFeedItem::postLinkTitle
QString postLinkTitle() const
Definition: socialfeeditem.cpp:88
Akonadi::SocialFeedItem
Class representing one entry in the social feed.
Definition: socialfeeditem.h:38
Akonadi::SocialFeedItem::setPostId
void setPostId(const QString &postId)
Sets the original post id.
Definition: socialfeeditem.cpp:63
Akonadi::SocialFeedItem::setUserId
void setUserId(const QString &userId)
Sets the network user id associated with this post.
Definition: socialfeeditem.cpp:146
Akonadi::SocialFeedItem::avatarUrl
QUrl avatarUrl() const
Definition: socialfeeditem.cpp:211
Akonadi::SocialFeedItem::postText
QString postText() const
Definition: socialfeeditem.cpp:68
Akonadi::SocialFeedItem::postTimeFormat
QString postTimeFormat() const
Definition: socialfeeditem.cpp:136
Akonadi::SocialFeedItem::postTimeString
QString postTimeString() const
Definition: socialfeeditem.cpp:113
Akonadi::SocialFeedItem::setPostText
void setPostText(const QString &text)
Sets the post text to be displayed in the feed.
Definition: socialfeeditem.cpp:73
Akonadi::SocialFeedItem::networkString
QString networkString() const
This returns the service string such as &quot;on Facebook&quot;, &quot;on Twitter&quot; It&#39;s used in the feed as the ...
Definition: socialfeeditem.cpp:48
Akonadi::SocialFeedItem::setShared
void setShared(bool shared)
Sets if this post was shared from other user.
Definition: socialfeeditem.cpp:176
Akonadi::SocialFeedItem::setPostInfo
void setPostInfo(const QString &postInfo)
Sets additional info for the post, like number of comments, likes, retweed from etc.
Definition: socialfeeditem.cpp:123
Akonadi::SocialFeedItem::isShared
bool isShared() const
Definition: socialfeeditem.cpp:171
Akonadi::SocialFeedItem::sharedFromId
QString sharedFromId() const
Definition: socialfeeditem.cpp:191
Akonadi::SocialFeedItem::setUserName
void setUserName(const QString &userName)
Sets the network user name associated with this post.
Definition: socialfeeditem.cpp:156
Akonadi::SocialFeedItem::setAvatarUrl
void setAvatarUrl(const QUrl &url)
Sets the url of the avatar picture to be displayed next to the post in the feed.
Definition: socialfeeditem.cpp:216
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:19 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal