klaptopdaemon
portable.h
Go to the documentation of this file.00001 #include <QLabel>
00002
00003 #include <QVBoxLayout>
00004 #include <kactivelabel.h>
00005 #include <kconfig.h>
00006 #include <qstringlist.h>
00007
00008 #ifndef PORTABLE_H
00009 #define PORTABLE_H
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 struct power_result {
00029 int powered ;
00030 int percentage;
00031 int time;
00032 };
00033
00034
00035
00036
00037
00038 class KDE_EXPORT laptop_portable {
00039 public:
00040 static void power_management_restart();
00041 static int has_power_management();
00042 static int has_battery_time();
00043
00049 static int has_suspend();
00050
00056 static int has_standby();
00057
00063 static int has_hibernation();
00064
00065 static int has_apm(int);
00066 static int has_apm() { return has_apm(0); }
00067 static int has_acpi(int);
00068 static int has_acpi() { return has_acpi(0); }
00069 static bool has_software_suspend(int type);
00070 static bool has_software_suspend() { return has_software_suspend(0); }
00071 static int has_cpufreq();
00072 static int has_brightness();
00073 static void set_brightness(bool blank, int val);
00074 static int get_brightness();
00075 static QString cpu_frequency();
00076 static KActiveLabel *no_power_management_explanation(QWidget *parent);
00077 static QLabel *how_to_do_suspend_resume(QWidget *parent);
00078 static QLabel *pcmcia_info(int x, QWidget *parent);
00079
00084 static void invoke_standby();
00085
00090 static void invoke_suspend();
00091
00096 static void invoke_hibernation();
00097
00098 static struct power_result poll_battery_state();
00099 static void get_battery_status(int &num_batteries, QStringList &names, QStringList &state, QStringList &values);
00100 static bool has_lav();
00101 static float get_load_average();
00102 static void extra_config(QWidget *parent, KConfig *config, QVBoxLayout *layout);
00103 static void acpi_set_mask(bool standby, bool suspend, bool hibernate, bool perf, bool throttle);
00104 static void apm_set_mask(bool standby, bool suspend);
00105 static void software_suspend_set_mask(bool hibernate);
00106
00116 static bool get_system_performance(bool force, int ¤t, QStringList &s, bool *&active);
00117
00123 static void set_system_performance(QString val);
00124
00134 static bool get_system_throttling(bool force, int ¤t, QStringList &s, bool *&active);
00135
00141 static void set_system_throttling(QString val);
00142
00143 enum LaptopButton {LidButton=0, PowerButton};
00144 static bool has_button(LaptopButton p);
00145 static bool get_button(LaptopButton p);
00146 };
00147
00148 #endif