2018-11-04 09:48:33 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* plugins/FeedReader/gui/FeedReaderDialog.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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2012-08-02 09:17:53 -04:00
|
|
|
|
|
|
|
#ifndef _FEEDREADERDIALOG_H
|
|
|
|
#define _FEEDREADERDIALOG_H
|
|
|
|
|
|
|
|
#include <retroshare-gui/mainpage.h>
|
|
|
|
#include "interface/rsFeedReader.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class FeedReaderDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
class RsFeedReader;
|
|
|
|
class RSTreeWidgetItemCompareRole;
|
|
|
|
class FeedReaderNotify;
|
2012-12-25 18:53:55 -05:00
|
|
|
class FeedReaderMessageWidget;
|
2012-08-02 09:17:53 -04:00
|
|
|
|
|
|
|
class FeedReaderDialog : public MainPage
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-01-08 17:07:52 -05:00
|
|
|
FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
|
2012-08-02 09:17:53 -04:00
|
|
|
~FeedReaderDialog();
|
|
|
|
|
2013-01-10 17:51:04 -05:00
|
|
|
static QIcon iconFromFeed(const FeedInfo &feedInfo);
|
|
|
|
|
2012-08-02 09:17:53 -04:00
|
|
|
protected:
|
2020-01-26 17:19:20 -05:00
|
|
|
virtual UserNotify *createUserNotify(QObject *parent) override;
|
2012-12-29 21:41:53 -05:00
|
|
|
virtual void showEvent(QShowEvent *event);
|
2012-08-02 09:17:53 -04:00
|
|
|
bool eventFilter(QObject *obj, QEvent *ev);
|
|
|
|
|
|
|
|
private slots:
|
2013-01-05 21:30:10 -05:00
|
|
|
void settingsChanged();
|
2012-08-13 17:35:11 -04:00
|
|
|
void feedTreeCustomPopupMenu(QPoint point);
|
2012-12-29 21:41:53 -05:00
|
|
|
void feedTreeItemActivated(QTreeWidgetItem *item);
|
2013-01-05 21:30:10 -05:00
|
|
|
void feedTreeMiddleButtonClicked(QTreeWidgetItem *item);
|
2012-12-29 21:41:53 -05:00
|
|
|
void openInNewTab();
|
2012-08-02 09:17:53 -04:00
|
|
|
void newFolder();
|
|
|
|
void newFeed();
|
|
|
|
void removeFeed();
|
|
|
|
void editFeed();
|
|
|
|
void activateFeed();
|
|
|
|
void processFeed();
|
2012-12-25 18:53:55 -05:00
|
|
|
|
|
|
|
void messageTabCloseRequested(int index);
|
2012-12-29 21:41:53 -05:00
|
|
|
void messageTabChanged(int index);
|
|
|
|
void messageTabInfoChanged(QWidget *widget);
|
2012-08-02 09:17:53 -04:00
|
|
|
|
|
|
|
/* FeedReaderNotify */
|
|
|
|
void feedChanged(const QString &feedId, int type);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string currentFeedId();
|
2012-12-29 21:41:53 -05:00
|
|
|
void setCurrentFeedId(const std::string &feedId);
|
2012-08-02 09:17:53 -04:00
|
|
|
void processSettings(bool load);
|
2012-12-25 18:53:55 -05:00
|
|
|
void addFeedToExpand(const std::string &feedId);
|
|
|
|
void getExpandedFeedIds(QList<std::string> &feedIds);
|
2012-08-02 09:17:53 -04:00
|
|
|
void updateFeeds(const std::string &parentId, QTreeWidgetItem *parentItem);
|
2013-01-10 17:51:04 -05:00
|
|
|
void updateFeedItem(QTreeWidgetItem *item, const FeedInfo &feedInfo);
|
2013-01-05 21:30:10 -05:00
|
|
|
void openFeedInNewTab(const std::string &feedId);
|
2012-08-02 09:17:53 -04:00
|
|
|
|
|
|
|
void calculateFeedItems();
|
2013-01-10 17:51:04 -05:00
|
|
|
void calculateFeedItem(QTreeWidgetItem *item, uint32_t &unreadCount, uint32_t &newCount, bool &loading);
|
2012-08-02 09:17:53 -04:00
|
|
|
|
2012-12-29 21:41:53 -05:00
|
|
|
FeedReaderMessageWidget *feedMessageWidget(const std::string &feedId);
|
|
|
|
FeedReaderMessageWidget *createMessageWidget(const std::string &feedId);
|
2012-12-25 18:53:55 -05:00
|
|
|
|
2012-08-02 09:17:53 -04:00
|
|
|
bool mProcessSettings;
|
2012-12-25 18:53:55 -05:00
|
|
|
QList<std::string> *mOpenFeedIds;
|
2012-08-02 09:17:53 -04:00
|
|
|
QTreeWidgetItem *mRootItem;
|
|
|
|
RSTreeWidgetItemCompareRole *mFeedCompareRole;
|
2012-12-29 21:41:53 -05:00
|
|
|
FeedReaderMessageWidget *mMessageWidget;
|
2012-08-02 09:17:53 -04:00
|
|
|
|
|
|
|
// gui interface
|
|
|
|
RsFeedReader *mFeedReader;
|
|
|
|
FeedReaderNotify *mNotify;
|
|
|
|
|
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::FeedReaderDialog *ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|