QOAuth  1.0.1
qoauth_namespace.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2009-2010 by Dominik Kapusta <d@ayoy.net> *
3  * *
4  * This library is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Lesser General Public License as *
6  * published by the Free Software Foundation; either version 2.1 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This library is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12  * Lesser General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU Lesser General Public *
15  * License along with this library; if not, write to *
16  * the Free Software Foundation, Inc., *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18  ***************************************************************************/
19 
20 
28 #ifndef QOAUTH_NAMESPACE_H
29 #define QOAUTH_NAMESPACE_H
30 
31 #include <QMultiMap>
32 #include <QByteArray>
33 
34 #include "qoauth_global.h"
35 
40 namespace QOAuth {
41 
46  typedef QMultiMap<QByteArray,QByteArray> ParamMap;
47 
63  };
64 
80  enum HttpMethod {
81  GET,
82  POST,
83  HEAD,
84  PUT
85 #ifndef Q_WS_WIN
86  , DELETE
87 #endif
88  };
89 
106  enum ParsingMode {
112  };
113 
124  enum ErrorCode {
125  NoError = 200,
126  BadRequest = 400,
127  Unauthorized = 401,
128  Forbidden = 403,
129  Timeout = 1001,
138  // RSAPassphraseError, //!< RSA passphrase is incorrect (or has not been provided)
143  };
144 
145 
149  QOAUTH_EXPORT QByteArray supportedOAuthVersion();
150 
169  QOAUTH_EXPORT QByteArray tokenParameterName();
170 
176  QOAUTH_EXPORT QByteArray tokenSecretParameterName();
177 
178 } // namespace QOAuth
179 
180 #endif // QOAUTH_NAMESPACE_H
No error occured (so far :-) )
Definition: qoauth_namespace.h:125
Represents HTTP status code 401 (Unauthorized)
Definition: qoauth_namespace.h:127
Represents HTTP status code 400 (Bad Request)
Definition: qoauth_namespace.h:126
QOAUTH_EXPORT QByteArray supportedOAuthVersion()
Returns the supported OAuth protocol version.
Definition: interface.cpp:178
Sets the signature method to HMAC-SHA1.
Definition: qoauth_namespace.h:60
Sets the HTTP method to GET.
Definition: qoauth_namespace.h:81
Sets the signature method to PLAINTEXT (not implemented yet)
Definition: qoauth_namespace.h:62
Represents a request timeout error.
Definition: qoauth_namespace.h:129
Definition: qoauth_namespace.h:139
Sets the HTTP method to DELETE.
Definition: qoauth_namespace.h:86
HTTP request header format (parameters to be put inside a request header)
Definition: qoauth_namespace.h:110
Consumer key has not been provided.
Definition: qoauth_namespace.h:130
SignatureMethod
This enum type describes the signature method used by the request.
Definition: qoauth_namespace.h:59
Sets the HTTP method to POST.
Definition: qoauth_namespace.h:82
Represents HTTP status code 403 (Forbidden)
Definition: qoauth_namespace.h:128
RSA private key has not been provided.
Definition: qoauth_namespace.h:137
ParsingMode
This enum type specifies the method of parsing parameters into a parameter string.
Definition: qoauth_namespace.h:106
Consumer secret has not been provided.
Definition: qoauth_namespace.h:131
A network-related error not specified above.
Definition: qoauth_namespace.h:142
QOAUTH_EXPORT QByteArray tokenParameterName()
Returns the name of the Access Token argument parameter (oauth_token in current implementation) ...
Definition: interface.cpp:183
Inline query format (foo=bar&bar=baz&baz=foo ...), suitable for POST requests.
Definition: qoauth_namespace.h:107
Definition: qoauth_namespace.h:132
ErrorCode
This enum type defines error types that are assigned to the QOAuth::Interface::error property...
Definition: qoauth_namespace.h:124
QOAUTH_EXPORT QByteArray tokenSecretParameterName()
Returns the name of the Token Secret argument parameter (oauth_token_secret in current implementation...
Definition: interface.cpp:188
Sets the HTTP method to PUT.
Definition: qoauth_namespace.h:84
Signature Base String format, meant for internal use.
Definition: qoauth_namespace.h:111
Sets the signature method to RSA-SHA1 (not implemented yet)
Definition: qoauth_namespace.h:61
Sets the HTTP method to HEAD.
Definition: qoauth_namespace.h:83
HttpMethod
This enum type specifies the HTTP method used for creating a Signature Base String and/or sending a r...
Definition: qoauth_namespace.h:80
The provided key file either doesn't exist or is unreadable.
Definition: qoauth_namespace.h:141
Definition: qoauth_namespace.h:108
QMultiMap< QByteArray, QByteArray > ParamMap
A typedef for the data structure for storing request parameters.
Definition: qoauth_namespace.h:46