aboutsummaryrefslogtreecommitdiff
path: root/events/redactionevent.cpp
blob: bf467718b5913df72a1ee92661ded69b7dd2aaad (plain)
1
#include "redactionevent.h"
008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
{{>preamble}}
#pragma once

{{#operations}}#include "jobs/basejob.h"
{{/operations}}{{#models}}#include "converters.h"
{{/models}}
{{#imports}}#include {{_}}
{{/imports}}
namespace QMatrixClient
{
{{#models}}    // Data structures
{{#    model}}{{#description}}
    /// {{_}}{{/description}}
    struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{>cjoin}}{{/parents}}{{/parents?}}
    {
{{#vars}}{{#description}}        /// {{_}}
{{/description}}        {{>maybeOmittableType}} {{nameCamelCase}};
{{/vars}}{{#propertyMap}}{{#description}}        /// {{_}}
{{/description}}        {{>maybeOmittableType}} {{nameCamelCase}};
{{/propertyMap}}    };
    template <> struct JsonObjectConverter<{{name}}>
    {
        {{#in?}}static void dumpTo(QJsonObject& jo, const {{name}}& pod);
        {{/in?}}{{#out?}}static void fillFrom({{^propertyMap}}const QJsonObject&{{/propertyMap
                           }}{{#propertyMap}}QJsonObject{{/propertyMap}} jo, {{name}}& pod);
{{/out?}}    };
{{/model}}
{{/models}}{{#operations}}    // Operations
{{#    operation}}{{#summary}}
    /// {{summary}}{{#description?}}{{!add a linebreak between summary and description if both exist}}
    ///{{/description?}}{{/summary}}{{#description}}
    /// {{_}}{{/description}}
    class {{camelCaseOperationId}}Job : public BaseJob
    {
        public:{{#models}}
            // Inner data structures
{{#            model}}{{#description}}
            /// {{_}}{{/description}}
            struct {{name}}{{#parents?}} : {{#parents}}{{name}}{{>cjoin}}{{/parents}}{{/parents?}}
            {
{{#vars}}{{#description}}                /// {{_}}
{{/description}}                {{>maybeOmittableType}} {{nameCamelCase}};
{{/vars}}{{#propertyMap}}{{#description}}                /// {{_}}
{{/description}}                {{>maybeOmittableType}} {{nameCamelCase}};
{{/propertyMap}}            };
{{/            model}}
            // Construction/destruction
{{/        models}}{{#allParams?}}
            /*! {{summary}}{{#allParams}}
             * \param {{nameCamelCase}}{{#description}}
             *   {{_}}{{/description}}{{/allParams}}
             */{{/allParams?}}
            explicit {{camelCaseOperationId}}Job({{#allParams}}{{>joinedParamDecl}}{{/allParams}});{{^bodyParams}}

            /*! Construct a URL without creating a full-fledged job object
             *
             * This function can be used when a URL for
             * {{camelCaseOperationId}}Job is necessary but the job
             * itself isn't.
             */
            static QUrl makeRequestUrl(QUrl baseUrl{{#allParams?}}, {{#allParams}}{{>joinedParamDecl}}{{/allParams}}{{/allParams?}});
{{/bodyParams}}{{#        responses}}{{#normalResponse?}}{{#allProperties?}}
            ~{{camelCaseOperationId}}Job() override;

            // Result properties
{{#allProperties}}{{#description}}
            /// {{_}}{{/description}}
            {{>maybeCrefType}} {{paramName}}(){{^moveOnly}} const{{/moveOnly}};{{/allProperties}}

        protected:
            Status {{#producesNonJson?}}parseReply(QNetworkReply* reply){{/producesNonJson?}}{{^producesNonJson?}}parseJson(const QJsonDocument& data){{/producesNonJson?}} override;

        private:
            class Private;
            QScopedPointer<Private> d;{{/allProperties?}}{{/normalResponse?}}{{/responses}}
    };
{{/operation}}{{/operations}}{{!skip EOL
}}} // namespace QMatrixClient