2018-11-13 16:02:26 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/feeds/ChatMsgItem.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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2010-08-31 13:13:52 -04:00
|
|
|
|
|
|
|
#ifndef _CHATMSG_ITEM_DIALOG_H
|
|
|
|
#define _CHATMSG_ITEM_DIALOG_H
|
|
|
|
|
|
|
|
#include "ui_ChatMsgItem.h"
|
2014-11-15 12:24:49 -05:00
|
|
|
#include "FeedItem.h"
|
2010-08-31 13:13:52 -04:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
class FeedHolder;
|
|
|
|
|
2014-11-15 12:24:49 -05:00
|
|
|
class ChatMsgItem : public FeedItem, private Ui::ChatMsgItem
|
2010-08-31 13:13:52 -04:00
|
|
|
{
|
2012-02-01 07:21:14 -05:00
|
|
|
Q_OBJECT
|
2010-08-31 13:13:52 -04:00
|
|
|
|
|
|
|
public:
|
2012-02-01 07:21:14 -05:00
|
|
|
/** Default Constructor */
|
2014-11-15 12:24:49 -05:00
|
|
|
ChatMsgItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, const std::string &message);
|
2010-08-31 13:13:52 -04:00
|
|
|
|
|
|
|
void updateItemStatic();
|
|
|
|
|
2019-12-03 16:30:13 -05:00
|
|
|
virtual QString uniqueIdentifier() const override { return "ChatMsgItem " + QString::fromStdString(mPeerId.toStdString()) ;}
|
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*/) {}
|
2014-11-15 12:24:49 -05:00
|
|
|
|
2010-08-31 13:13:52 -04:00
|
|
|
private slots:
|
|
|
|
/* default stuff */
|
2010-09-08 15:04:24 -04:00
|
|
|
void gotoHome();
|
|
|
|
void removeItem();
|
2010-08-31 13:13:52 -04:00
|
|
|
|
|
|
|
void sendMsg();
|
|
|
|
void openChat();
|
|
|
|
|
|
|
|
void updateItem();
|
2010-09-08 15:04:24 -04:00
|
|
|
|
2010-09-08 12:27:13 -04:00
|
|
|
void togglequickmessage();
|
|
|
|
void sendMessage();
|
2010-08-31 13:13:52 -04:00
|
|
|
|
2010-09-08 15:04:24 -04:00
|
|
|
void on_quickmsgText_textChanged();
|
|
|
|
|
2010-08-31 13:13:52 -04:00
|
|
|
private:
|
2012-02-01 07:21:14 -05:00
|
|
|
void insertChat(const std::string &message);
|
2010-08-31 13:13:52 -04:00
|
|
|
|
2010-09-08 15:04:24 -04:00
|
|
|
FeedHolder *mParent;
|
2010-08-31 13:13:52 -04:00
|
|
|
uint32_t mFeedId;
|
|
|
|
|
2014-11-15 12:24:49 -05:00
|
|
|
RsPeerId mPeerId;
|
2010-08-31 13:13:52 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|