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

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     SPDX-FileCopyrightText: 2013-2014 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 PUMPIOPOSTWIDGET_H
0010 #define PUMPIOPOSTWIDGET_H
0011 
0012 #include "postwidget.h"
0013 
0014 class PumpIOPostWidget : public Choqok::UI::PostWidget
0015 {
0016     Q_OBJECT
0017 public:
0018     explicit PumpIOPostWidget(Choqok::Account *account, Choqok::Post *post, QWidget *parent = nullptr);
0019     virtual ~PumpIOPostWidget();
0020 
0021     virtual void checkAnchor(const QUrl &url) override;
0022 
0023     virtual QString generateSign() override;
0024 
0025     virtual void initUi() override;
0026 
0027 protected Q_SLOTS:
0028     virtual void slotPostError(Choqok::Account *theAccount, Choqok::Post *post,
0029                                Choqok::MicroBlog::ErrorType error, const QString &errorMessage) override;
0030 
0031     virtual void slotResendPost() override;
0032 
0033     void slotReplyTo();
0034 
0035     void slotToggleFavorite(Choqok::Account *, Choqok::Post *);
0036 
0037     void toggleFavorite();
0038 
0039 protected:
0040     virtual bool isResendAvailable() override;
0041     virtual QString getUsernameHyperlink(const Choqok::User &user) const;
0042 
0043     static const QIcon unFavIcon;
0044 
0045 private:
0046     void updateFavStat();
0047     bool isReplyAvailable();
0048 
0049     class Private;
0050     Private *const d;
0051 
0052 };
0053 
0054 #endif // PUMPIOPOSTWIDGET_H