2018-11-04 09:48:33 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* plugins/FeedReader/gui/FeedReaderFeedItem.h *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2012 by Thunder *
|
|
|
|
* *
|
|
|
|
* 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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2013-01-08 17:07:52 -05:00
|
|
|
|
|
|
|
#ifndef _FEEDREADERFEEDITEM_H
|
|
|
|
#define _FEEDREADERFEEDITEM_H
|
|
|
|
|
2014-11-15 20:42:57 -05:00
|
|
|
#include "gui/feeds/FeedItem.h"
|
2013-01-08 17:07:52 -05:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class FeedReaderFeedItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
class RsFeedReader;
|
|
|
|
class FeedReaderNotify;
|
|
|
|
class FeedHolder;
|
|
|
|
class FeedInfo;
|
|
|
|
class FeedMsgInfo;
|
|
|
|
|
2014-11-15 20:42:57 -05:00
|
|
|
class FeedReaderFeedItem : public FeedItem
|
2013-01-08 17:07:52 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-11-08 07:22:59 -05:00
|
|
|
FeedReaderFeedItem(RsFeedReader *feedReader, FeedReaderNotify *notify, const FeedInfo &feedInfo, const FeedMsgInfo &msgInfo);
|
2013-01-08 17:07:52 -05:00
|
|
|
~FeedReaderFeedItem();
|
|
|
|
|
2020-11-08 07:22:59 -05:00
|
|
|
virtual uint64_t uniqueIdentifier() const override { return hash_64bits("FeedReaderFeedItem " + mMsgId); }
|
|
|
|
|
2015-06-17 14:59:12 -04:00
|
|
|
protected:
|
2014-11-15 20:42:57 -05:00
|
|
|
/* FeedItem */
|
2015-06-17 14:59:12 -04:00
|
|
|
virtual void doExpand(bool open);
|
2014-11-15 20:42:57 -05:00
|
|
|
|
2013-01-08 17:07:52 -05:00
|
|
|
private slots:
|
|
|
|
/* default stuff */
|
2020-01-14 15:43:29 -05:00
|
|
|
void toggle() override;
|
2013-01-08 17:07:52 -05:00
|
|
|
|
|
|
|
void readAndClearItem();
|
|
|
|
void copyLink();
|
|
|
|
void openLink();
|
|
|
|
|
2020-11-08 07:22:59 -05:00
|
|
|
void msgChanged(uint32_t feedId, const QString &msgId, int type);
|
2013-01-08 17:07:52 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setMsgRead();
|
|
|
|
|
|
|
|
RsFeedReader *mFeedReader;
|
|
|
|
FeedReaderNotify *mNotify;
|
|
|
|
|
|
|
|
std::string mMsgId;
|
|
|
|
QString mLink;
|
|
|
|
|
|
|
|
Ui::FeedReaderFeedItem *ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _FEEDREADERFEEDITEM_H
|