7 #include <qstringlist.h>
12 #include <qdatetime.h>
14 #define IRC_SAFE_MAX_LINE 450
16 #include "boundscheckingarray.h"
17 #include "ksircchannel.h"
18 #include "ksircserver.h"
20 // Central place to hold KSirc's options
21 // and manage default values. The base classes
22 // are only used directly by the prefs dialog.
23 // The constructors initialize all options with default values.
29 enum { SDI
, MDI
} displayMode
;
30 bool autoCreateWin
: 1;
31 bool autoCreateWinForNotice
: 1;
32 bool nickCompletion
: 1;
33 bool displayTopic
: 1;
34 bool oneLineEntry
: 1;
36 // bool timeStamp : 1;
37 // bool beepNotify : 1;
40 // bool beepOnMsg : 1;
43 bool useColourNickList
: 1;
44 // bool topicShow : 1;
46 bool autoSaveHistory
: 1;
48 QString backgroundFile
;
50 QPixmap
backgroundPixmap();
53 QPixmap m_backgroundPixmap
;
69 bool filterJoinPart
: 1;
74 static bool applyGlobally
;
92 QStringList notifyList
;
107 // QStringList notifyList;
113 enum { numColors
= 16 };
123 bool ownNickBold
: 1;
127 QColor msgContainNick
; // needs config + impl
128 QColor msg1Contain
; // needs config
129 QString msg1String
; // needs config
131 QColor msg2Contain
; // need config
132 QString msg2String
; // needs config
135 QColor nickForeground
;
136 QColor nickBackground
;
137 QColor backgroundColor
;
138 QColor selBackgroundColor
;
139 QColor selForegroundColor
;
140 //QColor ircColors[numColors];
141 BoundsCheckingArray
<QColor
, numColors
> ircColors
;
142 BoundsCheckingArray
<bool, numColors
> nickHighlight
;
147 bool ksircColors
: 1;
149 bool nickColourization
: 1;
165 typedef QMap
<QString
, KSOChannel
> ChannelOpMap
;
166 typedef QMap
<QString
, ChannelOpMap
> ServerChannelOpMap
;
167 typedef QMap
<QString
, KSOServer
> ServerOpMap
;
177 KSOptions() { s_options
= this; }
179 void load( int sections
= -1 );
180 void save( int sections
= -1 );
182 static KSOptions
*options() { return s_options
; }
184 ServerChannelOpMap channel
;
187 KSOChannel
&chan( const KSircChannel
&chanInfo
)
189 return channel
[chanInfo
.server()][chanInfo
.channel()];
192 KSOServer
&serv( const KSircServer
&servInfo
)
194 return server
[servInfo
.server()];
197 void channelSetup(QString serv
, QString chan
);
198 void applyChannelGlobal(void);
200 void serverSetup(QString server
);
201 void serverSetup( const KSircServer
&servInfo
)
203 serverSetup(servInfo
.server());
207 All
= -1, General
= 1, Startup
= 2,
208 Colors
= 4, RMBMenu
= 8, ServChan
= 16,
209 Channels
= 32, Servers
= 64
213 static KSOptions
*s_options
;
216 #define ksopts (KSOptions::options())