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 
24 #ifndef TWITTERAPIPOSTWIDGET_H
25 #define TWITTERAPIPOSTWIDGET_H
26 
27 #include "postwidget.h"
28 
29 /**
30 @author Mehrdad Momeny \<mehrdad.momeny@gmail.com\>
31 */
32 class CHOQOK_HELPER_EXPORT TwitterApiPostWidget : public Choqok::UI::PostWidget
33 {
34     Q_OBJECT
35 public:
36     TwitterApiPostWidget(Choqok::Account *account, Choqok::Post *post, QWidget *parent = nullptr);
37     ~TwitterApiPostWidget();
38 
39     virtual void initUi() override;
40 
41 protected Q_SLOTS:
42     virtual void checkAnchor(const QUrl &url) override;
43     virtual void setFavorite();
44     virtual void slotSetFavorite(Choqok::Account *theAccount, const QString &postId);
45     virtual void slotReply();
46     virtual void repeatPost();
47     virtual void slotWriteTo();
48     virtual void slotReplyToAll();
49 
50     void slotBasePostFetched(Choqok::Account *theAccount, Choqok::Post *post);
51 
52 protected:
53     virtual QString generateSign() override;
54     virtual QString getUsernameHyperlink(const Choqok::User &user) const;
55 
56     void updateFavStat();
57 
58     static const QIcon unFavIcon;
59 private:
60     class Private;
61     Private *const d;
62 
63 };
64 
65 #endif // TWITTERPOSTWIDGET_H
66