2016-03-11 13:37:45 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2016-10-25 12:00:07 +03:00
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-03-11 13:37:45 +03:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ACTIVITYDATA_H
|
|
|
|
#define ACTIVITYDATA_H
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
|
|
|
namespace OCC {
|
|
|
|
/**
|
|
|
|
* @brief The ActivityLink class describes actions of an activity
|
|
|
|
*
|
|
|
|
* These are part of notifications which are mapped into activities.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class ActivityLink
|
|
|
|
{
|
|
|
|
public:
|
2016-03-29 18:18:02 +03:00
|
|
|
QString _label;
|
|
|
|
QString _link;
|
|
|
|
QByteArray _verb;
|
|
|
|
bool _isPrimary;
|
2016-03-11 13:37:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/* ==================================================================== */
|
|
|
|
/**
|
|
|
|
* @brief Activity Structure
|
|
|
|
* @ingroup gui
|
|
|
|
*
|
|
|
|
* contains all the information describing a single activity.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class Activity
|
|
|
|
{
|
|
|
|
public:
|
2016-03-23 18:47:13 +03:00
|
|
|
typedef QPair<qlonglong, QString> Identifier;
|
|
|
|
|
2016-03-11 13:37:45 +03:00
|
|
|
enum Type {
|
|
|
|
ActivityType,
|
|
|
|
NotificationType
|
|
|
|
};
|
2016-03-23 18:47:13 +03:00
|
|
|
|
2016-03-11 13:37:45 +03:00
|
|
|
Type _type;
|
|
|
|
qlonglong _id;
|
|
|
|
QString _subject;
|
|
|
|
QString _message;
|
|
|
|
QString _file;
|
|
|
|
QUrl _link;
|
|
|
|
QDateTime _dateTime;
|
|
|
|
QString _accName;
|
|
|
|
|
|
|
|
QVector<ActivityLink> _links;
|
|
|
|
/**
|
|
|
|
* @brief Sort operator to sort the list youngest first.
|
|
|
|
* @param val
|
|
|
|
* @return
|
|
|
|
*/
|
2016-03-23 18:47:13 +03:00
|
|
|
|
2016-03-11 13:37:45 +03:00
|
|
|
|
2016-03-23 18:47:13 +03:00
|
|
|
Identifier ident() const;
|
2016-03-11 13:37:45 +03:00
|
|
|
};
|
|
|
|
|
2016-03-29 15:09:19 +03:00
|
|
|
bool operator==(const Activity &rhs, const Activity &lhs);
|
|
|
|
bool operator<(const Activity &rhs, const Activity &lhs);
|
|
|
|
|
2016-03-11 13:37:45 +03:00
|
|
|
/* ==================================================================== */
|
|
|
|
/**
|
|
|
|
* @brief The ActivityList
|
|
|
|
* @ingroup gui
|
|
|
|
*
|
|
|
|
* A QList based list of Activities
|
|
|
|
*/
|
|
|
|
|
2016-03-14 17:39:07 +03:00
|
|
|
typedef QList<Activity> ActivityList;
|
2016-03-11 13:37:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ACTIVITYDATA_H
|