1 //===========================================
2 //  Lumina-DE source code
3 //  Copyright (c) 2014, Ken Moore
4 //  Available under the 3-clause BSD license
5 //  See the LICENSE file for full details
6 //===========================================
7 #ifdef __OSNAME__
8 #include "LuminaOS.h"
9 #include <unistd.h>
10 #include <stdio.h> // Needed for BUFSIZ
11 
OSName()12 QString LOS::OSName(){ return "Unknown"; }
13 
14 //OS-specific prefix(s)
15 // NOTE: PREFIX, L_ETCDIR, L_SHAREDIR are defined in the OS-detect.pri project file and passed in
LuminaShare()16 QString LOS::LuminaShare(){ return (L_SHAREDIR+"/lumina-desktop/"); } //Install dir for Lumina share files
AppPrefix()17 QString LOS::AppPrefix(){ return "/usr/local/"; } //Prefix for applications
SysPrefix()18 QString LOS::SysPrefix(){ return "/usr/"; } //Prefix for system
19 
20 //OS-specific application shortcuts (*.desktop files)
ControlPanelShortcut()21 QString LOS::ControlPanelShortcut(){ return ""; } //system control panel
AppStoreShortcut()22 QString LOS::AppStoreShortcut(){ return ""; } //graphical app/pkg manager
23 //OS-specific RSS feeds (Format: QStringList[ <name>::::<url> ]; )
RSSFeeds()24 QStringList LOS::RSSFeeds(){ return QStringList(); }
25 
26 // ==== ExternalDevicePaths() ====
ExternalDevicePaths()27 QStringList LOS::ExternalDevicePaths(){
28     //Returns: QStringList[<type>::::<filesystem>::::<path>]
29       //Note: <type> = [USB, HDRIVE, DVD, SDCARD, UNKNOWN]
30 
31   //Not implemented yet
32   return QStringList();
33 }
34 
35 //Read screen brightness information
ScreenBrightness()36 int LOS::ScreenBrightness(){
37   //Returns: Screen Brightness as a percentage (0-100, with -1 for errors)
38   return -1;  //not implemented yet
39 }
40 
41 //Set screen brightness
setScreenBrightness(int)42 void LOS::setScreenBrightness(int){ //percent: 0-100
43   //not implemented yet
44 }
45 
46 //Read the current volume
audioVolume()47 int LOS::audioVolume(){
48   //Returns: audio volume as a percentage (0-100, with -1 for errors)
49   return -1; //Not implemented yet
50 }
51 
52 //Set the current volume
setAudioVolume(int)53 void LOS::setAudioVolume(int){ //percent: 0-100
54   //not implemented yet
55 }
56 
57 //Change the current volume a set amount (+ or -)
changeAudioVolume(int)58 void LOS::changeAudioVolume(int){ //percent difference from current (+ or -)
59   //not implemented yet
60 }
61 
62 //Check if a graphical audio mixer is installed
hasMixerUtility()63 bool LOS::hasMixerUtility(){
64   return false; //not implemented yet
65 }
66 
67 //Launch the graphical audio mixer utility
startMixerUtility()68 void LOS::startMixerUtility(){
69   //not implemented yet
70 }
71 
72 //Check for user system permission (shutdown/restart)
userHasShutdownAccess()73 bool LOS::userHasShutdownAccess(){
74   return false; //not implemented yet
75 }
76 
77 //Check for whether the system is safe to power off (no updates being perfomed)
systemPerformingUpdates()78 bool LOS::systemPerformingUpdates(){
79   return false; //Not implemented yet
80 }
81 //Return the details of any updates which are waiting to apply on shutdown
systemPendingUpdates()82 QString LOS::systemPendingUpdates(){
83   return "";
84 }
85 
86 //System Shutdown
systemShutdown(bool)87 void LOS::systemShutdown(bool){ //start poweroff sequence
88   //INPUT: skip updates (true/false)
89   QProcess::startDetached("shutdown -p now");
90 }
91 
92 //System Restart
systemRestart(bool)93 void LOS::systemRestart(bool){ //start reboot sequence
94   //INPUT: skip updates (true/false)
95   QProcess::startDetached("shutdown -r now");
96 }
97 
98 //Check for suspend support
systemCanSuspend()99 bool LOS::systemCanSuspend(){
100   return false;
101 }
102 
103 //Put the system into the suspend state
systemSuspend()104 void LOS::systemSuspend(){
105 
106 }
107 
108 //Battery Availability
hasBattery()109 bool LOS::hasBattery(){
110   return false; //not implemented yet
111 }
112 
113 //Battery Charge Level
batteryCharge()114 int LOS::batteryCharge(){ //Returns: percent charge (0-100), anything outside that range is counted as an error
115   return -1;  //not implemented yet
116 }
117 
118 //Battery Charging State
batteryIsCharging()119 bool LOS::batteryIsCharging(){
120   return false; //not implemented yet
121 }
122 
123 //Battery Time Remaining
batterySecondsLeft()124 int LOS::batterySecondsLeft(){ //Returns: estimated number of seconds remaining
125   return 0; //not implemented yet
126 }
127 
128 //File Checksums
Checksums(QStringList)129 QStringList LOS::Checksums(QStringList){ //QStringList filepaths
130   //Return: checksum of the input file
131   return QStringList();
132 }
133 
134 //file system capacity
FileSystemCapacity(QString)135 QString LOS::FileSystemCapacity(QString) { //QString directory path
136   //Return: percentage capacity as give by the df command
137   return QString();
138 }
139 
CPUTemperatures()140 QStringList LOS::CPUTemperatures(){ //Returns: List containing the temperature of any CPU's ("50C" for example)
141   return QStringList(); //not implemented yet
142 }
143 
CPUUsagePercent()144 int LOS::CPUUsagePercent(){ //Returns: Overall percentage of the amount of CPU cycles in use (-1 for errors)
145   return -1; //not implemented yet
146 }
147 
MemoryUsagePercent()148 int LOS::MemoryUsagePercent(){
149   return -1; //not implemented yet
150 }
151 
DiskUsage()152 QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device
153   return QStringList(); //not implemented yet
154 }
155 #endif
156