Attica

activity.cpp
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2008 Cornelius Schumacher <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8 
9 #include "activity.h"
10 
11 #include <QDateTime>
12 
13 using namespace Attica;
14 
15 class Activity::Private : public QSharedData
16 {
17 public:
18  QString m_id;
19  Person m_associatedPerson;
20  QDateTime m_timestamp;
21  QString m_message;
22  QUrl m_link;
23 };
24 
25 Activity::Activity() : d(new Private)
26 {
27 }
28 
30  : d(other.d)
31 {
32 }
33 
35 {
36  d = other.d;
37  return *this;
38 }
39 
41 {
42 }
43 
44 void Activity::setId(const QString &id)
45 {
46  d->m_id = id;
47 }
48 
50 {
51  return d->m_id;
52 }
53 
55 {
56  d->m_associatedPerson = associatedPerson;
57 }
58 
60 {
61  return d->m_associatedPerson;
62 }
63 
65 {
66  d->m_timestamp = date;
67 }
68 
70 {
71  return d->m_timestamp;
72 }
73 
75 {
76  d->m_message = c;
77 }
78 
80 {
81  return d->m_message;
82 }
83 
84 void Activity::setLink(const QUrl &v)
85 {
86  d->m_link = v;
87 }
88 
90 {
91  return d->m_link;
92 }
93 
94 bool Activity::isValid() const
95 {
96  return !(d->m_id.isEmpty());
97 }
void setId(const QString &id)
Sets the id of the Activity.
Definition: activity.cpp:44
Represents a single news item (also known as activity)
Definition: activity.h:26
void setLink(const QUrl &link)
Sets the link to further information about this Activity.
Definition: activity.cpp:84
void setTimestamp(const QDateTime &timestamp)
Sets the timestamp the Activity has been published.
Definition: activity.cpp:64
QString id() const
Gets the id of the Activity.
Definition: activity.cpp:49
QString message() const
Gets the message of the Activity.
Definition: activity.cpp:79
QUrl link() const
Gets the link to further information about this Activity.
Definition: activity.cpp:89
bool isValid() const
Checks whether this Activity has an id.
Definition: activity.cpp:94
~Activity()
Destructor.
Definition: activity.cpp:40
Activity()
Creates an empty Activity.
Definition: activity.cpp:25
QDateTime timestamp() const
Gets the timestamp the Activity has been published.
Definition: activity.cpp:69
Activity & operator=(const Activity &other)
Assignment operator.
Definition: activity.cpp:34
Person associatedPerson() const
Gets the user bound to the Activity.
Definition: activity.cpp:59
void setAssociatedPerson(const Person &associatedPerson)
Sets the user bound to the Activity.
Definition: activity.cpp:54
void setMessage(const QString &message)
Sets the message of the Activity.
Definition: activity.cpp:74
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 11 2020 23:03:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.