summaryrefslogtreecommitdiffstats
path: root/klaptopdaemon/daemon_state.h
blob: 2ec5548793e17946a5523707d5d6a5c9bb17d75d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#ifndef __DAEMON_STATE_H
#define __DAEMON_STATE_H 1
/*
 * daemon_state.h
 * Copyright (C) 1999, 2003 Paul Campbell <paul@taniwha.com>
 *
 * This file contains the saved config state for the laptop daemon
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */


#include <tqdir.h>
#include <unistd.h>
#include <time.h>
#include <tqmovie.h>
#include <tqptrlist.h>
#include <tqfileinfo.h>
#include <tqimage.h>
#include <tdelibs_export.h>

class TDE_EXPORT daemon_state
{
public:
    	daemon_state();
    	~daemon_state();
	void	load();
	bool	need_to_run();

	bool 	exists;
	bool	has_brightness;
	bool	has_performance;
	bool	has_throttle;

	TQString noBatteryIcon;
	TQString chargeIcon;
	TQString noChargeIcon;

	//
	//	power out actions
	//

	int	power_wait[2];		// how close to the end when we trigger the action
	int	power_action[2];	// what to do when this action is triggered
	int	power_brightness[2];	// which brightness level to switch to
	bool	power_brightness_enabled[2];	// and whether to switch
	TQString	power_performance[2];	// which performance level to switch to
	bool	power_performance_enabled[2];	// and whether to switch
	TQString	power_throttle[2];	// which throttling level to switch to
	bool	power_throttle_enabled[2];	// and whether to switch
	bool	lav_enabled[2];		// check LAV first
	float	lav_val[2];		// don't act if higher than this

	//
	//	power out warnings
	//

	bool    systemBeep[2];
	bool	logout[2];
	bool	shutdown[2];
	bool    runCommand[2];
	TQString runCommandPath[2];
	bool    playSound[2];
	TQString playSoundPath[2];
	bool    notify[2];
	bool    do_suspend[2];
	bool    do_hibernate[2];
	bool    do_standby[2];
	bool	do_brightness[2];
	int	val_brightness[2];
	bool	do_performance[2];
	TQString	val_performance[2];
	bool	do_throttle[2];
	TQString	val_throttle[2];
        bool    time_based_action_low, time_based_action_critical;
	int	low[4];
	int	poll;			// how often to pol

	

	bool    enabled;
	bool	notifyMeWhenFull;
	bool	useBlankSaver;


	int	have_time;

	// sony jog-bar support
	
	bool sony_enablescrollbar;	// enable jog bar support
	bool sony_middleemulation;	// press on jog bar emulates mouse middle button

	// brightness 
	
	bool bright_pon;		// auto set brightness when powered
	int  bright_son;		// value to set
	bool bright_poff;		// auto set brightness when on battery
	int  bright_soff;		// value to set

	// performance
	
	bool performance_pon, performance_poff;
	TQString performance_val_on, performance_val_off;

	// throttle
	
	bool throttle_pon, throttle_poff;
	TQString throttle_val_on, throttle_val_off;

	// button triggered stuff
  	int button_lid;
  	int button_power;
  	bool button_lid_bright_enabled;
  	bool button_power_bright_enabled;
  	int button_lid_bright_val;
  	int button_power_bright_val;
  	bool button_lid_performance_enabled;
  	bool button_power_performance_enabled;
  	TQString button_lid_performance_val;
  	TQString button_power_performance_val;
  	bool button_lid_throttle_enabled;
  	bool button_power_throttle_enabled;
  	TQString button_lid_throttle_val;
  	TQString button_power_throttle_val;
	bool enable_lid_button;
	bool enable_power_button;

};
#endif