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 Q_DECL_HIDDEN 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 
26  : d(new Private)
27 {
28 }
29 
31  : d(other.d)
32 {
33 }
34 
36 {
37  d = other.d;
38  return *this;
39 }
40 
42 {
43 }
44 
45 void Activity::setId(const QString &id)
46 {
47  d->m_id = id;
48 }
49 
51 {
52  return d->m_id;
53 }
54 
55 void Activity::setAssociatedPerson(const Person &associatedPerson)
56 {
57  d->m_associatedPerson = associatedPerson;
58 }
59 
61 {
62  return d->m_associatedPerson;
63 }
64 
66 {
67  d->m_timestamp = date;
68 }
69 
71 {
72  return d->m_timestamp;
73 }
74 
76 {
77  d->m_message = c;
78 }
79 
81 {
82  return d->m_message;
83 }
84 
85 void Activity::setLink(const QUrl &v)
86 {
87  d->m_link = v;
88 }
89 
91 {
92  return d->m_link;
93 }
94 
95 bool Activity::isValid() const
96 {
97  return !(d->m_id.isEmpty());
98 }
void setAssociatedPerson(const Person &associatedPerson)
Sets the user bound to the Activity.
Definition: activity.cpp:55
QUrl link() const
Gets the link to further information about this Activity.
Definition: activity.cpp:90
QString message() const
Gets the message of the Activity.
Definition: activity.cpp:80
Activity & operator=(const Activity &other)
Assignment operator.
Definition: activity.cpp:35
~Activity()
Destructor.
Definition: activity.cpp:41
void setId(const QString &id)
Sets the id of the Activity.
Definition: activity.cpp:45
void setMessage(const QString &message)
Sets the message of the Activity.
Definition: activity.cpp:75
bool isValid() const
Checks whether this Activity has an id.
Definition: activity.cpp:95
QString id() const
Gets the id of the Activity.
Definition: activity.cpp:50
Activity()
Creates an empty Activity.
Definition: activity.cpp:25
QDateTime timestamp() const
Gets the timestamp the Activity has been published.
Definition: activity.cpp:70
void setTimestamp(const QDateTime &timestamp)
Sets the timestamp the Activity has been published.
Definition: activity.cpp:65
The Attica namespace,.
Person associatedPerson() const
Gets the user bound to the Activity.
Definition: activity.cpp:60
void setLink(const QUrl &link)
Sets the link to further information about this Activity.
Definition: activity.cpp:85
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 04:08:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.