File indexing completed on 2024-03-24 15:23:47

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2008 Cornelius Schumacher <schumacher@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 #ifndef ATTICA_ACTIVITY_H
0009 #define ATTICA_ACTIVITY_H
0010 
0011 #include <QList>
0012 #include <QSharedDataPointer>
0013 #include <QUrl>
0014 
0015 #include "attica_export.h"
0016 #include "person.h"
0017 
0018 class QDateTime;
0019 
0020 namespace Attica
0021 {
0022 /**
0023  * @class Activity activity.h <Attica/Activity>
0024  *
0025  * Represents a single news item (also known as activity)
0026  */
0027 class ATTICA_EXPORT Activity
0028 {
0029 public:
0030     typedef QList<Activity> List;
0031     class Parser;
0032 
0033     /**
0034      * Creates an empty Activity
0035      */
0036     Activity();
0037 
0038     /**
0039      * Copy constructor.
0040      * @param other the Activity to copy from
0041      */
0042     Activity(const Activity &other);
0043 
0044     /**
0045      * Assignment operator.
0046      * @param other the Activity to assign from
0047      * @return pointer to this Activity
0048      */
0049     Activity &operator=(const Activity &other);
0050 
0051     /**
0052      * Destructor.
0053      */
0054     ~Activity();
0055 
0056     /**
0057      * Sets the id of the Activity.
0058      * The id uniquely identifies an Activity with the OCS API.
0059      * @param id the new id
0060      */
0061     void setId(const QString &id);
0062 
0063     /**
0064      * Gets the id of the Activity.
0065      * The id uniquely identifies an Activity with the OCS API.
0066      * @return the id
0067      */
0068     QString id() const;
0069 
0070     /**
0071      * Sets the user bound to the Activity.
0072      * @param id the new user
0073      */
0074     void setAssociatedPerson(const Person &associatedPerson);
0075 
0076     /**
0077      * Gets the user bound to the Activity.
0078      * @return the user
0079      */
0080     Person associatedPerson() const;
0081 
0082     /**
0083      * Sets the timestamp the Activity has been published.
0084      * @param timestamp the new timestamp
0085      */
0086     void setTimestamp(const QDateTime &timestamp);
0087 
0088     /**
0089      * Gets the timestamp the Activity has been published.
0090      * @return the timestamp
0091      */
0092     QDateTime timestamp() const;
0093 
0094     /**
0095      * Sets the message of the Activity.
0096      * @param message the new message
0097      */
0098     void setMessage(const QString &message);
0099 
0100     /**
0101      * Gets the message of the Activity.
0102      * @return the message
0103      */
0104     QString message() const;
0105 
0106     /**
0107      * Sets the link to further information about this Activity.
0108      * @param link the new link
0109      */
0110     void setLink(const QUrl &link);
0111 
0112     /**
0113      * Gets the link to further information about this Activity.
0114      * @return the link
0115      */
0116     QUrl link() const;
0117 
0118     /**
0119      * Checks whether this Activity has an id
0120      * @return @c true if an id has been set, @c false otherwise
0121      */
0122     bool isValid() const;
0123 
0124 private:
0125     class Private;
0126     QSharedDataPointer<Private> d;
0127 };
0128 
0129 }
0130 
0131 #endif