mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-04 20:34:26 -04:00
Added feed item for forum group and forum message
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7692 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
06065ef623
commit
d70bb01b2e
15 changed files with 1915 additions and 79 deletions
98
retroshare-gui/src/gui/feeds/GxsForumMsgItem.h
Normal file
98
retroshare-gui/src/gui/feeds/GxsForumMsgItem.h
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Retroshare Gxs Feed Item
|
||||
*
|
||||
* Copyright 2014 RetroShare Team
|
||||
*
|
||||
* 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 _GXSFORUMMSGITEM_H
|
||||
#define _GXSFORUMMSGITEM_H
|
||||
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
#include "gui/gxs/GxsFeedItem.h"
|
||||
|
||||
namespace Ui {
|
||||
class GxsForumMsgItem;
|
||||
}
|
||||
|
||||
class FeedHolder;
|
||||
|
||||
class GxsForumMsgItem : public GxsFeedItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate);
|
||||
GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, const RsGxsForumMsg &post, bool isHome, bool autoUpdate);
|
||||
GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumMsg &post, bool isHome, bool autoUpdate);
|
||||
virtual ~GxsForumMsgItem();
|
||||
|
||||
bool setGroup(const RsGxsForumGroup &group, bool doFill = true);
|
||||
bool setMessage(const RsGxsForumMsg &msg, bool doFill = true);
|
||||
|
||||
/* FeedItem */
|
||||
virtual void expand(bool open);
|
||||
|
||||
protected:
|
||||
/* load message data */
|
||||
void requestParentMessage(const RsGxsMessageId &msgId);
|
||||
virtual void loadParentMessage(const uint32_t &token);
|
||||
|
||||
/* GxsGroupFeedItem */
|
||||
virtual QString groupName();
|
||||
virtual void loadGroup(const uint32_t &token);
|
||||
virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_FORUM; }
|
||||
virtual bool isLoading();
|
||||
|
||||
/* GxsFeedItem */
|
||||
virtual void loadMessage(const uint32_t &token);
|
||||
virtual QString messageName();
|
||||
|
||||
private slots:
|
||||
/* default stuff */
|
||||
void toggle();
|
||||
void readAndClearItem();
|
||||
|
||||
void unsubscribeForum();
|
||||
|
||||
signals:
|
||||
void vote(const RsGxsGrpMsgIdPair& msgId, bool up);
|
||||
|
||||
private:
|
||||
void setup();
|
||||
void fill();
|
||||
void setReadStatus(bool isNew, bool isUnread);
|
||||
void setAsRead();
|
||||
bool isTop();
|
||||
|
||||
private:
|
||||
bool mInFill;
|
||||
bool mCloseOnRead;
|
||||
|
||||
RsGxsForumGroup mGroup;
|
||||
RsGxsForumMsg mMessage;
|
||||
RsGxsForumMsg mParentMessage;
|
||||
uint32_t mTokenTypeParentMessage;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::GxsForumMsgItem *ui;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue