1 | /* |
2 | * Copyright (C) by Klaas Freitag <freitag@owncloud.com> |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; either version 2 of the License, or |
7 | * (at your option) any later version. |
8 | * |
9 | * This program is distributed in the hope that it will be useful, but |
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
12 | * for more details. |
13 | */ |
14 | |
15 | #ifndef ACTIVITYDATA_H |
16 | #define ACTIVITYDATA_H |
17 | |
18 | #include <QtCore> |
19 | |
20 | namespace OCC { |
21 | /** |
22 | * @brief The ActivityLink class describes actions of an activity |
23 | * |
24 | * These are part of notifications which are mapped into activities. |
25 | */ |
26 | |
27 | class ActivityLink |
28 | { |
29 | public: |
30 | QString _label; |
31 | QString _link; |
32 | QByteArray _verb; |
33 | bool _isPrimary; |
34 | }; |
35 | |
36 | /* ==================================================================== */ |
37 | /** |
38 | * @brief Activity Structure |
39 | * @ingroup gui |
40 | * |
41 | * contains all the information describing a single activity. |
42 | */ |
43 | |
44 | class Activity |
45 | { |
46 | public: |
47 | typedef QPair<qlonglong, QString> Identifier; |
48 | |
49 | enum Type { |
50 | ActivityType, |
51 | NotificationType |
52 | }; |
53 | |
54 | Type _type; |
55 | qlonglong _id; |
56 | QString _subject; |
57 | QString _message; |
58 | QString _file; |
59 | QUrl _link; |
60 | QDateTime _dateTime; |
61 | QString _accName; /* display name of the account involved */ |
62 | |
63 | QVector<ActivityLink> _links; /* These links are transformed into buttons that |
64 | * call links as reactions on the activity */ |
65 | /** |
66 | * @brief Sort operator to sort the list youngest first. |
67 | * @param val |
68 | * @return |
69 | */ |
70 | |
71 | |
72 | Identifier ident() const; |
73 | }; |
74 | |
75 | bool operator==(const Activity &rhs, const Activity &lhs); |
76 | bool operator<(const Activity &rhs, const Activity &lhs); |
77 | |
78 | /* ==================================================================== */ |
79 | /** |
80 | * @brief The ActivityList |
81 | * @ingroup gui |
82 | * |
83 | * A QList based list of Activities |
84 | */ |
85 | |
86 | typedef QList<Activity> ActivityList; |
87 | } |
88 | |
89 | #endif // ACTIVITYDATA_H |
90 | |