1 /* 2 This file is part of Choqok, the KDE micro-blogging client 3 4 Copyright (C) 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com> 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License as 8 published by the Free Software Foundation; either version 2 of 9 the License or (at your option) version 3 or any later version 10 accepted by the membership of KDE e.V. (or its successor approved 11 by the membership of KDE e.V.), which shall act as a proxy 12 defined in Section 14 of version 3 of the license. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, see http://www.gnu.org/licenses/ 21 */ 22 23 #ifndef TWITTERAPIWHOISWIDGET_H 24 #define TWITTERAPIWHOISWIDGET_H 25 26 #include <QUrl> 27 #include <QFrame> 28 29 #include "choqoktypes.h" 30 #include "choqok_export.h" 31 32 namespace Choqok 33 { 34 class Account; 35 } 36 37 class TwitterApiAccount; 38 class KJob; 39 class CHOQOK_HELPER_EXPORT TwitterApiWhoisWidget : public QFrame 40 { 41 Q_OBJECT 42 public: 43 TwitterApiWhoisWidget(TwitterApiAccount *theAccount, const QString &userName, 44 const Choqok::Post &post, QWidget *parent = nullptr); 45 ~TwitterApiWhoisWidget(); 46 void show(QPoint pos); 47 48 protected Q_SLOTS: 49 void checkAnchor(const QUrl url); 50 void userInfoReceived(KJob *job); 51 void slotCancel(); 52 void avatarFetchError(const QUrl &remoteUrl, const QString &errMsg); 53 void avatarFetched(const QUrl &remoteUrl, const QPixmap &pixmap); 54 55 void slotFriendshipCreated(Choqok::Account *, const QString &); 56 void slotFriendshipDestroyed(Choqok::Account *, const QString &); 57 // void slotUserBlocked(Choqok::Account*, const QString&); 58 59 protected: 60 void updateHtml(); 61 void setActionImages(); 62 63 // static const QString baseText; 64 private: 65 void setupUi(); 66 void showForm(); 67 void loadUserInfo(TwitterApiAccount *thAccount, const QString &username); 68 class Private; 69 Private *const d; 70 }; 71 72 #endif // TWITTERAPIWHOISWIDGET_H 73