You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
897 B
45 lines
897 B
/* 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
|