All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cpp-qt5-client.api-header.mustache Maven / Gradle / Ivy

{{>licenseInfo}}
#ifndef {{prefix}}_{{classname}}_H
#define {{prefix}}_{{classname}}_H

#include "{{prefix}}HttpRequest.h"

{{#imports}}{{{import}}}
{{/imports}}

#include 

{{#cppNamespaceDeclarations}}
namespace {{this}} {
{{/cppNamespaceDeclarations}}

class {{classname}} : public QObject {
    Q_OBJECT

public:
    {{classname}}(const QString &scheme = "{{scheme}}", const QString &host = "{{serverHost}}", int port = {{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}0{{/serverPort}}, const QString &basePath = "{{basePathWithoutHost}}", const int timeOut = 0);
    ~{{classname}}();

    void setScheme(const QString &scheme);
    void setHost(const QString &host);
    void setPort(int port);
    void setBasePath(const QString &basePath);
    void setTimeOut(const int timeOut);
    void setWorkingDirectory(const QString &path);
    void addHeaders(const QString &key, const QString &value);
    void enableRequestCompression();
    void enableResponseCompression();
    void abortRequests();
{{#operations}}{{#operation}}
    void {{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/operation}}{{/operations}}

private:
    QString _scheme, _host;
    int _port;
    QString _basePath;
    int _timeOut;
    QString _workingDirectory;
    QMap defaultHeaders;
    bool isResponseCompressionEnabled;
    bool isRequestCompressionEnabled;
{{#operations}}{{#operation}}
    void {{nickname}}Callback({{prefix}}HttpRequestWorker *worker);{{/operation}}{{/operations}}

signals:
{{#operations}}{{#operation}}
    void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}});{{/operation}}{{/operations}}
{{#operations}}{{#operation}}
    void {{nickname}}SignalFull({{prefix}}HttpRequestWorker *worker{{#returnType}}, {{{returnType}}} summary{{/returnType}});{{/operation}}{{/operations}}
{{#operations}}{{#operation}}
    void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}}
{{#operations}}{{#operation}}
    void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}}

    void abortRequestsSignal(); 
};

{{#cppNamespaceDeclarations}}
} // namespace {{this}}
{{/cppNamespaceDeclarations}}
#endif




© 2015 - 2024 Weber Informatics LLC | Privacy Policy