changes for formeego, do not use
[googlelatitude] / libkqoauth / kqoauthrequest_p.h
1 /**
2  * KQOAuth - An OAuth authentication library for Qt.
3  *
4  * Author: Johan Paul (johan.paul@d-pointer.com)
5  *         http://www.d-pointer.com
6  *
7  *  KQOAuth is free software: you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser General Public License as published by
9  *  the Free Software Foundation, either version 3 of the License, or
10  *  (at your option) any later version.
11  *
12  *  KQOAuth is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with KQOAuth.  If not, see <http://www.gnu.org/licenses/>.
19  */
20 #ifndef KQOAUTHREQUEST_P_H
21 #define KQOAUTHREQUEST_P_H
22 #include "kqoauthglobals.h"
23 #include "kqoauthrequest.h"
24
25 #include <QString>
26 #include <QUrl>
27 #include <QMap>
28 #include <QPair>
29 #include <QMultiMap>
30 #include <QTimer>
31
32 class KQOAUTH_EXPORT KQOAuthRequestPrivate {
33
34 public:
35     KQOAuthRequestPrivate();
36     ~KQOAuthRequestPrivate();
37
38     // Helper methods to get the values for the OAuth request parameters.
39     QString oauthTimestamp() const;
40     QString oauthNonce() const;
41     QString oauthSignature();
42
43     // Utility methods for making the request happen.
44     void prepareRequest();
45     void signRequest();
46     bool validateRequest() const;
47     QByteArray requestBaseString();
48     QByteArray encodedParamaterList(const QList< QPair<QString, QString> > &requestParameters);
49     void insertAdditionalParams();
50     void insertPostBody();
51
52     QUrl oauthRequestEndpoint;
53     KQOAuthRequest::RequestHttpMethod oauthHttpMethod;
54     QString oauthHttpMethodString;
55     QString oauthConsumerKey;
56     QString oauthConsumerSecretKey;
57     QString oauthToken;
58     QString oauthTokenSecret;
59     QString oauthSignatureMethod;
60     QUrl oauthCallbackUrl;
61     QString oauthVersion;
62     QString oauthVerifier;
63
64     // These will be generated by the helper methods
65     QString oauthTimestamp_;
66     QString oauthNonce_;
67
68     // User specified additional parameters needed for the request.
69     QList< QPair<QString, QString> > additionalParameters;
70
71      // The raw POST body content as given to the HTTP request.
72      QByteArray postBodyContent;
73
74     // Protocol parameters.
75     // These parameters are used in the "Authorized" header of the HTTP request.
76     QList< QPair<QString, QString> > requestParameters;
77
78     KQOAuthRequest::RequestType requestType;
79
80     //The Content-Type HTTP header
81     QString contentType;
82
83     //Raw data to post if type is not url-encoded
84     QByteArray postRawData;
85
86     // Timeout for this request in milliseconds.
87     int timeout;
88     QTimer timer;
89
90     bool debugOutput;
91
92 };
93 #endif // KQOAUTHREQUEST_P_H