source: lumina/libLumina/LuminaOS.h @ 733da14

enter/10releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since 733da14 was 733da14, checked in by Ken Moore <ken@…>, 10 months ago

Move all the OS-specific functions into the LuminaOS class (LOS), and create the shell for the Linux version with all the previous submissions to make it work on Linux.

  • Property mode set to 100644
File size: 1.9 KB
Line 
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//  This is the main interface for any OS-specific system calls
8//    To port Lumina to a different operating system, just create a file
9//    called "LuminaOS-<Operating System>.cpp", and use that file in
10//    the project (libLumina.pro) instead of LuminaOS-FreeBSD.cpp
11//===========================================
12#ifndef _LUMINA_LIBRARY_OS_H
13#define _LUMINA_LIBRARY_OS_H
14
15#include <QString>
16#include <QStringList>
17#include <QProcess>
18
19#include "LuminaUtils.h"
20
21class LOS{
22public:
23        //Scan for mounted external devices
24        static QStringList ExternalDevicePaths(); //Returns: QStringList[<type>::::<filesystem>::::<path>]
25          //Note: <type> = [USB, HDRIVE, DVD, SDCARD, UNKNOWN]
26
27        //Read screen brightness information
28        static int ScreenBrightness(); //Returns: Screen Brightness as a percentage (0-100, with -1 for errors)
29        //Set screen brightness
30        static void setScreenBrightness(int percent);
31
32        //Read the current volume
33        static int audioVolume(); //Returns: audio volume as a percentage (0-100, with -1 for errors)
34        //Set the current volume
35        static void setAudioVolume(int percent);
36        //Modify the current volume by a set amount (+ or -)
37        static void changeAudioVolume(int percentdiff);
38
39        //System Shutdown
40        static void systemShutdown(); //start poweroff sequence
41        //System Restart
42        static void systemRestart(); //start reboot sequence
43
44        //Battery Availability
45        static bool hasBattery();
46        //Battery Charge Level
47        static int batteryCharge(); //Returns: percent charge (0-100), anything outside that range is counted as an error
48        //Battery Charging State
49        static bool batteryIsCharging();
50        //Battery Time Remaining
51        static int batterySecondsLeft(); //Returns: estimated number of seconds remaining
52};
53
54#endif
Note: See TracBrowser for help on using the repository browser.