From c4e80c1d1cd4365a386bb097e12ea15926f69917 Mon Sep 17 00:00:00 2001 From: James Graham Date: Tue, 2 May 2023 17:51:07 +0100 Subject: [PATCH] Document pollevent --- src/pollevent.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/pollevent.h b/src/pollevent.h index fa95ad9d9..377bf2015 100644 --- a/src/pollevent.h +++ b/src/pollevent.h @@ -8,16 +8,43 @@ namespace Quotient { +/** + * @class PollStartEvent + * + * Class to define a poll start event. + * + * See MSC3381 for full details on polls in the matrix spec + * https://github.com/matrix-org/matrix-spec-proposals/blob/travis/msc/polls/proposals/3381-polls.md. + * + * @sa Quotient::RoomEvent + */ class PollStartEvent : public RoomEvent { public: QUO_EVENT(PollStartEvent, "org.matrix.msc3381.poll.start"); explicit PollStartEvent(const QJsonObject &obj); + /** + * @brief The maximum number of options a user can select in a poll. + */ int maxSelections() const; + + /** + * @brief The question being asked in the poll. + */ QString question() const; }; +/** + * @class PollResponseEvent + * + * Class to define a poll response event. + * + * See MSC3381 for full details on polls in the matrix spec + * https://github.com/matrix-org/matrix-spec-proposals/blob/travis/msc/polls/proposals/3381-polls.md. + * + * @sa Quotient::RoomEvent + */ class PollResponseEvent : public RoomEvent { public: @@ -26,6 +53,16 @@ public: explicit PollResponseEvent(const QString &pollStartEventId, QStringList responses); }; +/** + * @class PollEndEvent + * + * Class to define a poll end event. + * + * See MSC3381 for full details on polls in the matrix spec + * https://github.com/matrix-org/matrix-spec-proposals/blob/travis/msc/polls/proposals/3381-polls.md. + * + * @sa Quotient::RoomEvent + */ class PollEndEvent : public RoomEvent { public: