2012-08-02 09:17:53 -04:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare GUI is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 by Thunder
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#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();
|
|
|
|
|
2012-12-20 08:30:16 -05:00
|
|
|
virtual UserNotify *getUserNotify(QObject *parent);
|
|
|
|
|
2013-01-10 17:51:04 -05:00
|
|
|
static QIcon iconFromFeed(const FeedInfo &feedInfo);
|
|
|
|
|
2012-08-02 09:17:53 -04:00
|
|
|
protected:
|
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
|
|
|
|
|