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 _FULLOBJECTWIDGET_H_
21 #define _FULLOBJECTWIDGET_H_
27 #include <QVBoxLayout>
28 #include <QPushButton>
30 #include "objectwidgetwithsignals.h"
31 #include "qactivitystreams.h"
32 #include "texttoolbutton.h"
33 #include "richtextlabel.h"
34 #include "actorwidget.h"
35 #include "imagelabel.h"
37 //------------------------------------------------------------------------------
39 class FullObjectWidget
: public ObjectWidgetWithSignals
{
43 FullObjectWidget(QASObject
* obj
, QWidget
* parent
= 0, bool childWidget
=false);
44 virtual ~FullObjectWidget();
46 virtual void changeObject(QASAbstractObject
* obj
);
48 QASObject
* object() const { return m_object
; }
49 virtual QASAbstractObject
* asObject() const { return object(); }
51 virtual void refreshTimeLabels();
52 void disableLessButton();
56 m_actorWidget
->updateMenu();
57 updateFollowAuthorButton();
60 void setActivity(QASActivity
* a
) { m_activity
= a
; }
69 void onHasMoreClicked();
72 void onRepeatClicked();
75 void onFollowAuthor();
76 void updateFollowAuthorButton(bool wait
= false);
77 void updateDeleteEditButtons();
78 void onDeleteClicked();
82 void onLoadRepliesClicked();
83 void onDumpJsonClicked();
87 bool isCommentable() const;
88 QString
typeName() const;
89 QString
textExcerpt() const;
91 bool hasValidIrtObject();
92 void setText(QString text
);
93 void updateInfoText();
99 QString
recipientsToString(QASObjectList
* rec
);
100 QString
processText(QString old_text
, bool getImages
=false);
102 void addHasMoreButton(QASObjectList
* ol
, int li
);
103 void updateFavourButton(bool wait
= false);
104 void updateShareButton(bool wait
= false);
105 void updateFollowButton(bool wait
= false);
107 bool isFollowable(QASObject
* obj
) const;
109 void addObjectList(QASObjectList
* ol
);
110 void clearObjectList();
115 RichTextLabel
* m_textLabel
;
116 ImageLabel
* m_imageLabel
;
117 ActorWidget
* m_actorWidget
;
118 RichTextLabel
* m_streamLabel
;
120 RichTextLabel
* m_infoLabel
;
121 RichTextLabel
* m_likesLabel
;
122 RichTextLabel
* m_sharesLabel
;
123 QLabel
* m_titleLabel
;
124 QPushButton
* m_hasMoreButton
;
126 TextToolButton
* m_favourButton
;
127 TextToolButton
* m_shareButton
;
128 TextToolButton
* m_commentButton
;
129 TextToolButton
* m_followButton
;
130 TextToolButton
* m_followAuthorButton
;
131 TextToolButton
* m_deleteButton
;
132 TextToolButton
* m_editButton
;
134 TextToolButton
* m_lessButton
;
137 TextToolButton
* m_loadRepliesButton
;
138 TextToolButton
* m_dumpJsonButton
;
141 QVBoxLayout
* m_contentLayout
;
142 QHBoxLayout
* m_buttonLayout
;
143 QVBoxLayout
* m_commentsLayout
;
149 QList
<QASObject
*> m_repliesList
;
150 QSet
<QString
> m_repliesMap
;
152 QASActivity
* m_activity
;
158 #endif /* _FULLOBJECTWIDGET_H_ */