No longer honours following status in JSON, instead relies solely on following list.
[larjonas-pumpa.git] / src / actorwidget.h
blob38f482a76445a08196fa5481fc8e3cd9914ca2ee
1 /*
2 Copyright 2013-2015 Mats Sjöberg
4 This file is part of the Pumpa programme.
6 Pumpa is free software: you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 Pumpa is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Pumpa. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _ACTORWIDGET_H_
21 #define _ACTORWIDGET_H_
23 #include <QWidget>
24 #include <QToolButton>
25 #include <QMouseEvent>
26 #include <QMenu>
27 #include <QAction>
29 #include "qactivitystreams.h"
31 //------------------------------------------------------------------------------
33 class ActorWidget : public QToolButton {
34 Q_OBJECT
35 public:
36 ActorWidget(QASActor* a, QWidget* parent = 0, bool small=false);
37 virtual ~ActorWidget();
39 void setActor(QASActor* a);
41 signals:
42 void follow(QString, bool);
43 void lessClicked();
44 void moreClicked();
46 public slots:
47 void onImageChanged();
48 void updatePixmap();
49 void updateMenu();
51 private slots:
52 void onFollowAuthor();
53 void onHideAuthor();
54 void onMenuTitle();
56 private:
57 void createMenu();
59 QASActor* m_actor;
60 QString m_url;
61 QString m_localFile;
63 QMenu* m_menu;
64 QAction* m_menuTitleAction;
65 QAction* m_followAction;
66 QAction* m_hideAuthorAction;
69 #endif /* _ACTORWIDGET_H_ */