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 | |
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 | |
25 | Activity::Activity() |
26 | : d(new Private) |
27 | { |
28 | } |
29 | |
30 | Activity::Activity(const Attica::Activity &other) |
31 | : d(other.d) |
32 | { |
33 | } |
34 | |
35 | Activity &Activity::operator=(const Attica::Activity &other) |
36 | { |
37 | d = other.d; |
38 | return *this; |
39 | } |
40 | |
41 | Activity::~Activity() |
42 | { |
43 | } |
44 | |
45 | void Activity::setId(const QString &id) |
46 | { |
47 | d->m_id = id; |
48 | } |
49 | |
50 | QString Activity::id() const |
51 | { |
52 | return d->m_id; |
53 | } |
54 | |
55 | void Activity::setAssociatedPerson(const Person &associatedPerson) |
56 | { |
57 | d->m_associatedPerson = associatedPerson; |
58 | } |
59 | |
60 | Person Activity::associatedPerson() const |
61 | { |
62 | return d->m_associatedPerson; |
63 | } |
64 | |
65 | void Activity::setTimestamp(const QDateTime &date) |
66 | { |
67 | d->m_timestamp = date; |
68 | } |
69 | |
70 | QDateTime Activity::timestamp() const |
71 | { |
72 | return d->m_timestamp; |
73 | } |
74 | |
75 | void Activity::setMessage(const QString &c) |
76 | { |
77 | d->m_message = c; |
78 | } |
79 | |
80 | QString Activity::message() const |
81 | { |
82 | return d->m_message; |
83 | } |
84 | |
85 | void Activity::setLink(const QUrl &v) |
86 | { |
87 | d->m_link = v; |
88 | } |
89 | |
90 | QUrl Activity::link() const |
91 | { |
92 | return d->m_link; |
93 | } |
94 | |
95 | bool Activity::isValid() const |
96 | { |
97 | return !(d->m_id.isEmpty()); |
98 | } |
99 |