• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

klaptopdaemon

portable.h

Go to the documentation of this file.
00001 #include <QLabel>
00002 //Added by qt3to4:
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  * Copyright (c) 2002 Paul Campbell <paul@taniwha.com>
00012  *
00013  *  This program is free software; you can redistribute it and/or modify
00014  *  it under the terms of the GNU General Public License as published by
00015  *  the Free Software Foundation; either version 2 of the License, or
00016  *  (at your option) any later version.
00017  *
00018  *  This program is distributed in the hope that it will be useful,
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *  GNU General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU General Public License
00024  *  along with this program; if not, write to the Free Software
00025  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00026  */
00027 
00028 struct power_result {
00029     int powered ;   // true if we're plugged into the wall
00030     int percentage; // value 0-100 percentage of battery left
00031     int time;       // time in minutes left - -1 if this is not supported by the BIOS
00032 };
00033 
00034 
00035 // ATTENTION: if you change something in here, please update ALL of the
00036 //            ported sections in the implementation file!
00037 
00038 class KDE_EXPORT laptop_portable {
00039 public:
00040     static void power_management_restart(); // reset internal state
00041     static int has_power_management();  // returns 1 if this computer has power management
00042     static int has_battery_time();      // returns 1 if this give BIOS battery time info
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);        // returns 1 if this computer has linux-style apm of some particular type
00066     static int has_apm() { return has_apm(0); } // returns 1 if this computer has linux-style apm
00067     static int has_acpi(int);       // returns 1 if this computer has linux-style acpi of some particular type
00068     static int has_acpi() { return has_acpi(0); }   // returns 1 if this computer has linux-style acpi
00069     static bool has_software_suspend(int type); // // returns 1 if the system has software suspend available
00070     static bool has_software_suspend() { return has_software_suspend(0); }
00071     static int has_cpufreq();       // returns 1 if this computer can scale the cpu frequency
00072     static int has_brightness();        // returns 1 if this computer can set tyhe back panel brightness
00073     static void set_brightness(bool blank, int val);    // val = 0-255 255 brightest, 0 means dimmest (if !blank it must be still visible), 
00074     static int get_brightness();        // returns 0-255 brightness, -1 if you can't
00075     static QString cpu_frequency();     // Returns the cpu freq.
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); // get multiple battery status
00100     static bool has_lav();          // true if the following returns a valid value
00101     static float get_load_average();    // current short term 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 &current, QStringList &s, bool *&active);
00117 
00123     static void set_system_performance(QString val);
00124 
00134     static bool get_system_throttling(bool force, int &current, 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); // true if we have support for a particular button
00145     static bool get_button(LaptopButton p); // true if a button is pressed
00146 };
00147 
00148 #endif

klaptopdaemon

Skip menu "klaptopdaemon"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal