Fix crash on logout
[kdenetwork.git] / ksirc / nickColourMaker.h
blob1c79480b5b4bedddbd43033fffcce2bb2f4c320e
1 /* This file is part of the KDE project
2 Copyright (C) 2003 Andrew Stanley-Jones
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GPL.
6 */
7 #ifndef __nickcolourmaker_h__
8 #define __nickcolourmaker_h__
10 #include <q3dict.h>
11 #include <qstring.h>
12 #include <qmap.h>
13 #include <qcolor.h>
14 #include "ksopts.h"
16 struct nickColourInfo
18 nickColourInfo(int _fg) { fg = _fg; }
19 int fg;
22 // Helper class to parse IRC colour nicks in the
23 // irc channel and the nick list
24 class nickColourMaker
26 public:
27 nickColourMaker();
29 int findIdx(QString nick) const;
30 QColor findFg(QString nick) const;
31 QColor operator[]( QString nick ) const
33 return findFg(nick);
36 static nickColourMaker *colourMaker() { return s_ncm; }
39 private:
40 static nickColourMaker *s_ncm;
41 Q3Dict<nickColourInfo> m_nicks;
44 #endif