2018-11-13 16:02:26 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/feeds/MsgItem.h *
|
|
|
|
* *
|
|
|
|
* Copyright (c) 2008, Robert Fernie <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program 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 Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
#ifndef _MSG_ITEM_DIALOG_H
|
|
|
|
#define _MSG_ITEM_DIALOG_H
|
|
|
|
|
|
|
|
#include "ui_MsgItem.h"
|
2014-11-15 12:24:49 -05:00
|
|
|
#include "FeedItem.h"
|
2009-05-11 10:33:32 -04:00
|
|
|
#include <stdint.h>
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
class FeedHolder;
|
|
|
|
class SubFileItem;
|
|
|
|
|
2014-11-15 12:24:49 -05:00
|
|
|
class MsgItem : public FeedItem, private Ui::MsgItem
|
2008-07-04 10:41:24 -04:00
|
|
|
{
|
2012-02-01 07:21:14 -05:00
|
|
|
Q_OBJECT
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
public:
|
2012-02-01 07:21:14 -05:00
|
|
|
/** Default Constructor */
|
|
|
|
MsgItem(FeedHolder *parent, uint32_t feedId, const std::string &msgId, bool isHome);
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
void updateItemStatic();
|
|
|
|
|
2019-12-15 10:46:22 -05:00
|
|
|
virtual std::string uniqueIdentifier() const override { return "MsgItem " + mMsgId ; }
|
2015-06-17 14:59:12 -04:00
|
|
|
protected:
|
2014-11-15 12:24:49 -05:00
|
|
|
/* FeedItem */
|
2015-06-17 14:59:12 -04:00
|
|
|
virtual void doExpand(bool open);
|
|
|
|
virtual void expandFill(bool first);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void fillExpandFrame();
|
2014-11-15 12:24:49 -05:00
|
|
|
|
2008-07-04 10:41:24 -04:00
|
|
|
private slots:
|
|
|
|
/* default stuff */
|
2012-02-01 07:21:14 -05:00
|
|
|
void gotoHome();
|
|
|
|
void removeItem();
|
2008-07-04 10:41:24 -04:00
|
|
|
void toggle();
|
|
|
|
|
|
|
|
void playMedia();
|
|
|
|
void deleteMsg();
|
|
|
|
void replyMsg();
|
2017-01-29 13:01:38 -05:00
|
|
|
void sendInvite();
|
2015-06-09 18:57:01 -04:00
|
|
|
void checkMessageReadStatus();
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
void updateItem();
|
|
|
|
|
|
|
|
private:
|
|
|
|
FeedHolder *mParent;
|
|
|
|
uint32_t mFeedId;
|
|
|
|
|
|
|
|
std::string mMsgId;
|
2015-06-17 14:59:12 -04:00
|
|
|
QString mMsg;
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
bool mIsHome;
|
2015-06-09 18:57:01 -04:00
|
|
|
bool mCloseOnRead;
|
2008-07-04 10:41:24 -04:00
|
|
|
|
|
|
|
std::list<SubFileItem *> mFileItems;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|