VirtualBox

Ignore:
Timestamp:
Oct 15, 2015 3:18:45 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Networking cleanup/rework (part 13): Doxygen.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/net
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp

    r58255 r58265  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UINetworkReply, i.e. HTTP/HTTPS for update pings++.
     3 * VBox Qt GUI - UINetworkReply stuff implementation.
    44 */
    55
     
    3333#  include "VBoxGlobal.h"
    3434#  include "VBoxUtils.h"
    35 # else
     35# else /* VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
    3636#  include <VBox/log.h>
    37 # endif
    38 
    39 /* Other VBox includes; */
     37# endif /* VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
     38
     39/* Other VBox includes: */
    4040# include <iprt/initterm.h>
    4141
    4242#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    4343
     44/* Other VBox includes: */
    4445#include <iprt/crypto/pem.h>
    4546#include <iprt/crypto/store.h>
     
    5253
    5354
    54 /**
    55  * Our network-reply thread
    56  */
     55/** QThread extension
     56  * used as network-reply thread instance. */
    5757class UINetworkReplyPrivateThread : public QThread
    5858{
     
    6262signals:
    6363
    64     /** Notifies listeners about download progress change.
    65       * @param iCurrent holds the current amount of bytes downloaded.
    66       * @param iTotal   holds the total amount of bytes to be downloaded. */
    67     void sigDownloadProgress(qint64 iCurrent, qint64 iTotal);
     64    /** Notifies listeners about reply progress change.
     65      * @param  iBytesReceived  Holds the current amount of bytes received.
     66      * @param  iBytesTotal     Holds the total amount of bytes to be received. */
     67    void sigDownloadProgress(qint64 iBytesReceived, qint64 iBytesTotal);
    6868#endif /* !VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
    6969
    7070public:
    7171
    72     /** Constructs network reply thread for the passed @a request of the passed @a type. */
     72    /** Constructs reply thread for the passed @a request of the passed @a type. */
    7373    UINetworkReplyPrivateThread(const QNetworkRequest &request, UINetworkRequestType type);
    7474
     
    7878    /** @name APIs
    7979     * @{ */
    80     /** Read everything. */
    81     const QByteArray& readAll() const { return m_reply; }
    82     /** IRPT error status. */
    83     int error() const { return m_iError; }
    84     /** Abort HTTP request. */
    85     void abort();
    86     /** Returns value for the cached reply header of the passed @a type. */
    87     QString header(QNetworkRequest::KnownHeaders type) const
    88     {
    89         /* Look for known header type: */
    90         switch (type)
    91         {
    92             case QNetworkRequest::ContentTypeHeader:   return m_headers.value("Content-Type");
    93             case QNetworkRequest::ContentLengthHeader: return m_headers.value("Content-Length");
    94             case QNetworkRequest::LastModifiedHeader:  return m_headers.value("Last-Modified");
    95             default: break;
     80        /** Returns binary content of the reply. */
     81        const QByteArray& readAll() const { return m_reply; }
     82        /** Returns the last cached IPRT HTTP error of the reply. */
     83        int error() const { return m_iError; }
     84        /** Aborts reply. */
     85        void abort();
     86        /** Returns value for the cached reply header of the passed @a type. */
     87        QString header(QNetworkRequest::KnownHeaders type) const
     88        {
     89            /* Look for known header type: */
     90            switch (type)
     91            {
     92                case QNetworkRequest::ContentTypeHeader:   return m_headers.value("Content-Type");
     93                case QNetworkRequest::ContentLengthHeader: return m_headers.value("Content-Length");
     94                case QNetworkRequest::LastModifiedHeader:  return m_headers.value("Last-Modified");
     95                default: break;
     96            }
     97            /* Return null-string by default: */
     98            return QString();
    9699        }
    97         /* Return null-string by default: */
    98         return QString();
    99     }
    100     /** Returns URL of the reply which is the URL of the request for now. */
    101     QUrl url() const { return m_request.url(); }
     100        /** Returns the URL of the reply which is the URL of the request for now. */
     101        QUrl url() const { return m_request.url(); }
    102102    /** @} */
    103103
     
    106106    /** @name Helpers - HTTP stuff
    107107     * @{ */
    108     int applyConfiguration();
    109     int applyProxyRules();
    110     int applyHttpsCertificates();
    111     int applyRawHeaders();
    112     int performMainRequest();
     108        /** Applies configuration. */
     109        int applyConfiguration();
     110        /** Applies proxy rules. */
     111        int applyProxyRules();
     112        /** Applies security certificates. */
     113        int applyHttpsCertificates();
     114        /** Applies raw headers. */
     115        int applyRawHeaders();
     116        /** Performs main request. */
     117        int performMainRequest();
     118        /** Performs whole thread functionality. */
     119        void run();
    113120    /** @} */
    114 
    115     /* Helper: Main thread runner: */
    116     void run();
    117121
    118122    /** Additinoal download nfo about wanted certificate. */
    119123    typedef struct CERTINFO
    120124    {
    121         /** Filename in the zip file we download (PEM). */
     125        /** Holds the filename of the zip file we download (PEM). */
    122126        const char *pszZipFile;
    123         /** List of direct URLs to PEM formatted files.. */
     127        /** Lists direct URLs to PEM formatted files. */
    124128        const char *apszUrls[4];
    125129    } CERTINFO;
     
    127131    /** @name Static helpers for HTTP and Certificates handling.
    128132     * @{ */
    129     static QString fullCertificateFileName();
    130     static int applyProxyRules(RTHTTP hHttp, const QString &strHostName, int iPort);
    131     static int applyRawHeaders(RTHTTP hHttp, const QList<QByteArray> &headers, const QNetworkRequest &request);
    132     static unsigned countCertsFound(bool const *pafFoundCerts);
    133     static bool areAllCertsFound(bool const *pafFoundCerts);
    134     static int refreshCertificates(RTHTTP hHttp, PRTCRSTORE phStore, bool *pafFoundCerts, const char *pszCaCertFile);
    135     static void downloadMissingCertificates(RTCRSTORE hNewStore, bool *pafNewFoundCerts, RTHTTP hHttp,
    136                                             PRTERRINFOSTATIC pStaticErrInfo);
    137     static int convertVerifyAndAddPemCertificateToStore(RTCRSTORE hStore, void const *pvResponse,
    138                                                         size_t cbResponse, PCRTCRCERTWANTED pWantedCert);
     133        /** Returns full certificate file-name. */
     134        static QString fullCertificateFileName();
     135
     136        /** Applies proxy rules.
     137          * @remarks  Implementation doesn't exists, to be removed? */
     138        static int applyProxyRules(RTHTTP hHttp, const QString &strHostName, int iPort);
     139
     140        /** Applies raw headers.
     141          * @param  hHttp    Brings the HTTP client instance.
     142          * @param  headers  Brings the list of headers to be applied.
     143          * @param  request  Brings the request which contains values for the headers to be applied. */
     144        static int applyRawHeaders(RTHTTP hHttp, const QList<QByteArray> &headers, const QNetworkRequest &request);
     145
     146        /** Returns the number of certificates found in a search result array.
     147          * @param  pafFoundCerts  Brings the array parallel to s_aCerts with the status of each wanted certificate. */
     148        static unsigned countCertsFound(bool const *pafFoundCerts);
     149
     150        /** Returns whether we've found all the necessary certificates.
     151          * @param  pafFoundCerts  Brings the array parallel to s_aCerts with the status of each wanted certificate. */
     152        static bool areAllCertsFound(bool const *pafFoundCerts);
     153
     154        /** Refreshes the certificates.
     155          * @param  hHttp          Brings the HTTP client instance. (Can be NIL when running the testcase.)
     156          * @param  phStore        On input, this holds the current store, so that we can fish out wanted
     157          *                        certificates from it. On successful return, this is replaced with a new
     158          *                        store reflecting the refrehsed content of @a pszCaCertFile.
     159          * @param  pafFoundCerts  On input, this holds the certificates found in the current store.
     160          *                        On return, this reflects what is current in the @a pszCaCertFile.
     161          *                        The array runs parallel to s_aCerts.
     162          * @param  pszCaCertFile  Where to write the refreshed certificates if we've managed to gather
     163          *                        a collection that is at least as good as the old one. */
     164        static int refreshCertificates(RTHTTP hHttp, PRTCRSTORE phStore, bool *pafFoundCerts, const char *pszCaCertFile);
     165
     166        /** Downloads missing certificates.
     167          * @param  hNewStore         On successful return, this store will contain newly downloaded certificates.
     168          * @param  pafNewFoundCerts  On successful return, this array parallel to s_aCerts will contain the
     169          *                           status of each newly downloaded certificate.
     170          * @param  hHttp             Brings the HTTP client instance.
     171          * @param  pStaticErrInfo    Unused currently. */
     172        static void downloadMissingCertificates(RTCRSTORE hNewStore, bool *pafNewFoundCerts, RTHTTP hHttp,
     173                                                PRTERRINFOSTATIC pStaticErrInfo);
     174
     175        /** Converts a PEM certificate, verifies it against @a pCertInfo and adds it to the given store.
     176          * @param  hStore       The store to add certificate to.
     177          * @param  pvResponse   The raw PEM certificate file bytes.
     178          * @param  cbResponse   The number of bytes.
     179          * @param  pWantedCert  The certificate info (we use hashes and encoded size). */
     180        static int convertVerifyAndAddPemCertificateToStore(RTCRSTORE hStore, void const *pvResponse,
     181                                                            size_t cbResponse, PCRTCRCERTWANTED pWantedCert);
    139182    /** @} */
    140183
    141184    /** @name HTTP download progress handling.
    142185     * @{ */
    143     /** Redirects download progress callback to particular object which can handle it. */
    144     static DECLCALLBACK(void) handleProgressChange(RTHTTP hHttp, void *pvUser, uint64_t cbDownloadTotal, uint64_t cbDownloaded);
    145     /** Handles download progress callback. */
    146     void handleProgressChange(uint64_t cbDownloadTotal, uint64_t cbDownloaded);
     186        /** Redirects download progress callback to particular object which can handle it.
     187          * @param  hHttp            Brings the HTTP client instance.
     188          * @param  pvUser           Brings the convenience pointer for the
     189          *                          user-agent object which should handle that callback.
     190          * @param  cbDownloadTotal  Brings the total amount of bytes to be received.
     191          * @param  cbDownloaded     Brings the current amount of bytes received. */
     192        static DECLCALLBACK(void) handleProgressChange(RTHTTP hHttp, void *pvUser, uint64_t cbDownloadTotal, uint64_t cbDownloaded);
     193
     194        /** Handles download progress callback.
     195          * @param  cbDownloadTotal  Brings the total amount of bytes to be received.
     196          * @param  cbDownloaded     Brings the current amount of bytes received. */
     197        void handleProgressChange(uint64_t cbDownloadTotal, uint64_t cbDownloaded);
    147198    /** @} */
    148199
     
    150201    QString m_strContext;
    151202
    152     /* Variables: */
     203    /** Holds the request instance. */
    153204    QNetworkRequest m_request;
    154205    /** Holds the request type. */
    155206    UINetworkRequestType m_type;
     207
     208    /** Holds the last cached IPRT HTTP error of the reply. */
    156209    int m_iError;
    157     /** IPRT HTTP client instance handle. */
     210    /** Holds the IPRT HTTP client instance handle. */
    158211    RTHTTP m_hHttp;
     212    /** Holds the reply instance. */
    159213    QByteArray m_reply;
    160     /* Holds the cached reply headers. */
     214    /** Holds the cached reply headers. */
    161215    QMap<QString, QString> m_headers;
    162216
     217    /** Holds the URLs to root zip files containing certificates we want. */
    163218    static const char * const s_apszRootsZipUrls[];
     219    /** Holds the download details. */
    164220    static const CERTINFO s_CertInfoPcaCls3Gen5;
     221    /** Holds the details on the certificates we are after.
     222      * The pvUser member points to a UINetworkReplyPrivateThread::CERTINFO. */
    165223    static const RTCRCERTWANTED s_aCerts[];
     224    /** Holds the certificate file name (no path). */
    166225    static const QString s_strCertificateFileName;
    167226
    168227#ifdef VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS
    169228public:
     229    /** Starts the test routine. */
    170230    static void testIt(RTTEST hTest);
    171 #endif
     231#endif /* VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
    172232};
    173233
    174 
    175 /**
    176  * URLs to root zip files containing certificates we want.
    177  */
    178 /*static*/ const char * const UINetworkReplyPrivateThread::s_apszRootsZipUrls[] =
     234/* static */
     235const char * const UINetworkReplyPrivateThread::s_apszRootsZipUrls[] =
    179236{
    180237    "http://www.symantec.com/content/en/us/enterprise/verisign/roots/roots.zip"
    181238};
    182239
    183 
    184 /**
    185  * Download details for
    186  */
    187 /*static*/ const UINetworkReplyPrivateThread::CERTINFO UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen5 =
     240/* static */
     241const UINetworkReplyPrivateThread::CERTINFO UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen5 =
    188242{
    189243    /*.pszZipFile     =*/
     
    198252};
    199253
    200 
    201 /**
    202  * Details on the certificates we are after.
    203  * The pvUser member points to a UINetworkReplyPrivateThread::CERTINFO.
    204  */
    205 /* static */ const RTCRCERTWANTED UINetworkReplyPrivateThread::s_aCerts[] =
     254/* static */
     255const RTCRCERTWANTED UINetworkReplyPrivateThread::s_aCerts[] =
    206256{
    207257    /*[0] =*/
     
    233283};
    234284
    235 
    236 /** The certificate file name (no path). */
    237 /* static */ const QString UINetworkReplyPrivateThread::s_strCertificateFileName = QString("vbox-ssl-cacertificate.crt");
    238 
     285/* static */
     286const QString UINetworkReplyPrivateThread::s_strCertificateFileName = QString("vbox-ssl-cacertificate.crt");
    239287
    240288UINetworkReplyPrivateThread::UINetworkReplyPrivateThread(const QNetworkRequest &request, UINetworkRequestType type)
     
    501549    const QDir homeDir(QDir::toNativeSeparators(vboxGlobal().homeFolder()));
    502550    return QDir::toNativeSeparators(homeDir.absoluteFilePath(s_strCertificateFileName));
    503 #else
     551#else /* VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
    504552    return QString("/not/such/agency/non-existing-file.cer");
    505 #endif
     553#endif /* VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
    506554}
    507555
     
    529577}
    530578
    531 /**
    532  * Counts the number of certificates found in a search result array.
    533  *
    534  * @returns Number of wanted certifcates we've found.
    535  * @param   pafFoundCerts       Array parallel to s_aCerts with the status of
    536  *                              each wanted certificate.
    537  */
    538 /*static*/ unsigned
    539 UINetworkReplyPrivateThread::countCertsFound(bool const *pafFoundCerts)
     579/* static */
     580unsigned UINetworkReplyPrivateThread::countCertsFound(bool const *pafFoundCerts)
    540581{
    541582    unsigned cFound = 0;
     
    545586}
    546587
    547 /**
    548  * Checks if we've found all the necessary certificates or not.
    549  *
    550  * @returns true if we have, false if we haven't.
    551  * @param   pafFoundCerts       Array parallel to s_aCerts with the status of
    552  *                              each wanted certificate.
    553  */
    554 /*static*/ bool
    555 UINetworkReplyPrivateThread::areAllCertsFound(bool const *pafFoundCerts)
     588/* static */
     589bool UINetworkReplyPrivateThread::areAllCertsFound(bool const *pafFoundCerts)
    556590{
    557591    for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
     
    561595}
    562596
    563 /**
    564  * Refresh the certificates.
    565  *
    566  * @return  IPRT status code for the testcase.
    567  * @param   hHttp               The HTTP client instance.  (Can be NIL when
    568  *                              running the testcase.)
    569  * @param   phStore             On input, this holds the current store, so that
    570  *                              we can fish out wanted certificates from it.
    571  *                              On successful return, this is replaced with a
    572  *                              new store reflecting the refrehsed content of
    573  *                              @a pszCaCertFile.
    574  * @param   pafFoundCerts       On input, this holds the certificates found in
    575  *                              the current store.  On return, this reflects
    576  *                              what is current in the @a pszCaCertFile.  The
    577  *                              array runs parallel to s_aCerts.
    578  * @param   pszCaCertFile       Where to write the refreshed certificates if
    579  *                              we've managed to gather a collection that is at
    580  *                              least as good as the old one.
    581  */
    582 /*static*/ int
    583 UINetworkReplyPrivateThread::refreshCertificates(RTHTTP hHttp, PRTCRSTORE phStore, bool *pafFoundCerts,
    584                                                  const char *pszCaCertFile)
     597/* static */
     598int UINetworkReplyPrivateThread::refreshCertificates(RTHTTP hHttp, PRTCRSTORE phStore, bool *pafFoundCerts,
     599                                                     const char *pszCaCertFile)
    585600{
    586601    /*
     
    676691}
    677692
    678 /*static*/ void
    679 UINetworkReplyPrivateThread::downloadMissingCertificates(RTCRSTORE hNewStore, bool *pafNewFoundCerts, RTHTTP hHttp,
    680                                                          PRTERRINFOSTATIC pStaticErrInfo)
     693/* static */
     694void UINetworkReplyPrivateThread::downloadMissingCertificates(RTCRSTORE hNewStore, bool *pafNewFoundCerts, RTHTTP hHttp,
     695                                                              PRTERRINFOSTATIC pStaticErrInfo)
    681696{
    682697    int rc;
     
    751766}
    752767
    753 /**
    754  * Converts a PEM certificate, verifies it against @a pCertInfo and adds it to
    755  * the given store.
    756  *
    757  * @returns IPRT status code.
    758  * @param   hStore              The store to add it to.
    759  * @param   pvResponse          The raw PEM certificate file bytes.
    760  * @param   cbResponse          The number of bytes.
    761  * @param   pWantedCert         The certificate info (we use hashes and encoded
    762  *                              size).
    763  */
    764 /*static*/ int
    765 UINetworkReplyPrivateThread::convertVerifyAndAddPemCertificateToStore(RTCRSTORE hStore,
    766                                                                       void const *pvResponse, size_t cbResponse,
    767                                                                       PCRTCRCERTWANTED pWantedCert)
     768/* static */
     769int UINetworkReplyPrivateThread::convertVerifyAndAddPemCertificateToStore(RTCRSTORE hStore,
     770                                                                          void const *pvResponse, size_t cbResponse,
     771                                                                          PCRTCRCERTWANTED pWantedCert)
    768772{
    769773    /*
     
    831835    /* Notify listeners about progress change: */
    832836    emit sigDownloadProgress(cbDownloaded, cbDownloadTotal);
    833 #endif /* !VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
     837#else /* VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
     838    Q_UNUSED(cbDownloaded);
     839    Q_UNUSED(cbDownloadTotal);
     840#endif /* VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS */
    834841}
    835842
    836843#ifndef VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS
    837844
    838 /**
    839  * Our network-reply (HTTP) object.
    840  */
     845/** QObject extension
     846  * used as network-reply private data instance. */
    841847class UINetworkReplyPrivate : public QObject
    842848{
     
    845851signals:
    846852
    847     /* Notifiers: */
     853    /** Notifies listeners about reply progress change.
     854      * @param  iBytesReceived  Holds the current amount of bytes received.
     855      * @param  iBytesTotal     Holds the total amount of bytes to be received. */
    848856    void downloadProgress(qint64 iBytesReceived, qint64 iBytesTotal);
     857
     858    /** Notifies listeners about reply has finished processing. */
    849859    void finished();
    850860
    851861public:
    852862
    853     /* Constructor: */
     863    /** Constructs reply private data for the passed @a request of the passed @a type. */
    854864    UINetworkReplyPrivate(const QNetworkRequest &request, UINetworkRequestType type)
    855865        : m_error(QNetworkReply::NoError)
     
    858868        /* Prepare full error template: */
    859869        m_strErrorTemplate = tr("%1: %2", "Context description: Error description");
    860         /* Create and run network-reply thread: */
     870        /* Create and run reply thread: */
    861871        m_pThread = new UINetworkReplyPrivateThread(request, type);
    862872#ifndef VBOX_GUI_IN_TST_SSL_CERT_DOWNLOADS
     
    868878    }
    869879
    870     /* Destructor: */
     880    /** Destructs reply private data. */
    871881    ~UINetworkReplyPrivate()
    872882    {
     
    878888    }
    879889
    880     /* API: Abort reply: */
     890    /** Aborts reply. */
    881891    void abort() { m_pThread->abort(); }
    882892
     
    884894    QUrl url() const { return m_pThread->url(); }
    885895
    886     /* API: Error-code getter: */
     896    /** Returns the last cached error of the reply. */
    887897    QNetworkReply::NetworkError error() const { return m_error; }
    888898
    889     /* API: Error-string getter: */
     899    /** Returns the user-oriented string corresponding to the last cached error of the reply. */
    890900    QString errorString() const
    891901    {
     
    907917    }
    908918
    909     /* API: Reply getter: */
     919    /** Returns binary content of the reply. */
    910920    QByteArray readAll() const { return m_pThread->readAll(); }
    911921
     
    918928private slots:
    919929
    920     /* Handler: Thread finished: */
     930    /** Handles signal about reply has finished processing. */
    921931    void sltFinished()
    922932    {
     
    945955    QString m_strErrorTemplate;
    946956
    947     /* Variables: */
     957    /** Holds the last cached error of the reply. */
    948958    QNetworkReply::NetworkError m_error;
     959
     960    /** Holds the reply thread instance. */
    949961    UINetworkReplyPrivateThread *m_pThread;
    950962};
     
    955967*********************************************************************************************************************************/
    956968
    957 UINetworkReply::UINetworkReply(const QNetworkRequest &request, UINetworkRequestType requestType)
    958     : m_pReply(new UINetworkReplyPrivate(request, requestType))
     969UINetworkReply::UINetworkReply(const QNetworkRequest &request, UINetworkRequestType type)
     970    : m_pReply(new UINetworkReplyPrivate(request, type))
    959971{
    960972    /* Prepare network-reply object connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.h

    r58252 r58265  
    55
    66/*
    7  * Copyright (C) 2012-2013 Oracle Corporation
     7 * Copyright (C) 2012-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UINetworkReply_h__
    19 #define __UINetworkReply_h__
     18#ifndef ___UINetworkReply_h___
     19#define ___UINetworkReply_h___
    2020
    2121/* Qt includes: */
     
    2929class UINetworkReplyPrivate;
    3030
    31 /* Network-reply interface: */
     31/** QObject extension
     32  * used as network-reply interface. */
    3233class UINetworkReply : public QObject
    3334{
     
    3637signals:
    3738
    38     /* Notifiers: */
     39    /** Notifies listeners about reply progress change.
     40      * @param  iBytesReceived  Holds the current amount of bytes received.
     41      * @param  iBytesTotal     Holds the total amount of bytes to be received. */
    3942    void downloadProgress(qint64 iBytesReceived, qint64 iBytesTotal);
     43
     44    /** Notifies listeners about reply has finished processing. */
    4045    void finished();
    4146
    4247public:
    4348
    44     /* Constructor/destructor: */
    45     UINetworkReply(const QNetworkRequest &request, UINetworkRequestType requestType);
     49    /** Constructs reply for the passed @a request of the passed @a type. */
     50    UINetworkReply(const QNetworkRequest &request, UINetworkRequestType type);
     51    /** Destructs reply. */
    4652    ~UINetworkReply();
    4753
    48     /* API: */
     54    /** Aborts reply. */
    4955    void abort();
     56
     57    /** Returns the URL of the reply. */
    5058    QUrl url() const;
     59
     60    /** Returns the last cached error of the reply. */
    5161    QNetworkReply::NetworkError error() const;
     62    /** Returns the user-oriented string corresponding to the last cached error of the reply. */
    5263    QString errorString() const;
     64
     65    /** Returns binary content of the reply. */
    5366    QByteArray readAll() const;
     67    /** Returns value for the cached reply header of the passed @a type. */
    5468    QVariant header(QNetworkRequest::KnownHeaders header) const;
     69    /** Returns value for the cached reply attribute of the passed @a code. */
    5570    QVariant attribute(QNetworkRequest::Attribute code) const;
    5671
    5772private:
    5873
    59     /** Holds the network reply private instance. */
     74    /** Holds the reply private data instance. */
    6075    UINetworkReplyPrivate *m_pReply;
    6176};
    6277
    63 #endif // __UINetworkReply_h__
     78#endif /* !___UINetworkReply_h___ */
     79
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette