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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 ) {
44  return *this; //Protect against self-assignment
45  }
46  d = other.d;
47  return *this;
48 }
49 
50 QString Akonadi::SocialFeedItem::networkString() const
51 {
52  return d->networkString;
53 }
54 
55 void Akonadi::SocialFeedItem::setNetworkString( const QString &networkString )
56 {
57  d->networkString = networkString;
58 }
59 
60 QString Akonadi::SocialFeedItem::postId() const
61 {
62  return d->postId;
63 }
64 
65 void Akonadi::SocialFeedItem::setPostId( const QString &postId )
66 {
67  d->postId = postId;
68 }
69 
70 QString Akonadi::SocialFeedItem::postText() const
71 {
72  return d->postText;
73 }
74 
75 void Akonadi::SocialFeedItem::setPostText( const QString &postText )
76 {
77  d->postText = postText;
78 }
79 
80 QUrl Akonadi::SocialFeedItem::postLink() const
81 {
82  return d->postLink;
83 }
84 
85 void Akonadi::SocialFeedItem::setPostLink( const QUrl &link )
86 {
87  d->postLink = link;
88 }
89 
90 QString Akonadi::SocialFeedItem::postLinkTitle() const
91 {
92  return d->postLinkTitle;
93 }
94 
95 void Akonadi::SocialFeedItem::setPostLinkTitle( const QString &linkTitle )
96 {
97  d->postLinkTitle = linkTitle;
98 }
99 
100 QUrl Akonadi::SocialFeedItem::postImageUrl() const
101 {
102  return d->postImageUrl;
103 }
104 
105 void Akonadi::SocialFeedItem::setPostImageUrl( const QUrl &imageUrl )
106 {
107  d->postImageUrl = imageUrl;
108 }
109 
110 KDateTime Akonadi::SocialFeedItem::postTime() const
111 {
112  return d->postTime;
113 }
114 
115 QString Akonadi::SocialFeedItem::postTimeString() const
116 {
117  return d->postTimeString;
118 }
119 
120 QString Akonadi::SocialFeedItem::postInfo() const
121 {
122  return d->postInfo;
123 }
124 
125 void Akonadi::SocialFeedItem::setPostInfo( const QString &postInfo )
126 {
127  d->postInfo = postInfo;
128 }
129 
130 void Akonadi::SocialFeedItem::setPostTime( const QString &postTimeString,
131  const QString &postTimeFormat )
132 {
133  d->postTimeString = postTimeString;
134  d->postTimeFormat = postTimeFormat;
135  d->postTime = KDateTime::fromString( d->postTimeString, d->postTimeFormat );
136 }
137 
138 QString Akonadi::SocialFeedItem::postTimeFormat() const
139 {
140  return d->postTimeFormat;
141 }
142 
143 QString Akonadi::SocialFeedItem::userId() const
144 {
145  return d->userId;
146 }
147 
148 void Akonadi::SocialFeedItem::setUserId( const QString &userId )
149 {
150  d->userId = userId;
151 }
152 
153 QString Akonadi::SocialFeedItem::userName() const
154 {
155  return d->userName;
156 }
157 
158 void Akonadi::SocialFeedItem::setUserName( const QString &userName )
159 {
160  d->userName = userName;
161 }
162 
163 QString Akonadi::SocialFeedItem::userDisplayName() const
164 {
165  return d->userDisplayName;
166 }
167 
168 void Akonadi::SocialFeedItem::setUserDisplayName ( const QString &userDisplayName )
169 {
170  d->userDisplayName = userDisplayName;
171 }
172 
173 bool Akonadi::SocialFeedItem::isShared() const
174 {
175  return d->shared;
176 }
177 
178 void Akonadi::SocialFeedItem::setShared( bool shared )
179 {
180  d->shared = shared;
181 }
182 
183 QString Akonadi::SocialFeedItem::sharedFrom() const
184 {
185  return d->sharedFrom;
186 }
187 
188 void Akonadi::SocialFeedItem::setSharedFrom( const QString &sharedFrom )
189 {
190  d->sharedFrom = sharedFrom;
191 }
192 
193 QString Akonadi::SocialFeedItem::sharedFromId() const
194 {
195  return d->sharedFromId;
196 }
197 
198 void Akonadi::SocialFeedItem::setSharedFromId( const QString &sharedFromId )
199 {
200  d->sharedFromId = sharedFromId;
201 }
202 
203 QVariantMap Akonadi::SocialFeedItem::itemSourceMap() const
204 {
205  return d->itemSourceMap;
206 }
207 
208 void Akonadi::SocialFeedItem::setItemSourceMap( const QVariantMap &itemSourceMap )
209 {
210  d->itemSourceMap = itemSourceMap;
211 }
212 
213 QUrl Akonadi::SocialFeedItem::avatarUrl() const
214 {
215  return d->avatarUrl;
216 }
217 
218 void Akonadi::SocialFeedItem::setAvatarUrl( const QUrl &url )
219 {
220  d->avatarUrl = url;
221 }
222 
223 bool Akonadi::SocialFeedItem::isLiked() const
224 {
225  return d->liked;
226 }
227 
228 void Akonadi::SocialFeedItem::setLiked( bool liked )
229 {
230  d->liked = liked;
231 }
232 
233 QList<Akonadi::SocialFeedItem> Akonadi::SocialFeedItem::postReplies() const
234 {
235  return d->replies;
236 }
237 
238 void Akonadi::SocialFeedItem::setPostReplies( const QList<Akonadi::SocialFeedItem> &replies )
239 {
240  d->replies = replies;
241 }
Akonadi::SocialFeedItem::userName
QString userName() const
Definition: socialfeeditem.cpp:153
Akonadi::SocialFeedItem::setPostReplies
void setPostReplies(const QList< SocialFeedItem > &replies)
Sets replies/comments for this post.
Definition: socialfeeditem.cpp:238
Akonadi::SocialFeedItem::sharedFrom
QString sharedFrom() const
Definition: socialfeeditem.cpp:183
Akonadi::SocialFeedItem::postLink
QUrl postLink() const
Definition: socialfeeditem.cpp:80
Akonadi::SocialFeedItem::setUserDisplayName
void setUserDisplayName(const QString &userDisplayName)
Sets the name to be displayed to the user (full name usually)
Definition: socialfeeditem.cpp:168
Akonadi::SocialFeedItem::postId
QString postId() const
Definition: socialfeeditem.cpp:60
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:188
Akonadi::SocialFeedItem::userId
QString userId() const
Definition: socialfeeditem.cpp:143
Akonadi::SocialFeedItem::itemSourceMap
QVariantMap itemSourceMap() const
Definition: socialfeeditem.cpp:203
Akonadi::SocialFeedItem::setPostLinkTitle
void setPostLinkTitle(const QString &linkTitle)
Sets the link title the posts links to.
Definition: socialfeeditem.cpp:95
Akonadi::SocialFeedItem::setLiked
void setLiked(bool liked)
Sets if the user has liked/favorited the post or not.
Definition: socialfeeditem.cpp:228
Akonadi::SocialFeedItem::postReplies
QList< SocialFeedItem > postReplies() const
Definition: socialfeeditem.cpp:233
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:105
Akonadi::SocialFeedItem::userDisplayName
QString userDisplayName() const
Definition: socialfeeditem.cpp:163
Akonadi::SocialFeedItem::postTime
KDateTime postTime() const
Definition: socialfeeditem.cpp:110
Akonadi::SocialFeedItem::setNetworkString
void setNetworkString(const QString &networkString)
Sets the network string for this item.
Definition: socialfeeditem.cpp:55
Akonadi::SocialFeedItem::postImageUrl
QUrl postImageUrl() const
Definition: socialfeeditem.cpp:100
Akonadi::SocialFeedItem::setSharedFromId
void setSharedFromId(const QString &sharedFromId)
Sets the user id of the user this was shared from.
Definition: socialfeeditem.cpp:198
Akonadi::SocialFeedItem::setPostLink
void setPostLink(const QUrl &link)
Sets the link the posts links to.
Definition: socialfeeditem.cpp:85
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:208
Akonadi::SocialFeedItem::postInfo
QString postInfo() const
Definition: socialfeeditem.cpp:120
Akonadi::SocialFeedItem::isLiked
bool isLiked() const
Definition: socialfeeditem.cpp:223
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:130
Akonadi::SocialFeedItem::postLinkTitle
QString postLinkTitle() const
Definition: socialfeeditem.cpp:90
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:65
Akonadi::SocialFeedItem::setUserId
void setUserId(const QString &userId)
Sets the network user id associated with this post.
Definition: socialfeeditem.cpp:148
Akonadi::SocialFeedItem::avatarUrl
QUrl avatarUrl() const
Definition: socialfeeditem.cpp:213
Akonadi::SocialFeedItem::postText
QString postText() const
Definition: socialfeeditem.cpp:70
Akonadi::SocialFeedItem::postTimeFormat
QString postTimeFormat() const
Definition: socialfeeditem.cpp:138
Akonadi::SocialFeedItem::postTimeString
QString postTimeString() const
Definition: socialfeeditem.cpp:115
Akonadi::SocialFeedItem::setPostText
void setPostText(const QString &text)
Sets the post text to be displayed in the feed.
Definition: socialfeeditem.cpp:75
Akonadi::SocialFeedItem::networkString
QString networkString() const
This returns the service string such as "on Facebook", "on Twitter" It's used in the feed as the firs...
Definition: socialfeeditem.cpp:50
Akonadi::SocialFeedItem::setShared
void setShared(bool shared)
Sets if this post was shared from other user.
Definition: socialfeeditem.cpp:178
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:125
Akonadi::SocialFeedItem::isShared
bool isShared() const
Definition: socialfeeditem.cpp:173
Akonadi::SocialFeedItem::sharedFromId
QString sharedFromId() const
Definition: socialfeeditem.cpp:193
Akonadi::SocialFeedItem::setUserName
void setUserName(const QString &userName)
Sets the network user name associated with this post.
Definition: socialfeeditem.cpp:158
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:218
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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