summaryrefslogtreecommitdiffstats
path: root/ksirc/nickColourMaker.h
blob: ab3593fd87d20ff552d775f636521efdec6f1d54 (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
/* 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 <tqdict.h>
#include <tqstring.h>
#include <tqmap.h>
#include <tqcolor.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(TQString nick) const;
    TQColor findFg(TQString nick) const;
    TQColor operator[]( TQString nick ) const
    {
        return findFg(nick);
    }

    static nickColourMaker *colourMaker() { return s_ncm; }


private:
    static nickColourMaker *s_ncm;
    TQDict<nickColourInfo> m_nicks;
};

#endif