Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OpieScreenSaver Class Reference

#include </home/clem/local/src/opie/core/launcher/screensaver.h>

Inheritance diagram for OpieScreenSaver:

Inheritance graph
[legend]
Collaboration diagram for OpieScreenSaver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OpieScreenSaver ()
void restore ()
bool save (int level)
void setIntervals (int i1, int i2, int i3)
void setIntervalsAC (int i1, int i2, int i3)
void setInterval (int interval)
void setMode (int mode)
void setBacklight (int bright)
void setDisplayState (bool on)
void powerStatusChanged (PowerStatus ps)

Protected Member Functions

virtual void timerEvent (QTimerEvent *)

Private Types

enum  {
  LS_Interval = 0, LS_Steps, LS_SensorMin, LS_SensorMax,
  LS_LightMin, LS_LightMax, LS_Count
}

Private Member Functions

void setBacklightInternal (int bright)

Private Attributes

int m_disable_suspend
bool m_enable_dim
bool m_enable_lightoff
bool m_enable_suspend
bool m_onlylcdoff
bool m_enable_dim_ac
bool m_enable_lightoff_ac
bool m_enable_suspend_ac
bool m_onlylcdoff_ac
bool m_use_light_sensor
int m_backlight_sensor
int m_sensordata [LS_Count]
bool m_lcd_status
int m_backlight_normal
int m_backlight_current
bool m_backlight_forcedoff
bool m_on_ac
int m_level

Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
LS_Interval 
LS_Steps 
LS_SensorMin 
LS_SensorMax 
LS_LightMin 
LS_LightMax 
LS_Count 

Definition at line 50 of file screensaver.h.


Constructor & Destructor Documentation

OpieScreenSaver::OpieScreenSaver  ) 
 

Definition at line 15 of file screensaver.cpp.

References Opie::Core::ODevice::inst(), LS_Count, m_backlight_current, m_backlight_forcedoff, m_backlight_normal, m_backlight_sensor, m_disable_suspend, m_enable_dim, m_enable_dim_ac, m_enable_lightoff, m_enable_lightoff_ac, m_enable_suspend, m_enable_suspend_ac, m_lcd_status, m_level, m_on_ac, m_onlylcdoff, m_onlylcdoff_ac, m_sensordata, m_use_light_sensor, and setBacklight().


Member Function Documentation

void OpieScreenSaver::powerStatusChanged PowerStatus  ps  ) 
 

Set display to default ac/battery settings when power status changed.

Definition at line 322 of file screensaver.cpp.

References m_on_ac, PowerStatus::Online, restore(), setBacklight(), and setInterval().

void OpieScreenSaver::restore  ) 
 

Stops the screen saver

Definition at line 52 of file screensaver.cpp.

References Opie::Core::ODevice::inst(), m_lcd_status, m_level, and setBacklightInternal().

Referenced by powerStatusChanged().

bool OpieScreenSaver::save int  level  ) 
 

Starts the screen saver

Parameters:
level what level of screen saving should happen (0=lowest non-off, 1=off, 2=suspend whole machine)
Returns:
true on success

Definition at line 72 of file screensaver.cpp.

References FALSE, Opie::Core::ODevice::inst(), Qt::Key_F34, m_backlight_current, m_disable_suspend, m_enable_dim, m_enable_dim_ac, m_enable_lightoff, m_enable_lightoff_ac, m_enable_suspend, m_enable_suspend_ac, m_lcd_status, m_level, m_on_ac, m_onlylcdoff, m_onlylcdoff_ac, m_use_light_sensor, Network::networkOnline(), QWSServer::sendKeyEvent(), setBacklightInternal(), and TRUE.

void OpieScreenSaver::setBacklight int  bright  ) 
 

Set display brightness

Get's default values for backlight, contrast and light sensor from config file.

Parameters:
bright desired brighness (-1 to use automatic sensor data or value from config file, -2 to toggle backlight on and off, -3 to force backlight off)

Definition at line 205 of file screensaver.cpp.

References contrast, i, Opie::Core::ODevice::inst(), LS_Count, LS_Interval, LS_LightMax, LS_LightMin, LS_SensorMax, LS_SensorMin, LS_Steps, m_backlight_normal, m_on_ac, m_sensordata, m_use_light_sensor, setBacklightInternal(), and timerEvent().

Referenced by OpieScreenSaver(), and powerStatusChanged().

void OpieScreenSaver::setBacklightInternal int  bright  )  [private]
 

Internal brightness setting method

Get's default values for backlight and light sensor from config file.

Parameters:
bright desired brighness (-1 to use automatic sensor data or value from config file, -2 to toggle backlight on and off, -3 to force backlight off)

Definition at line 253 of file screensaver.cpp.

References Opie::Core::ODevice::inst(), m_backlight_current, m_backlight_forcedoff, m_backlight_normal, m_backlight_sensor, and m_use_light_sensor.

Referenced by restore(), save(), setBacklight(), and timerEvent().

void OpieScreenSaver::setDisplayState bool  on  ) 
 

Like ODevice::setDisplayStatus(), but keep current state in m_lcd_status.

Definition at line 310 of file screensaver.cpp.

References Opie::Core::ODevice::inst(), and m_lcd_status.

void OpieScreenSaver::setInterval int  interval  ) 
 

Set suspend time. Will read the dim and lcd-off times from the config file.

Parameters:
interval time in seconds to go into APM suspend, -1 to read value from config file, 0 to disable

Definition at line 182 of file screensaver.cpp.

References setIntervals().

Referenced by powerStatusChanged(), ServerApplication::ServerApplication(), and setMode().

void OpieScreenSaver::setIntervals int  dim,
int  lightoff,
int  suspend
 

Set intervals in seconds for automatic dimming, light off and suspend

This function also sets the member variables m_m_enable_dim[_ac], m_enable_lightoff[_ac], m_enable_suspend[_ac], m_onlylcdoff[_ac]

Parameters:
dim time in seconds to dim, -1 to read value from config file, 0 to disable
lightoff time in seconds to turn LCD backlight off, -1 to read value from config file, 0 to disable
suspend time in seconds to do an APM suspend, -1 to read value from config file, 0 to disable

Definition at line 136 of file screensaver.cpp.

References m_enable_dim, m_enable_dim_ac, m_enable_lightoff, m_enable_lightoff_ac, m_enable_suspend, m_enable_suspend_ac, m_on_ac, m_onlylcdoff, m_onlylcdoff_ac, Config::readBoolEntry(), QWSServer::setScreenSaverInterval(), QWSServer::setScreenSaverIntervals(), and v.

Referenced by setInterval().

void OpieScreenSaver::setIntervalsAC int  i1,
int  i2,
int  i3
 

void OpieScreenSaver::setMode int  mode  ) 
 

Definition at line 188 of file screensaver.cpp.

References m_disable_suspend, and setInterval().

void OpieScreenSaver::timerEvent QTimerEvent *   )  [protected, virtual]
 

Timer event used for automatic setting the backlight according to a light sensor and to set the default brightness

Definition at line 281 of file screensaver.cpp.

References Opie::Core::ODevice::inst(), LS_LightMax, LS_LightMin, LS_SensorMax, LS_SensorMin, LS_Steps, m_backlight_sensor, m_level, m_sensordata, odebug, oendl, s, and setBacklightInternal().

Referenced by setBacklight().


Member Data Documentation

int OpieScreenSaver::m_backlight_current [private]
 

Definition at line 66 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setBacklightInternal().

bool OpieScreenSaver::m_backlight_forcedoff [private]
 

Definition at line 67 of file screensaver.h.

Referenced by OpieScreenSaver(), and setBacklightInternal().

int OpieScreenSaver::m_backlight_normal [private]
 

Definition at line 65 of file screensaver.h.

Referenced by OpieScreenSaver(), setBacklight(), and setBacklightInternal().

int OpieScreenSaver::m_backlight_sensor [private]
 

Definition at line 48 of file screensaver.h.

Referenced by OpieScreenSaver(), setBacklightInternal(), and timerEvent().

int OpieScreenSaver::m_disable_suspend [private]
 

Definition at line 36 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setMode().

bool OpieScreenSaver::m_enable_dim [private]
 

Definition at line 37 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

bool OpieScreenSaver::m_enable_dim_ac [private]
 

Definition at line 42 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

bool OpieScreenSaver::m_enable_lightoff [private]
 

Definition at line 38 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

bool OpieScreenSaver::m_enable_lightoff_ac [private]
 

Definition at line 43 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

bool OpieScreenSaver::m_enable_suspend [private]
 

Definition at line 39 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

bool OpieScreenSaver::m_enable_suspend_ac [private]
 

Definition at line 44 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

bool OpieScreenSaver::m_lcd_status [private]
 

Definition at line 63 of file screensaver.h.

Referenced by OpieScreenSaver(), restore(), save(), and setDisplayState().

int OpieScreenSaver::m_level [private]
 

Definition at line 71 of file screensaver.h.

Referenced by OpieScreenSaver(), restore(), save(), and timerEvent().

bool OpieScreenSaver::m_on_ac [private]
 

Definition at line 69 of file screensaver.h.

Referenced by OpieScreenSaver(), powerStatusChanged(), save(), setBacklight(), and setIntervals().

bool OpieScreenSaver::m_onlylcdoff [private]
 

Definition at line 40 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

bool OpieScreenSaver::m_onlylcdoff_ac [private]
 

Definition at line 45 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), and setIntervals().

int OpieScreenSaver::m_sensordata[LS_Count] [private]
 

Definition at line 61 of file screensaver.h.

Referenced by OpieScreenSaver(), setBacklight(), and timerEvent().

bool OpieScreenSaver::m_use_light_sensor [private]
 

Definition at line 47 of file screensaver.h.

Referenced by OpieScreenSaver(), save(), setBacklight(), and setBacklightInternal().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:43:03 2005 for OPIE by  doxygen 1.4.2