2013-03-15 17:02:43 -04:00
|
|
|
/*
|
|
|
|
* Retroshare Gxs Feed Item
|
|
|
|
*
|
|
|
|
* Copyright 2012-2013 by Robert Fernie.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License Version 2.1 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GXS_GENERIC_FEED_ITEM_H
|
|
|
|
#define _GXS_GENERIC_FEED_ITEM_H
|
|
|
|
|
2014-11-17 19:49:21 -05:00
|
|
|
#include "GxsGroupFeedItem.h"
|
2014-08-01 10:49:58 -04:00
|
|
|
|
2014-11-17 19:49:21 -05:00
|
|
|
class GxsFeedItem : public GxsGroupFeedItem
|
2013-03-15 17:02:43 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Note parent can = NULL */
|
2014-11-17 19:49:21 -05:00
|
|
|
GxsFeedItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, RsGxsIfaceHelper *iface, bool autoUpdate);
|
2014-05-05 19:25:17 -04:00
|
|
|
virtual ~GxsFeedItem();
|
2013-03-15 17:02:43 -04:00
|
|
|
|
2017-05-20 11:33:05 -04:00
|
|
|
RsGxsMessageId messageId() const { return mMessageId; }
|
|
|
|
const QVector<RsGxsMessageId>& messageVersions() const { return mMessageVersions ; }
|
|
|
|
|
2016-06-18 14:03:55 -04:00
|
|
|
//To be able to update with thread message when comment is received.
|
|
|
|
void setMessageId( RsGxsMessageId id) {mMessageId = id;}
|
2017-05-20 11:33:05 -04:00
|
|
|
void setMessageVersions( const QVector<RsGxsMessageId>& v) { mMessageVersions = v;}
|
2014-05-05 17:53:47 -04:00
|
|
|
|
2013-03-15 17:02:43 -04:00
|
|
|
protected:
|
2014-11-17 19:49:21 -05:00
|
|
|
/* load message data */
|
2013-03-15 17:02:43 -04:00
|
|
|
void requestMessage();
|
2016-08-07 08:40:04 -04:00
|
|
|
void requestComment();
|
2013-03-15 17:02:43 -04:00
|
|
|
|
2014-07-26 19:52:45 -04:00
|
|
|
virtual QString messageName() = 0;
|
2016-08-07 08:40:04 -04:00
|
|
|
virtual void loadMessage(const uint32_t &token) = 0;
|
|
|
|
virtual void loadComment(const uint32_t &token) = 0;
|
2014-07-26 19:52:45 -04:00
|
|
|
|
2014-11-17 19:49:21 -05:00
|
|
|
/* GxsGroupFeedItem */
|
|
|
|
virtual bool isLoading();
|
|
|
|
virtual void fillDisplay(RsGxsUpdateBroadcastBase *updateBroadcastBase, bool complete);
|
|
|
|
|
|
|
|
/* TokenResponse */
|
|
|
|
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
2013-03-15 17:02:43 -04:00
|
|
|
|
2014-05-05 19:25:17 -04:00
|
|
|
protected slots:
|
2013-03-15 17:02:43 -04:00
|
|
|
void comments(const QString &title);
|
2014-11-17 19:49:21 -05:00
|
|
|
void copyMessageLink();
|
2013-03-15 17:02:43 -04:00
|
|
|
|
|
|
|
private:
|
2014-11-17 19:49:21 -05:00
|
|
|
RsGxsMessageId mMessageId;
|
2017-05-20 11:33:05 -04:00
|
|
|
QVector<RsGxsMessageId> mMessageVersions ;
|
2014-11-17 19:49:21 -05:00
|
|
|
uint32_t mTokenTypeMessage;
|
2016-08-07 08:40:04 -04:00
|
|
|
uint32_t mTokenTypeComment;
|
2013-03-15 17:02:43 -04:00
|
|
|
};
|
|
|
|
|
2014-08-01 10:49:58 -04:00
|
|
|
Q_DECLARE_METATYPE(RsGxsMessageId)
|
|
|
|
|
2013-03-15 17:02:43 -04:00
|
|
|
#endif
|