summaryrefslogtreecommitdiffstats
path: root/ksirc/nickColourMaker.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /ksirc/nickColourMaker.h
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/nickColourMaker.h')
-rw-r--r--ksirc/nickColourMaker.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/ksirc/nickColourMaker.h b/ksirc/nickColourMaker.h
new file mode 100644
index 00000000..239a7935
--- /dev/null
+++ b/ksirc/nickColourMaker.h
@@ -0,0 +1,44 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Andrew Stanley-Jones
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GPL.
+*/
+#ifndef __nickcolourmaker_h__
+#define __nickcolourmaker_h__
+
+#include <qdict.h>
+#include <qstring.h>
+#include <qmap.h>
+#include <qcolor.h>
+#include "ksopts.h"
+
+struct nickColourInfo
+{
+ nickColourInfo(int _fg) { fg = _fg; }
+ int fg;
+};
+
+// Helper class to parse IRC colour nicks in the
+// irc channel and the nick list
+class nickColourMaker
+{
+public:
+ nickColourMaker();
+
+ int findIdx(QString nick) const;
+ QColor findFg(QString nick) const;
+ QColor operator[]( QString nick ) const
+ {
+ return findFg(nick);
+ }
+
+ static nickColourMaker *colourMaker() { return s_ncm; }
+
+
+private:
+ static nickColourMaker *s_ncm;
+ QDict<nickColourInfo> m_nicks;
+};
+
+#endif