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#ifndef ATTICA_ACTIVITY_H
9#define ATTICA_ACTIVITY_H
10
11#include <QList>
12#include <QSharedDataPointer>
13#include <QUrl>
14
15#include "attica_export.h"
16#include "person.h"
17
18class QDateTime;
19
20namespace Attica
21{
22/*!
23 * \class Attica::Activity
24 * \inheaderfile Attica/Activity
25 * \inmodule Attica
26 *
27 * \brief Represents a single news item (also known as activity).
28 */
29class ATTICA_EXPORT Activity
30{
31public:
32 /*!
33 *
34 */
35 typedef QList<Activity> List;
36 class Parser;
37
38 /*!
39 * Creates an empty Activity
40 */
41 Activity();
42
43 Activity(const Activity &other);
44
45 Activity &operator=(const Activity &other);
46
47 ~Activity();
48
49 /*!
50 * Sets the id of the Activity.
51 *
52 * The id uniquely identifies an Activity with the OCS API.
53 *
54 * \a id the new id
55 */
56 void setId(const QString &id);
57
58 /*!
59 * Gets the id of the Activity.
60 *
61 * The id uniquely identifies an Activity with the OCS API.
62 *
63 * Returns the id
64 */
65 QString id() const;
66
67 /*!
68 * Sets the user bound to the Activity.
69 *
70 * \a id the new user
71 */
72 void setAssociatedPerson(const Person &associatedPerson);
73
74 /*!
75 * Returns the user bound to the Activity.
76 */
77 Person associatedPerson() const;
78
79 /*!
80 * Sets the timestamp the Activity has been published.
81 *
82 * \a timestamp the new timestamp
83 */
84 void setTimestamp(const QDateTime &timestamp);
85
86 /*!
87 * Returns the timestamp the Activity has been published.
88 */
89 QDateTime timestamp() const;
90
91 /*!
92 * Sets the message of the Activity.
93 *
94 * \a message the new message
95 */
96 void setMessage(const QString &message);
97
98 /*!
99 * Returns the message of the Activity.
100 */
101 QString message() const;
102
103 /*!
104 * Sets the link to further information about this Activity.
105 *
106 * \a link the new link
107 */
108 void setLink(const QUrl &link);
109
110 /*!
111 * Returns the link to further information about this Activity.
112 */
113 QUrl link() const;
114
115 /*!
116 * Checks whether this Activity has an id
117 * Returns \c true if an id has been set, \c false otherwise
118 */
119 bool isValid() const;
120
121private:
122 class Private;
123 QSharedDataPointer<Private> d;
124};
125
126}
127
128#endif
129

source code of attica/src/activity.h