KVIrc  4.9.2
DeveloperAPIs
KviMessageTypeSettings.h
Go to the documentation of this file.
1 #ifndef _KVI_MSGTYPE_H_
2 #define _KVI_MSGTYPE_H_
3 //=============================================================================
4 //
5 // File : KviMessageTypeSettings.h
6 // Creation date : Fri Jun 30 2000 13:50:11 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "kvi_settings.h"
28 #include "KviCString.h"
29 
30 #define KVI_MSGTYPE_MINLEVEL 0
31 #define KVI_MSGTYPE_LEVEL_0 0
32 #define KVI_MSGTYPE_LEVEL_1 1
33 #define KVI_MSGTYPE_LEVEL_2 2
34 #define KVI_MSGTYPE_LEVEL_3 3
35 #define KVI_MSGTYPE_LEVEL_4 4
36 #define KVI_MSGTYPE_LEVEL_5 5
37 #define KVI_MSGTYPE_MAXLEVEL 5
38 
39 // 1 : Common activity
40 // 2 : People talking
41 // 3 : Response messages (whois, dns)
42 // 4 :
43 // 5 : Highlighted text
44 
45 // FIXME: Check the message ranges!!!
46 
48 {
49 public:
50  KviMessageTypeSettings(const char * type, int pixId, unsigned char fore, unsigned char back, bool bLog, int iLevel);
53 
54 public:
55  const char * m_szType;
56  int m_iPixId;
57  unsigned char m_cForeColor;
58  unsigned char m_cBackColor;
60  int m_iLevel;
61 
62 public:
63  void setBack(char back) { m_cBackColor = back; };
64  void setFore(char fore) { m_cForeColor = fore; };
65  int pixId() { return m_iPixId; };
66  int level() { return m_iLevel; };
67  void setLevel(int iLevel)
68  {
69  if((iLevel < KVI_MSGTYPE_MINLEVEL) || (iLevel > KVI_MSGTYPE_MAXLEVEL))
70  m_iLevel = 1;
71  else
72  m_iLevel = iLevel;
73  };
74  void setPixId(int pixId) { m_iPixId = pixId; };
75  unsigned char back() { return m_cBackColor; };
76  unsigned char fore() { return m_cForeColor; };
77  bool logEnabled() { return m_bLogEnabled; };
78  void enableLogging(bool bEnable) { m_bLogEnabled = bEnable; };
79  const char * type() { return m_szType; };
80  KviMessageTypeSettings & operator=(const KviMessageTypeSettings & msg); // deep copy
81 };
82 
83 #endif //_KVI_MSGTYPE_H_
int level()
Definition: KviMessageTypeSettings.h:66
int m_iPixId
Definition: KviMessageTypeSettings.h:56
bool logEnabled()
Definition: KviMessageTypeSettings.h:77
int m_iLevel
Definition: KviMessageTypeSettings.h:60
QString type()
Definition: KviRuntimeInfo.cpp:646
#define KVI_MSGTYPE_MAXLEVEL
Definition: KviMessageTypeSettings.h:37
const char * type()
Definition: KviMessageTypeSettings.h:79
void setLevel(int iLevel)
Definition: KviMessageTypeSettings.h:67
Definition: KviMessageTypeSettings.h:47
const char * m_szType
Definition: KviMessageTypeSettings.h:55
void setPixId(int pixId)
Definition: KviMessageTypeSettings.h:74
void enableLogging(bool bEnable)
Definition: KviMessageTypeSettings.h:78
void setBack(char back)
Definition: KviMessageTypeSettings.h:63
unsigned char m_cBackColor
Definition: KviMessageTypeSettings.h:58
bool m_bLogEnabled
Definition: KviMessageTypeSettings.h:59
#define KVI_MSGTYPE_MINLEVEL
Definition: KviMessageTypeSettings.h:30
int pixId()
Definition: KviMessageTypeSettings.h:65
unsigned char m_cForeColor
Definition: KviMessageTypeSettings.h:57
unsigned char back()
Definition: KviMessageTypeSettings.h:75
This file contains compile time settings.
unsigned char fore()
Definition: KviMessageTypeSettings.h:76
#define KVILIB_API
Definition: kvi_settings.h:125
void setFore(char fore)
Definition: KviMessageTypeSettings.h:64