summaryrefslogtreecommitdiffstats
path: root/ksystemlog/src/globals.h
blob: 7658ab4b3259d98df3d2d643d8675fde8393f3ce (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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/***************************************************************************
 *   Copyright (C) 2005 by Nicolas Ternisien                               *
 *   nicolas.ternisien@gmail.com                                           *
 *                                                                         *
 *   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.             *
 ***************************************************************************/

#ifndef _GLOBALS_H_
#define _GLOBALS_H_

#include <tqptrlist.h>
#include <tqstring.h>


//Redefined here to compile correctly (crossed-header problem)
class LogLevel;
typedef TQPtrList<LogLevel> LogLevels;


//Redefined here to compile correctly (crossed-header problem)
class LogMode;
typedef TQPtrList<LogMode> LogModes;

#define DEFAULT_FOLDER "/var/log"

/**
 * Icon name of KSystemLog
 */
#define KSYSTEMLOG_ICON "ksystemlog"



// String was "none"
#define NONE_LOG_LEVEL_ICON "help" 

#define DEBUG_LOG_LEVEL_ICON "attach"
#define INFORMATION_LOG_LEVEL_ICON "messagebox_info"
#define NOTICE_LOG_LEVEL_ICON "endturn"
#define WARNING_LOG_LEVEL_ICON "messagebox_warning"
#define ERROR_LOG_LEVEL_ICON "messagebox_critical"
#define CRITICAL_LOG_LEVEL_ICON "core"
#define ALERT_LOG_LEVEL_ICON "kalarm"
#define EMERGENCY_LOG_LEVEL_ICON "exit"

enum logLevelIds {
	NONE_LOG_LEVEL_ID=0,
	DEBUG_LOG_LEVEL_ID,
	INFORMATION_LOG_LEVEL_ID,
	NOTICE_LOG_LEVEL_ID,
	WARNING_LOG_LEVEL_ID,
	ERROR_LOG_LEVEL_ID,
	CRITICAL_LOG_LEVEL_ID,
	ALERT_LOG_LEVEL_ID,
	EMERGENCY_LOG_LEVEL_ID,
};

enum groupByType {
	NO_GROUP_BY=0,
	GROUP_BY_LOG_LEVEL,
	GROUP_BY_DAY,
	GROUP_BY_HOUR,
	GROUP_BY_LOG_FILE,
	GROUP_BY_COLUMN
};

//This variable only counts GROUP_BY methods != than GROUP_BY_COLUMN
#define DEFAULT_GROUP_BY_COUNT 5

#define NO_GROUP_BY_ICON "cancel"
#define GROUP_BY_LOG_LEVEL_ICON INFORMATION_LOG_LEVEL_ICON
#define GROUP_BY_DAY_ICON "today"
#define GROUP_BY_HOUR_ICON "clock"
#define GROUP_BY_LOG_FILE_ICON "file"

#define GROUP_BY_COLUMN_ICON "view_text"


//Icon of the Group By action
#define GROUP_BY_ICON "view_tree"


/**
 * Icon names of different existing modes
 */
#define NO_MODE_ICON "ksystemlog"

#define OPENING_MODE_ICON "file"

#define SYSTEM_MODE_ICON "hwinfo"
#define KERNEL_MODE_ICON "openterm"
#define XORG_MODE_ICON "x"
#define BOOT_MODE_ICON "system"
#define AUTHENTICATION_MODE_ICON "kuser"
#define DAEMON_MODE_ICON "misc"
#define CRON_MODE_ICON "history"


#define SAMBA_MODE_ICON "samba"
#define PROFTP_MODE_ICON "ftp"

#define ACPID_MODE_ICON "connect_no"

#define CUPS_MODE_ICON "fileprint"
#define CUPS_ACCESS_MODE_ICON "history"

#define APACHE_MODE_ICON "network"
#define APACHE_ACCESS_MODE_ICON "history"

#define MAIL_MODE_ICON "email"

#define SAMBA_MODE_ICON "samba"

class Globals {
	public:
		static void setupLogModes();
		
		static void setupLogLevels();
		
		/**
		 * Existing Log modes. The id value corresponds to the index in the vector
		 */
		static LogModes logModes;
		
		/**
		 * These value are only pointers to item of the previous vector,
		 * they are provided for convenience
		 */
		static LogMode* noMode;
		static LogMode* openingMode;
		static LogMode* systemMode;
		static LogMode* kernelMode;
		static LogMode* xorgMode;
		static LogMode* bootMode;
		static LogMode* authenticationMode;
		static LogMode* cronMode;
		static LogMode* daemonMode;
		
		static LogMode* acpidMode;
		static LogMode* cupsMode;
		static LogMode* cupsAccessMode;

		static LogMode* apacheMode;
		static LogMode* apacheAccessMode;

		static LogMode* mailMode;
		
		static LogMode* sambaMode;
		
		/**
		 * Existing Log levels. The id value corresponds to the index in the vector
		 */
		static LogLevels logLevels;
		
		/**
		 * These value are only pointers to item of the previous vector, 
		 * they are provided for convenience
		 */
		static LogLevel* noneLogLevel;
		static LogLevel* debugLogLevel;
		static LogLevel* informationLogLevel;
		static LogLevel* noticeLogLevel;
		static LogLevel* warningLogLevel;
		static LogLevel* errorLogLevel;
		static LogLevel* criticalLogLevel;
		static LogLevel* alertLogLevel;
		static LogLevel* emergencyLogLevel;
	
};


#endif