VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "dwSysPower"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
Option Explicit

' Class dwSysPower
' Desaware API Class library
' Copyright (c) 1996 by Desaware Inc.
' All rights reserved

#If Win32 Then
Private iSysPower As SYSTEM_POWER_STATUS

Public Sub SetSysPower(ACLineStatus As Byte, BatteryFlag As Byte, BatteryLifePercent As Byte, Reserved1 As Byte, BatteryLifeTime As Long, BatteryFullLifeTime As Long)
    iSysPower.ACLineStatus = ACLineStatus
    iSysPower.BatteryFlag = BatteryFlag
    iSysPower.BatteryLifePercent = BatteryLifePercent
    iSysPower.Reserved1 = Reserved1
    iSysPower.BatteryLifeTime = BatteryLifeTime
    iSysPower.BatteryFullLifeTime = BatteryFullLifeTime
End Sub

Public Sub CopyToSYSPOWER(ByVal lpSysPower As Long)
    Dim sp As SYSTEM_POWER_STATUS
    
    If lpSysPower = 0 Then RaiseError 5, "dwSysPower"
    agCopyData iSysPower, ByVal lpSysPower, Len(sp)
End Sub

Public Property Get ACLineStatus() As Byte
    ACLineStatus = iSysPower.ACLineStatus
End Property

Public Property Let ACLineStatus(vNewValue As Byte)
    iSysPower.ACLineStatus = vNewValue
End Property

Public Property Get BatteryFlag() As Byte
    BatteryFlag = iSysPower.BatteryFlag
End Property

Public Property Let BatteryFlag(vNewValue As Byte)
    iSysPower.BatteryFlag = vNewValue
End Property

Public Property Get BatteryLifePercent() As Byte
    BatteryLifePercent = iSysPower.BatteryLifePercent
End Property

Public Property Let BatteryLifePercent(vNewValue As Byte)
    iSysPower.BatteryLifePercent = vNewValue
End Property

Public Property Get Reserved1() As Byte
    Reserved1 = iSysPower.Reserved1
End Property

Public Property Let Reserved1(vNewValue As Byte)
    iSysPower.Reserved1 = vNewValue
End Property

Public Property Get BatteryLifeTime() As Long
    BatteryLifeTime = iSysPower.BatteryLifeTime
End Property

Public Property Let BatteryLifeTime(vNewValue As Long)
    iSysPower.BatteryLifeTime = vNewValue
End Property

Public Property Get BatteryFullLifeTime() As Long
    BatteryFullLifeTime = iSysPower.BatteryFullLifeTime
End Property

Public Property Let BatteryFullLifeTime(vNewValue As Long)
    iSysPower.BatteryFullLifeTime = vNewValue
End Property

#End If ' this class only exists in win32
