2018-12-25 21:10:15 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/TheWire/PulseItem.h *
|
|
|
|
* *
|
2020-02-29 11:47:00 +11:00
|
|
|
* Copyright (c) 2012-2020 Robert Fernie <retroshare.project@gmail.com> *
|
2018-12-25 21:10:15 +01:00
|
|
|
* *
|
|
|
|
* 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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2012-02-13 18:43:15 +00:00
|
|
|
|
|
|
|
#ifndef MRK_PULSE_ITEM_H
|
|
|
|
#define MRK_PULSE_ITEM_H
|
|
|
|
|
|
|
|
#include "ui_PulseItem.h"
|
|
|
|
|
2020-02-29 11:47:00 +11:00
|
|
|
#include <retroshare/rswire.h>
|
|
|
|
|
2012-02-13 18:43:15 +00:00
|
|
|
class PulseItem;
|
|
|
|
|
|
|
|
class PulseHolder
|
|
|
|
{
|
2020-02-29 11:47:00 +11:00
|
|
|
public:
|
|
|
|
virtual ~PulseHolder() {}
|
|
|
|
virtual void deletePulseItem(PulseItem *, uint32_t ptype) = 0;
|
|
|
|
virtual void notifySelection(PulseItem *item, int ptype) = 0;
|
|
|
|
|
|
|
|
// Actions.
|
|
|
|
virtual void follow(RsGxsGroupId &groupId) = 0;
|
|
|
|
virtual void rate(RsGxsId &authorId) = 0;
|
|
|
|
virtual void reply(RsWirePulse &pulse, std::string &groupName) = 0;
|
2012-02-13 18:43:15 +00:00
|
|
|
};
|
|
|
|
|
2020-02-29 11:47:00 +11:00
|
|
|
|
2012-02-13 18:43:15 +00:00
|
|
|
class PulseItem : public QWidget, private Ui::PulseItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-02-29 11:47:00 +11:00
|
|
|
PulseItem(PulseHolder *holder, std::string url);
|
|
|
|
PulseItem(PulseHolder *holder, RsWirePulse &pulse, RsWireGroup &group);
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2020-02-29 11:47:00 +11:00
|
|
|
void removeItem();
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2020-02-29 11:47:00 +11:00
|
|
|
void setSelected(bool on);
|
|
|
|
bool isSelected();
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2020-02-29 11:47:00 +11:00
|
|
|
const QPixmap *getPixmap();
|
2012-02-13 18:43:15 +00:00
|
|
|
|
|
|
|
protected:
|
2020-02-29 11:47:00 +11:00
|
|
|
void mousePressEvent(QMouseEvent *event);
|
2012-02-13 18:43:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2020-02-29 11:47:00 +11:00
|
|
|
PulseHolder *mHolder;
|
|
|
|
RsWirePulse mPulse;
|
|
|
|
uint32_t mType;
|
|
|
|
bool mSelected;
|
2012-02-13 18:43:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|