Welcome to mirror list, hosted at ThFree Co, Russian Federation.

activitydata.h « gui « src - github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2c66a2993601404619d3b99e16370e9a72529a17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * 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
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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>

#include "account.h"

namespace OCC {
/**
 * @brief The ActivityLink class describes actions of an activity
 *
 * These are part of notifications which are mapped into activities.
 */

class ActivityLink
{
public:
    QString _label;
    QString _link;
    QByteArray _verb;
    bool _isPrimary;
};

/* ==================================================================== */
/**
 * @brief Activity Structure
 * @ingroup gui
 *
 * contains all the information describing a single activity.
 */

class Activity
{
public:
    using Identifier = qlonglong;
    enum Type {
        ActivityType,
        NotificationType
    };
    Activity() = default;
    explicit Activity(Type type, Identifier id, AccountPtr acc, const QString &subject, const QString &message, const QString &file, const QUrl &link, const QDateTime &dateTime, const QVector<ActivityLink> &&links = {});

    Type type() const;

    Identifier id() const;

    QString subject() const;

    QString message() const;

    QString file() const;

    QUrl link() const;

    QDateTime dateTime() const;

    QString accName() const;

    QUuid uuid() const;

    const QVector<ActivityLink> &links() const;

    bool operator==(const Activity &lhs) const;

private:
    Type _type;
    Identifier _id;
    QString _accName; /* display name of the account */
    QUuid _uuid; /* uuid of the account */
    QString _subject;
    QString _message;
    QString _file;
    QUrl _link;
    QDateTime _dateTime;

    QVector<ActivityLink> _links; /* These links are transformed into buttons that
                                   * call links as reactions on the activity */
};


/* ==================================================================== */
/**
 * @brief The ActivityList
 * @ingroup gui
 *
 * A QList based list of Activities
 */

typedef QList<Activity> ActivityList;
}

#endif // ACTIVITYDATA_H