home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 February / Chip_2004-02_cd1.bin / zkuste / konfig / download / msic / Help / Int / MSI_APM.int < prev    next >
Text File  |  2003-08-26  |  2KB  |  47 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       MiTeC System Information Component              }
  4. {               APM Detection Part                      }
  5. {           version 8.0 for Delphi 5,6,7                }
  6. {                                                       }
  7. {       Copyright ⌐ 1997,2003 Michal Mutl               }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. {$INCLUDE MITEC_DEF.INC}
  12.  
  13. unit MSI_APM;
  14.  
  15. interface
  16.  
  17. uses
  18.   SysUtils, Windows, Classes;
  19.  
  20. type
  21.   TPowerStatus = (psUnknown, psOffline, psOnline);
  22.  
  23.   TBatteryStatus = (bsUnknown, bsHigh, bsLow, bsCritical, bsCharging, bsNoBattery);
  24.  
  25.   TAPM = class(TPersistent)
  26.   private
  27.     FBatteryLifePercent: Byte;
  28.     FBatteryLifeFullTime: DWORD;
  29.     FBatteryLifeTime: DWORD;
  30.     FACPowerStatus: TPowerStatus;
  31.     FBatteryChargeStatus: TBatteryStatus;
  32.   public
  33.     procedure GetInfo;
  34.     procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
  35.     function GetACPSStr(ACPS: TPowerStatus): string;
  36.     function GetBSStr(BS: TBatteryStatus): string;
  37.   published
  38.     property ACPowerStatus :TPowerStatus read FACPowerStatus {$IFNDEF D6PLUS} write FACPowerStatus {$ENDIF} stored false;
  39.     property BatteryChargeStatus :TBatteryStatus read FBatteryChargeStatus {$IFNDEF D6PLUS} write FBatteryChargeStatus {$ENDIF} stored false;
  40.     property BatteryLifePercent :Byte read FBatteryLifePercent {$IFNDEF D6PLUS} write FBatteryLifePercent {$ENDIF} stored false;
  41.     property BatteryLifeTime :DWORD read FBatteryLifeTime {$IFNDEF D6PLUS} write FBatteryLifeTime {$ENDIF} stored false;
  42.     property BatteryLifeFullTime :DWORD read FBatteryLifeFullTime {$IFNDEF D6PLUS} write FBatteryLifeFullTime {$ENDIF} stored false;
  43.   end;
  44.  
  45. implementation
  46.  
  47.