QOAuth
1.0.1
|
00001 /*************************************************************************** 00002 * Copyright (C) 2009-2010 by Dominik Kapusta <d@ayoy.net> * 00003 * * 00004 * This library is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU Lesser General Public License as * 00006 * published by the Free Software Foundation; either version 2.1 of * 00007 * the License, or (at your option) any later version. * 00008 * * 00009 * This library is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00012 * Lesser General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU Lesser General Public * 00015 * License along with this library; if not, write to * 00016 * the Free Software Foundation, Inc., * 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * 00018 ***************************************************************************/ 00019 00020 00028 #ifndef QOAUTH_NAMESPACE_H 00029 #define QOAUTH_NAMESPACE_H 00030 00031 #include <QMultiMap> 00032 #include <QByteArray> 00033 00034 #include "qoauth_global.h" 00035 00040 namespace QOAuth { 00041 00046 typedef QMultiMap<QByteArray,QByteArray> ParamMap; 00047 00059 enum SignatureMethod { 00060 HMAC_SHA1, 00061 RSA_SHA1, 00062 PLAINTEXT 00063 }; 00064 00080 enum HttpMethod { 00081 GET, 00082 POST, 00083 HEAD, 00084 PUT 00085 #ifndef Q_WS_WIN 00086 , DELETE 00087 #endif 00088 }; 00089 00106 enum ParsingMode { 00107 ParseForRequestContent, 00108 ParseForInlineQuery, 00110 ParseForHeaderArguments, 00111 ParseForSignatureBaseString 00112 }; 00113 00124 enum ErrorCode { 00125 NoError = 200, 00126 BadRequest = 400, 00127 Unauthorized = 401, 00128 Forbidden = 403, 00129 Timeout = 1001, 00130 ConsumerKeyEmpty, 00131 ConsumerSecretEmpty, 00132 UnsupportedHttpMethod, 00137 RSAPrivateKeyEmpty = 1101, 00138 // RSAPassphraseError, //!< RSA passphrase is incorrect (or has not been provided) 00139 RSADecodingError, 00141 RSAKeyFileError, 00142 OtherError 00143 }; 00144 00145 00149 QOAUTH_EXPORT QByteArray supportedOAuthVersion(); 00150 00169 QOAUTH_EXPORT QByteArray tokenParameterName(); 00170 00176 QOAUTH_EXPORT QByteArray tokenSecretParameterName(); 00177 00178 } // namespace QOAuth 00179 00180 #endif // QOAUTH_NAMESPACE_H