2018-11-04 09:48:33 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* plugins/FeedReader/gui/FeedReaderMessageWidget.h *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2012 by RetroShare Team <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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
|
|
|
|
2012-12-25 18:53:55 -05:00
|
|
|
#ifndef FEEDREADERMESSAGEWIDGET_H
|
|
|
|
#define FEEDREADERMESSAGEWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2013-01-10 17:51:04 -05:00
|
|
|
#include "interface/rsFeedReader.h"
|
|
|
|
|
2012-12-25 18:53:55 -05:00
|
|
|
namespace Ui {
|
|
|
|
class FeedReaderMessageWidget;
|
|
|
|
}
|
|
|
|
|
2012-12-27 19:42:27 -05:00
|
|
|
class QTimer;
|
2012-12-25 18:53:55 -05:00
|
|
|
class FeedMsgInfo;
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
class RSTreeWidgetItemCompareRole;
|
|
|
|
class RsFeedReader;
|
|
|
|
class FeedReaderNotify;
|
|
|
|
|
|
|
|
class FeedReaderMessageWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-01-10 17:51:04 -05:00
|
|
|
|
2012-12-25 18:53:55 -05:00
|
|
|
public:
|
2020-11-08 07:22:59 -05:00
|
|
|
explicit FeedReaderMessageWidget(uint32_t feedId, RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
|
2012-12-25 18:53:55 -05:00
|
|
|
~FeedReaderMessageWidget();
|
|
|
|
|
2020-11-08 07:22:59 -05:00
|
|
|
uint32_t feedId() { return mFeedId; }
|
|
|
|
void setFeedId(uint32_t feedId);
|
2012-12-25 18:53:55 -05:00
|
|
|
QString feedName(bool withUnreadCount);
|
|
|
|
QIcon feedIcon();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void showEvent(QShowEvent *e);
|
|
|
|
bool eventFilter(QObject *obj, QEvent *ev);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void feedMessageChanged(QWidget *widget);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void msgTreeCustomPopupMenu(QPoint point);
|
2012-12-27 19:42:27 -05:00
|
|
|
void updateCurrentMessage();
|
2012-12-25 18:53:55 -05:00
|
|
|
void msgItemChanged();
|
|
|
|
void msgItemClicked(QTreeWidgetItem *item, int column);
|
|
|
|
void filterColumnChanged(int column);
|
|
|
|
void filterItems(const QString &text);
|
|
|
|
void toggleMsgText();
|
|
|
|
void markAsReadMsg();
|
|
|
|
void markAsUnreadMsg();
|
|
|
|
void markAllAsReadMsg();
|
2013-01-26 06:02:41 -05:00
|
|
|
void copySelectedLinksMsg();
|
2012-12-25 18:53:55 -05:00
|
|
|
void removeMsg();
|
2012-12-27 19:42:27 -05:00
|
|
|
void processFeed();
|
2012-12-25 18:53:55 -05:00
|
|
|
void openLinkMsg();
|
|
|
|
void copyLinkMsg();
|
2013-01-21 19:11:43 -05:00
|
|
|
void retransformMsg();
|
2023-04-16 11:44:50 -04:00
|
|
|
void fillForumMenu();
|
|
|
|
void fillPostedMenu();
|
|
|
|
void addToForum();
|
|
|
|
void addToPosted();
|
2023-05-09 01:49:34 -04:00
|
|
|
void attachmentCopyLinkLocation();
|
2012-12-25 18:53:55 -05:00
|
|
|
|
|
|
|
/* FeedReaderNotify */
|
2020-11-08 07:22:59 -05:00
|
|
|
void feedChanged(uint32_t feedId, int type);
|
|
|
|
void msgChanged(uint32_t feedId, const QString &msgId, int type);
|
2012-12-25 18:53:55 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string currentMsgId();
|
|
|
|
void processSettings(bool load);
|
|
|
|
void updateMsgs();
|
|
|
|
void calculateMsgIconsAndFonts(QTreeWidgetItem *item);
|
|
|
|
void updateMsgItem(QTreeWidgetItem *item, FeedMsgInfo &info);
|
|
|
|
void setMsgAsReadUnread(QList<QTreeWidgetItem*> &rows, bool read);
|
|
|
|
void filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn);
|
|
|
|
void filterItem(QTreeWidgetItem *item);
|
|
|
|
void toggleMsgText_internal();
|
2023-05-09 01:49:34 -04:00
|
|
|
void clearMessage();
|
2012-12-25 18:53:55 -05:00
|
|
|
|
|
|
|
bool mProcessSettings;
|
|
|
|
RSTreeWidgetItemCompareRole *mMsgCompareRole;
|
2020-11-08 07:22:59 -05:00
|
|
|
uint32_t mFeedId;
|
2012-12-25 18:53:55 -05:00
|
|
|
unsigned int mUnreadCount;
|
2013-01-10 17:51:04 -05:00
|
|
|
unsigned int mNewCount;
|
|
|
|
QTimer *mTimer;
|
|
|
|
FeedInfo mFeedInfo;
|
2012-12-25 18:53:55 -05:00
|
|
|
|
|
|
|
// gui interface
|
|
|
|
RsFeedReader *mFeedReader;
|
|
|
|
FeedReaderNotify *mNotify;
|
|
|
|
|
|
|
|
Ui::FeedReaderMessageWidget *ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FEEDREADERMESSAGEWIDGET_H
|