aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/desktop-plugins/rssfeeder/RSSFeedPlugin.h
blob: 68b36760af5e3d3f97748efb9dcfe304d7eb7843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2016, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
//  This plugin is a simple RSS feed reader for the desktop
//===========================================
#ifndef _LUMINA_DESKTOP_RSS_FEEDER_PLUGIN_H
#define _LUMINA_DESKTOP_RSS_FEEDER_PLUGIN_H

#include <QTimer>
#include "../LDPlugin.h"

#include "RSSObjects.h"

namespace Ui{
	class RSSFeedPlugin;
};

class RSSFeedPlugin : public LDPlugin{
	Q_OBJECT
public:
	RSSFeedPlugin(QWidget* parent, QString ID);
	~RSSFeedPlugin();
	
	virtual QSize defaultPluginSize(){
	  // The returned QSize is in grid points (typically 100 or 200 pixels square)
	  return QSize(3,3);
	}
private:
	Ui::RSSFeedPlugin *ui;
	QMenu *optionsMenu, *presetMenu;
	QString setprefix; //settings prefix
	RSSReader *RSS;

	void updateOptionsMenu();
	void checkFeedNotify(); //check if unread feeds are available and change the styling a bit as needed

	//Simplification functions for loading feed info onto widgets
	void updateFeed(QString ID);
	void updateFeedInfo(QString ID);

private slots:
	void loadIcons();

	//GUI slots
	// - Page management
	void backToFeeds();
	void openFeedInfo();
	void openFeedNew();
	void openSettings();
	// - Feed Management
	void addNewFeed(); // the "add" button (current url in widget on page)
	void loadPreset(QAction*); //the add-preset menu
	void removeFeed(); // the "remove" button (current feed for page)
	void resyncFeeds();
	// - Feed Interactions
	void currentFeedChanged();
	void openFeedPage(); //Open the website in a browser
	void saveSettings();

	//Feed Object interactions
	void UpdateFeedList();
	void RSSItemChanged(QString ID);

public slots:
	void LocaleChange();
	void ThemeChange();

};
#endif
bgstack15