2013-03-15 17:02:43 -04:00
|
|
|
/*
|
|
|
|
* Retroshare Gxs Feed Item
|
2013-03-11 16:53:15 -04:00
|
|
|
*
|
2013-03-15 17:02:43 -04:00
|
|
|
* Copyright 2012-2013 by Robert Fernie.
|
2013-03-11 16:53:15 -04:00
|
|
|
*
|
2013-03-15 17:02:43 -04:00
|
|
|
* 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.
|
2013-03-11 16:53:15 -04:00
|
|
|
*
|
2013-03-15 17:02:43 -04:00
|
|
|
* 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.
|
2013-03-11 16:53:15 -04:00
|
|
|
*
|
2013-03-15 17:02:43 -04:00
|
|
|
* 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".
|
|
|
|
*
|
|
|
|
*/
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
#ifndef _GXS_CHANNEL_POST_ITEM_H
|
|
|
|
#define _GXS_CHANNEL_POST_ITEM_H
|
|
|
|
|
|
|
|
#include <retroshare/rsgxschannels.h>
|
2013-03-15 17:02:43 -04:00
|
|
|
#include "gui/gxs/GxsFeedItem.h"
|
2013-03-11 16:53:15 -04:00
|
|
|
#include "ui_GxsChannelPostItem.h"
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
class FeedHolder;
|
|
|
|
class SubFileItem;
|
|
|
|
|
2013-03-15 17:02:43 -04:00
|
|
|
class GxsChannelPostItem : public GxsFeedItem, private Ui::GxsChannelPostItem
|
2013-03-11 16:53:15 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
2013-03-15 17:02:43 -04:00
|
|
|
GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome);
|
2013-03-11 16:53:15 -04:00
|
|
|
GxsChannelPostItem(FeedHolder *parent, uint32_t feedId, const RsGxsChannelPost &post, uint32_t subscribeFlags, bool isHome);
|
2013-03-15 17:02:43 -04:00
|
|
|
|
2013-03-11 16:53:15 -04:00
|
|
|
void setFileCleanUpWarning(uint32_t time_left);
|
|
|
|
|
2013-03-15 17:02:43 -04:00
|
|
|
//const std::string &msgId() { return mMsgId; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void loadMessage(const uint32_t &token);
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
/* default stuff */
|
|
|
|
void toggle();
|
|
|
|
void readAndClearItem();
|
|
|
|
void download();
|
|
|
|
void play();
|
|
|
|
void copyLink();
|
2013-03-15 17:02:43 -04:00
|
|
|
void loadComments();
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
void readToggled(bool checked);
|
|
|
|
void channelMsgReadSatusChanged(const QString& channelId, const QString& msgId, int status);
|
|
|
|
|
2013-03-15 17:02:43 -04:00
|
|
|
void unsubscribeChannel();
|
2013-03-11 16:53:15 -04:00
|
|
|
void updateItem();
|
|
|
|
|
2014-04-04 09:55:00 -04:00
|
|
|
void makeUpVote();
|
|
|
|
void makeDownVote();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void vote(const RsGxsGrpMsgIdPair& msgId, bool up);
|
|
|
|
|
2013-03-11 16:53:15 -04:00
|
|
|
private:
|
|
|
|
void setup();
|
|
|
|
void loadPost(const RsGxsChannelPost &post);
|
|
|
|
|
|
|
|
bool m_inUpdateItemStatic;
|
|
|
|
|
|
|
|
uint32_t mMode;
|
|
|
|
uint32_t mSubscribeFlags;
|
2013-03-15 17:02:43 -04:00
|
|
|
RsGxsChannelPost mPost;
|
2013-03-11 16:53:15 -04:00
|
|
|
|
|
|
|
std::list<SubFileItem *> mFileItems;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|