File indexing completed on 2024-04-28 04:55:38

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     SPDX-FileCopyrightText: 2017 Andrea Scarpino <scarpino@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 */
0008 
0009 #ifndef TWITTERAPIOAUTH_H
0010 #define TWITTERAPIOAUTH_H
0011 
0012 #include <QOAuth1>
0013 
0014 #include "twitterapihelper_export.h"
0015 
0016 class TwitterApiAccount;
0017 class TwitterApiOAuthReplyHandler;
0018 
0019 namespace KIO {
0020 class AccessManager;
0021 }
0022 
0023 class TWITTERAPIHELPER_EXPORT TwitterApiOAuth : public QOAuth1
0024 {
0025     Q_OBJECT
0026 public:
0027     explicit TwitterApiOAuth(TwitterApiAccount *account);
0028     ~TwitterApiOAuth();
0029 
0030     QByteArray authorizationHeader(const QUrl &requestUrl, QNetworkAccessManager::Operation method,
0031                                    const QVariantMap &params = QVariantMap());
0032 
0033 private:
0034     TwitterApiOAuthReplyHandler *m_replyHandler;
0035     KIO::AccessManager *m_networkAccessManager;
0036 };
0037 
0038 #endif // TWITTERAPIOAUTH_H