aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/OSInterface-template.cpp
blob: 62915f2f273f72daae590b59a0dbbfc595fc9427 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//===========================================
//  Lumina desktop source code
//  Copyright (c) 2017, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#include <OSInterface.h>

//===========
//    PUBLIC
//===========

//Simple functions used to determine if the current OS supports using this class, and what levels of support
QList<OSInterface::Interface> OSInterface::supportedNotifications(){
  //Which interfaces provide change notifications
  return QList< OSInterface::Interface >();
}

QList<OSInterface::Interface> OSInterface::supportedStatus(){
  //Which interfaces are available for "status" requests
  return QList< OSInterface::Interface >();
}

QList<OSInterface::Interface> OSInterface::supportedModify(){
   //Which interfaces are available for "modify" requests
  return QList< OSInterface::Interface >();
}

//Start/stop interface watchers/notifications (each only called once per session)
void OSInterface::start(){
 //nothing to do
}

void OSInterface::stop(){
 //nothing to do
}
	
//Generic status update
QList<QVariant> OSInterface::status(OSInterface::Interface){
	// ==== Interface status output lists ====
	//  Battery: [ float (percent charge), bool (is Charging), double (seconds remaining) ];
	//  Volume: [int (percent volume) ]
	//  Devices: [ QStringList[ name, mountpoint, type (optional)] ]  (List length depends on number of devices)
	//  Network: [bool (network access available)]
	//  PowerOff: [bool (can power off system)]
	//  Reboot: [bool (can reboot system)]
	//  Suspend: [bool (can suspend system)]
	//  Updates: [bool (is updating), bool (reboot required)]
	// ==========
  return QList<QVariant>();
}

//Individual Interface interactions
bool OSInterface::modify(OSInterface::Interface, QList<QVariant> args){ //returns: success/failure
	// ==== Interface modification argument lists ====
	//  Battery: <NO MODIFICATION>
	//  Volume: [int (set percent volume) ]
	//  Devices: <NO MODIFICATION>
	//  Network: <NO MODIFICATION>
	//  PowerOff: [bool (skip updates - optional)]
	//  Reboot: [bool (skip updates - optional)]
	//  Suspend: [] (No input arguments)
	//  Updates: <NO MODIFICATION>
	// ==========
  return false;
}

//=================
//     PRIVATE SLOTS
//=================
//FileSystemWatcher slots
void OSInterface::watcherFileChanged(QString){

}

void OSInterface::watcherDirChanged(QString){

}

//IO Device slots
void OSInterface::iodeviceReadyRead(){

}

void OSInterface::iodeviceAboutToClose(){

}

//NetworkAccessManager slots
void OSInterface::netAccessChanged(QNetworkAccessManager::NetworkAccessibility){

}

void OSInterface::netRequestFinished(QNetworkReply*){

}

void OSInterface::netSslErrors(QNetworkReply*, const QList<QSslError>&){

}
bgstack15