Show webfinger if displayName is unknown for an author.
[larjonas-pumpa.git] / src / activitywidget.h
blob099d3ed5eb175975b78e4a276c73df7f26c3e17d
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 _ACTIVITYWIDGET_H_
21 #define _ACTIVITYWIDGET_H_
23 #include <QFrame>
24 #include <QWidget>
25 #include <QHBoxLayout>
26 #include <QPushButton>
28 #include "richtextlabel.h"
29 #include "qactivitystreams.h"
30 #include "objectwidget.h"
31 #include "objectwidgetwithsignals.h"
33 //------------------------------------------------------------------------------
35 class ActivityWidget : public ObjectWidgetWithSignals {
36 Q_OBJECT
38 public:
39 ActivityWidget(QASActivity* a, bool fullObject=true, QWidget* parent=0);
40 virtual ~ActivityWidget();
42 void changeObject(QASAbstractObject* obj, bool fullObject);
43 virtual void changeObject(QASAbstractObject* obj) {
44 changeObject(obj, true);
47 virtual QString getId() const { return m_activity->id(); }
48 QASActivity* activity() const { return m_activity; }
50 virtual QASAbstractObject* asObject() const { return activity(); }
52 virtual void refreshTimeLabels();
54 public slots:
55 virtual void onObjectChanged();
57 signals:
58 void showContext(QASObject*);
60 private:
61 void updateText();
62 QString recipientsToString(QASObjectList* rec);
64 RichTextLabel* m_textLabel;
65 ActorWidget* m_actorWidget;
66 ObjectWidget* m_objectWidget;
68 QASActivity* m_activity;
71 #endif /* _ACTIVITYWIDGET_H_ */