File indexing completed on 2023-05-30 11:40:09

0001 /*************************************************************************************
0002  *  Copyright (C) 2013 by Alejandro Fiestas Olivares <afiestas@kde.org>              *
0003  *                                                                                   *
0004  *  This library is free software; you can redistribute it and/or                    *
0005  *  modify it under the terms of the GNU Lesser General Public                       *
0006  *  License as published by the Free Software Foundation; either                     *
0007  *  version 2 of the License, or (at your option) any later version.                 *
0008  *                                                                                   *
0009  *  This library is distributed in the hope that it will be useful,                  *
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of                   *
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                *
0012  *  Library General Public License for more details.                                 *
0013  *                                                                                   *
0014  *  You should have received a copy of the GNU Library General Public License        *
0015  *  along with this library; see the file COPYING.LIB.  If not, write to             *
0016  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,             *
0017  *  Boston, MA 02110-1301, USA.                                                      *
0018  *************************************************************************************/
0019 
0020 
0021 #ifndef X_TELEPATHY_SSO_GOOGLE_OPERATION_H
0022 #define X_TELEPATHY_SSO_GOOGLE_OPERATION_H
0023 
0024 #include <TelepathyQt/PendingOperation>
0025 #include <TelepathyQt/Channel>
0026 #include <TelepathyQt/Account>
0027 
0028 class KJob;
0029 
0030 class XTelepathySSOGoogleOperation : public Tp::PendingOperation
0031 {
0032     Q_OBJECT
0033     Q_DISABLE_COPY(XTelepathySSOGoogleOperation)
0034 
0035 public:
0036     explicit XTelepathySSOGoogleOperation(
0037             const Tp::AccountPtr &account,
0038             int accountStorageId,
0039             Tp::Client::ChannelInterfaceSASLAuthenticationInterface *saslIface);
0040 
0041 private Q_SLOTS:
0042     void onSASLStatusChanged(uint status, const QString &reason, const QVariantMap &details);
0043     void gotCredentials(KJob *kjob);
0044 
0045 private:
0046     Tp::AccountPtr m_account;
0047     Tp::Client::ChannelInterfaceSASLAuthenticationInterface *m_saslIface;
0048 
0049     int m_accountStorageId;
0050     QByteArray m_challengeData;
0051 
0052     friend class SaslAuthOp;
0053 };
0054 
0055 #endif //X_TELEPATHY_SSO_GOOGLE_OPERATION_H