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:
|
|
|
|
explicit FeedReaderMessageWidget(const std::string &feedId, RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
|
|
|
|
~FeedReaderMessageWidget();
|
|
|
|
|
|
|
|
std::string feedId() { return mFeedId; }
|
2012-12-29 21:41:53 -05:00
|
|
|
void setFeedId(const std::string &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();
|
|
|
|
void copyLinksMsg();
|
|
|
|
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();
|
2012-12-25 18:53:55 -05:00
|
|
|
|
|
|
|
/* FeedReaderNotify */
|
|
|
|
void feedChanged(const QString &feedId, int type);
|
|
|
|
void msgChanged(const QString &feedId, const QString &msgId, int type);
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
bool mProcessSettings;
|
|
|
|
RSTreeWidgetItemCompareRole *mMsgCompareRole;
|
|
|
|
std::string mFeedId;
|
|
|
|
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
|