aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/rooms.h
blob: 7d690ec88209dece5eee31d846d2de8e24e3af44 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "jobs/basejob.h"

#include "events/roommemberevent.h"
#include "events/eventloader.h"
#include <QtCore/QHash>
#include "converters.h"

namespace QMatrixClient
{
    // Operations

    class GetOneRoomEventJob : public BaseJob
    {
        public:
            explicit GetOneRoomEventJob(const QString& roomId, const QString& eventId);

            /** Construct a URL out of baseUrl and usual parameters passed to
             * GetOneRoomEventJob. This function can be used when
             * a URL for GetOneRoomEventJob is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventId);

            ~GetOneRoomEventJob() override;

            // Result properties

            EventPtr&& data();

        protected:
            Status parseJson(const QJsonDocument& data) override;

        private:
            class Private;
            QScopedPointer<Private> d;
    };

    class GetRoomStateWithKeyJob : public BaseJob
    {
        public:
            explicit GetRoomStateWithKeyJob(const QString& roomId, const QString& eventType, const QString& stateKey);

            /** Construct a URL out of baseUrl and usual parameters passed to
             * GetRoomStateWithKeyJob. This function can be used when
             * a URL for GetRoomStateWithKeyJob is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventType, const QString& stateKey);

            ~GetRoomStateWithKeyJob() override;

            // Result properties

            StateEventPtr&& data();

        protected:
            Status parseJson(const QJsonDocument& data) override;

        private:
            class Private;
            QScopedPointer<Private> d;
    };

    class GetRoomStateByTypeJob : public BaseJob
    {
        public:
            explicit GetRoomStateByTypeJob(const QString& roomId, const QString& eventType);

            /** Construct a URL out of baseUrl and usual parameters passed to
             * GetRoomStateByTypeJob. This function can be used when
             * a URL for GetRoomStateByTypeJob is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId, const QString& eventType);

            ~GetRoomStateByTypeJob() override;

            // Result properties

            StateEventPtr&& data();

        protected:
            Status parseJson(const QJsonDocument& data) override;

        private:
            class Private;
            QScopedPointer<Private> d;
    };

    class GetRoomStateJob : public BaseJob
    {
        public:
            explicit GetRoomStateJob(const QString& roomId);

            /** Construct a URL out of baseUrl and usual parameters passed to
             * GetRoomStateJob. This function can be used when
             * a URL for GetRoomStateJob is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId);

            ~GetRoomStateJob() override;

            // Result properties

            StateEvents&& data();

        protected:
            Status parseJson(const QJsonDocument& data) override;

        private:
            class Private;
            QScopedPointer<Private> d;
    };

    class GetMembersByRoomJob : public BaseJob
    {
        public:
            explicit GetMembersByRoomJob(const QString& roomId);

            /** Construct a URL out of baseUrl and usual parameters passed to
             * GetMembersByRoomJob. This function can be used when
             * a URL for GetMembersByRoomJob is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId);

            ~GetMembersByRoomJob() override;

            // Result properties

            EventsArray<RoomMemberEvent>&& chunk();

        protected:
            Status parseJson(const QJsonDocument& data) override;

        private:
            class Private;
            QScopedPointer<Private> d;
    };

    class GetJoinedMembersByRoomJob : public BaseJob
    {
        public:
            // Inner data structures

            struct RoomMember
            {
                QString displayName;
                QString avatarUrl;
            };

            // Construction/destruction

            explicit GetJoinedMembersByRoomJob(const QString& roomId);

            /** Construct a URL out of baseUrl and usual parameters passed to
             * GetJoinedMembersByRoomJob. This function can be used when
             * a URL for GetJoinedMembersByRoomJob is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId);

            ~GetJoinedMembersByRoomJob() override;

            // Result properties

            const QHash<QString, RoomMember>& joined() const;

        protected:
            Status parseJson(const QJsonDocument& data) override;

        private:
            class Private;
            QScopedPointer<Private> d;
    };
} // namespace QMatrixClient