File: qgshttptransaction.sip

package info (click to toggle)
qgis 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 374,696 kB
  • ctags: 66,263
  • sloc: cpp: 396,139; ansic: 241,070; python: 130,609; xml: 14,884; perl: 1,290; sh: 1,287; sql: 500; yacc: 268; lex: 242; makefile: 168
file content (102 lines) | stat: -rw-r--r-- 3,233 bytes parent folder | download
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
class QgsHttpTransaction : QObject
{
%TypeHeaderCode
#include <qgshttptransaction.h>
%End
  public:
    /**
    * Constructor.
    * \note userName and password added in 1.1
    */
    QgsHttpTransaction( QString uri,
                        QString proxyHost = QString(),
                        int     proxyPort = 80,
                        QString proxyUser = QString(),
                        QString proxyPass = QString(),
                        QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy,
                        QString userName = QString(),
                        QString password = QString() );

    //! Destructor
    virtual ~QgsHttpTransaction();

    void getAsynchronously();

    //! Gets the response synchronously.  Note that signals will still be emitted
    //! while in this function.

    /*!
        The function returns false if there is an error while getting the response.
        @param[out] respondedContent is replaced with the new content.

        @param[in]  redirections     is used to measure how many http redirections we've been through.
        Clients typically don't need to set this.

        @param postData data to send with the http message. This is only used for HTTP POST. If
        0 then the request is done with HTTP GET.

        @return true in case of success
     */
    bool getSynchronously( QByteArray &respondedContent, int redirections = 0, const QByteArray* postData = 0 );

    QString responseContentType();

    /**
     * If an operation returns 0 (e.g. getSynchronously()), this function
     * returns the text of the error associated with the failure.
     * Interactive users of this provider can then, for example,
     * call a QMessageBox to display the contents.
     */
    QString errorString();

    /**Apply proxy settings from QSettings to a http object
    @return true if proxy settings was applied, false else*/
    static bool applyProxySettings( QHttp& http, const QString& url );

    /**
     * Set the credentials (username and password)
     * \note added in 1.1
     */

    void setCredentials( const QString& username, const QString &password );

    /**Returns the network timeout in msec*/
    int networkTimeout() const;
    /**Sets the network timeout in milliseconds*/
    void setNetworkTimeout( int msec );


  public slots:

    void dataStarted( int id );

    void dataHeaderReceived( const QHttpResponseHeader& resp );

    void dataReceived( const QHttpResponseHeader& resp );

    void dataProgress( int done, int total );

    void dataFinished( int id, bool error );

    void transactionFinished( bool error );

    void dataStateChanged( int state );

    void networkTimedOut();

    /**Aborts the current transaction*/
    void abort();

  signals:

    /**legacy code. This signal is currently not emitted and only kept for API compatibility*/
    void setProgress( int done, int total );

    /**Signal for progress update */
    void dataReadProgress( int theProgress );
    /**Signal for adjusted number of steps*/
    void totalSteps( int theTotalSteps );

    /** \brief emit a signal to be caught by qgisapp and display a msg on status bar */
    void statusChanged( QString theStatusQString );
};