Attica

activity.cpp
1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
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
13using namespace Attica;
14
15class Q_DECL_HIDDEN Activity::Private : public QSharedData
16{
17public:
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
44
45void Activity::setId(const QString &id)
46{
47 d->m_id = id;
48}
49
51{
52 return d->m_id;
53}
54
55void 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
85void Activity::setLink(const QUrl &v)
86{
87 d->m_link = v;
88}
89
91{
92 return d->m_link;
93}
94
96{
97 return !(d->m_id.isEmpty());
98}
Represents a single news item (also known as activity)
Definition activity.h:28
~Activity()
Destructor.
Definition activity.cpp:41
Activity & operator=(const Activity &other)
Assignment operator.
Definition activity.cpp:35
void setAssociatedPerson(const Person &associatedPerson)
Sets the user bound to the Activity.
Definition activity.cpp:55
QString message() const
Gets the message of the Activity.
Definition activity.cpp:80
void setLink(const QUrl &link)
Sets the link to further information about this Activity.
Definition activity.cpp:85
void setMessage(const QString &message)
Sets the message of the Activity.
Definition activity.cpp:75
QString id() const
Gets the id of the Activity.
Definition activity.cpp:50
QUrl link() const
Gets the link to further information about this Activity.
Definition activity.cpp:90
void setTimestamp(const QDateTime &timestamp)
Sets the timestamp the Activity has been published.
Definition activity.cpp:65
Activity()
Creates an empty Activity.
Definition activity.cpp:25
QDateTime timestamp() const
Gets the timestamp the Activity has been published.
Definition activity.cpp:70
Person associatedPerson() const
Gets the user bound to the Activity.
Definition activity.cpp:60
bool isValid() const
Checks whether this Activity has an id.
Definition activity.cpp:95
void setId(const QString &id)
Sets the id of the Activity.
Definition activity.cpp:45
Represents a person.
Definition person.h:29
The Attica namespace,.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.