aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-cpp/RootDesktopObject.h
blob: 4bc568d35018805a19f327d43d2ec59bf4a6c206 (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
//===========================================
//  Lumina-desktop source code
//  Copyright (c) 2017, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
// This is the base C++ object that is used to pass information to the QML "RootDesktop" object
//===========================================
#ifndef _LUMINA_DESKTOP_QML_BACKEND_ROOT_DESKTOP_OBJECT_H
#define _LUMINA_DESKTOP_QML_BACKEND_ROOT_DESKTOP_OBJECT_H
#include <QObject>
#include <QList>

#include "ScreenObject.h"

class RootDesktopObject : public QObject{
	Q_OBJECT
	//Define all the QML Properties here (interface between QML and the C++ methods below)
	Q_PROPERTY( QList<ScreenObject*> screens READ screens NOTIFY screensChanged)

public:
	//main contructor/destructor
	RootDesktopObject(QObject *parent = 0);
	~RootDesktopObject();

	static void RegisterType();

	//primary interface to fetch the current instance of the class (so only one is running at any given time)
	static RootDesktopObject* instance();

	//QML Read Functions
	QList<ScreenObject*> screens();

	//QML Access Functions
	Q_INVOKABLE void logout();
	Q_INVOKABLE void mousePositionChanged();
private:
	QList<ScreenObject*> s_objects;

public slots:
	void updateScreens(); //rescan/update screen objects
	void ChangeWallpaper(QString screen, QString);

private slots:

signals:
	void screensChanged();
	void startLogout();
	void mouseMoved();

};
#endif
bgstack15