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

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     SPDX-FileCopyrightText: 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 */
0008 
0009 #ifndef TWITTERAPIWHOISWIDGET_H
0010 #define TWITTERAPIWHOISWIDGET_H
0011 
0012 #include <QUrl>
0013 #include <QFrame>
0014 
0015 #include "choqoktypes.h"
0016 #include "twitterapihelper_export.h"
0017 
0018 namespace Choqok
0019 {
0020 class Account;
0021 }
0022 
0023 class TwitterApiAccount;
0024 class KJob;
0025 class TWITTERAPIHELPER_EXPORT TwitterApiWhoisWidget : public QFrame
0026 {
0027     Q_OBJECT
0028 public:
0029     TwitterApiWhoisWidget(TwitterApiAccount *theAccount, const QString &userName,
0030                           const Choqok::Post &post, QWidget *parent = nullptr);
0031     ~TwitterApiWhoisWidget();
0032     void show(QPoint pos);
0033 
0034 protected Q_SLOTS:
0035     void checkAnchor(const QUrl url);
0036     void userInfoReceived(KJob *job);
0037     void slotCancel();
0038     void avatarFetchError(const QUrl &remoteUrl, const QString &errMsg);
0039     void avatarFetched(const QUrl &remoteUrl, const QPixmap &pixmap);
0040 
0041     void slotFriendshipCreated(Choqok::Account *, const QString &);
0042     void slotFriendshipDestroyed(Choqok::Account *, const QString &);
0043 //     void slotUserBlocked(Choqok::Account*, const QString&);
0044 
0045 protected:
0046     void updateHtml();
0047     void setActionImages();
0048 
0049 //     static const QString baseText;
0050 private:
0051     void setupUi();
0052     void showForm();
0053     void loadUserInfo(TwitterApiAccount *thAccount, const QString &username);
0054     class Private;
0055     Private *const d;
0056 };
0057 
0058 #endif // TWITTERAPIWHOISWIDGET_H