Show webfinger if displayName is unknown for an author.
[larjonas-pumpa.git] / src / objectwidget.h
blob9f11e926b6a9f4ecf791375d5d4c9da20f3e6dc0
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 _OBJECTWIDGET_H_
21 #define _OBJECTWIDGET_H_
23 #include <QFrame>
24 #include <QWidget>
26 #include "qactivitystreams.h"
27 #include "shortobjectwidget.h"
28 #include "fullobjectwidget.h"
29 #include "texttoolbutton.h"
30 #include "richtextlabel.h"
31 #include "objectwidgetwithsignals.h"
33 //------------------------------------------------------------------------------
35 class ObjectWidget : public ObjectWidgetWithSignals {
36 Q_OBJECT
38 public:
39 ObjectWidget(QASObject* obj, QWidget* parent = 0);
40 virtual ~ObjectWidget();
42 virtual void changeObject(QASAbstractObject* obj, bool fullObject);
43 virtual void changeObject(QASAbstractObject* obj) { changeObject(obj, true); }
45 QASObject* object() const { return m_object; }
46 virtual QASAbstractObject* asObject() const { return object(); }
48 virtual void refreshTimeLabels();
49 void disableLessButton();
51 void setActivity(QASActivity* a) {
52 if (m_objectWidget) m_objectWidget->setActivity(a);
55 signals:
56 void moreClicked();
57 void lessClicked();
58 void showContext(QASObject*);
60 private slots:
61 void showMore();
62 void showLess();
63 void onChanged();
64 void updateContextLabel();
65 void onShowContext();
67 private:
68 FullObjectWidget* m_objectWidget;
69 ShortObjectWidget* m_shortObjectWidget;
70 RichTextLabel* m_contextLabel;
71 TextToolButton* m_contextButton;
73 QVBoxLayout* m_layout;
74 QHBoxLayout* m_topLayout;
75 QASObject* m_object;
76 QASObject* m_irtObject;
78 QASActivity* m_activity;
80 bool m_short;
84 #endif /* _OBJECTWIDGET_H_ */