2014-02-26 07:41:40 +01:00
|
|
|
// This file is part of RSS Guard.
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011-2014 by Martin Rotter <rotter.martinos@gmail.com>
|
|
|
|
//
|
|
|
|
// RSS Guard 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 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// RSS Guard 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 RSS Guard. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2013-10-05 07:43:10 +02:00
|
|
|
#ifndef FEEDMESSAGEVIEWER_H
|
|
|
|
#define FEEDMESSAGEVIEWER_H
|
|
|
|
|
|
|
|
#include "gui/tabcontent.h"
|
|
|
|
|
2014-01-04 14:09:38 +01:00
|
|
|
#include "core/messagesmodel.h"
|
|
|
|
|
2013-10-05 07:43:10 +02:00
|
|
|
|
|
|
|
class WebBrowser;
|
2013-10-13 16:12:15 +02:00
|
|
|
class MessagesView;
|
2014-02-02 12:34:32 +01:00
|
|
|
class FeedsView;
|
2013-12-22 11:29:10 +01:00
|
|
|
class FeedDownloader;
|
2014-02-02 12:34:32 +01:00
|
|
|
class FeedsModelFeed;
|
2013-10-20 14:45:14 +02:00
|
|
|
class QToolBar;
|
2013-12-21 09:14:03 +01:00
|
|
|
class QSplitter;
|
2014-01-06 21:22:00 +01:00
|
|
|
class QProgressBar;
|
2013-10-05 07:43:10 +02:00
|
|
|
|
|
|
|
class FeedMessageViewer : public TabContent {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-10-20 18:09:15 +02:00
|
|
|
// Constructors and destructors.
|
2013-10-05 07:43:10 +02:00
|
|
|
explicit FeedMessageViewer(QWidget *parent = 0);
|
|
|
|
virtual ~FeedMessageViewer();
|
|
|
|
|
2013-10-20 18:09:15 +02:00
|
|
|
// WebBrowser getter from TabContent interface.
|
2014-01-12 20:22:10 +01:00
|
|
|
inline WebBrowser *webBrowser() {
|
|
|
|
return m_messagesBrowser;
|
|
|
|
}
|
2013-10-05 07:43:10 +02:00
|
|
|
|
2014-01-13 21:43:35 +01:00
|
|
|
// FeedsView getter.
|
|
|
|
inline FeedsView *feedsView() {
|
|
|
|
return m_feedsView;
|
|
|
|
}
|
|
|
|
|
2013-12-21 09:14:03 +01:00
|
|
|
// Loads/saves sizes and states of ALL
|
|
|
|
// underlying widgets, this contains primarily
|
|
|
|
// splitters, toolbar and views.
|
|
|
|
void saveSize();
|
|
|
|
void loadSize();
|
|
|
|
|
2014-02-04 10:02:07 +01:00
|
|
|
// Destroys worker/feed downloader thread and
|
|
|
|
// stops any child widgets/workers.
|
|
|
|
void quit();
|
2013-12-23 14:43:47 +01:00
|
|
|
|
2014-02-05 19:27:06 +01:00
|
|
|
public slots:
|
2014-03-07 21:38:06 +01:00
|
|
|
// Runs "cleanup" of the database.
|
2014-02-05 19:27:06 +01:00
|
|
|
void vacuumDatabase();
|
|
|
|
|
2014-02-10 17:19:43 +01:00
|
|
|
// Reloads some changeable visual settings.
|
|
|
|
void refreshVisualProperties();
|
|
|
|
|
2014-01-10 10:37:08 +01:00
|
|
|
protected slots:
|
|
|
|
// Updates counts of messages for example in tray icon.
|
2014-02-02 14:15:18 +01:00
|
|
|
void updateTrayIconStatus(int unread_messages, int total_messages);
|
2014-01-10 10:37:08 +01:00
|
|
|
|
2014-01-04 14:09:38 +01:00
|
|
|
// Reacts on feed updates.
|
2014-01-06 21:22:00 +01:00
|
|
|
void onFeedUpdatesStarted();
|
2013-12-24 13:35:58 +01:00
|
|
|
void onFeedUpdatesProgress(FeedsModelFeed *feed, int current, int total);
|
2013-12-23 14:43:47 +01:00
|
|
|
void onFeedUpdatesFinished();
|
|
|
|
|
2013-10-13 16:12:15 +02:00
|
|
|
protected:
|
2013-10-20 18:09:15 +02:00
|
|
|
// Initializes some properties of the widget.
|
|
|
|
void initialize();
|
|
|
|
|
|
|
|
// Initializes both messages/feeds views.
|
2013-10-13 16:12:15 +02:00
|
|
|
void initializeViews();
|
2013-10-05 07:43:10 +02:00
|
|
|
|
2013-12-04 21:03:09 +01:00
|
|
|
// Sets up connections.
|
2013-12-08 14:02:28 +01:00
|
|
|
void createConnections();
|
2013-12-04 21:03:09 +01:00
|
|
|
|
2013-10-13 16:12:15 +02:00
|
|
|
private:
|
2013-10-20 14:45:14 +02:00
|
|
|
QToolBar *m_toolBar;
|
2014-03-07 21:38:06 +01:00
|
|
|
QToolBar *m_toolBarMessages;
|
2013-11-24 14:44:17 +01:00
|
|
|
|
2013-12-21 09:14:03 +01:00
|
|
|
QSplitter *m_feedSplitter;
|
|
|
|
QSplitter *m_messageSplitter;
|
|
|
|
|
2013-10-13 16:12:15 +02:00
|
|
|
MessagesView *m_messagesView;
|
|
|
|
FeedsView *m_feedsView;
|
|
|
|
WebBrowser *m_messagesBrowser;
|
2013-12-22 11:29:10 +01:00
|
|
|
|
2013-12-23 14:43:47 +01:00
|
|
|
QThread *m_feedDownloaderThread;
|
2013-12-22 11:29:10 +01:00
|
|
|
FeedDownloader *m_feedDownloader;
|
2013-10-05 07:43:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FEEDMESSAGEVIEWER_H
|