summaryrefslogtreecommitdiffstats
path: root/konversation/src/highlight.cpp
blob: 419dceb0812cc8dcca099050c2393dc166f1d99f (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
45
46
47
48
49
/***************************************************************************
    begin                : Sat Jun 15 2002
    copyright            : (C) 2002 by Matthias Gierlings
    email                : gismore@users.sourceforge.net
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "highlight.h"


unsigned int Highlight::s_id = 0;                 // static

Highlight::Highlight(const TQString& itemPattern,
bool regExp,
const TQColor& itemColor,
const KURL& soundURL,
const TQString& autoText)
{
    m_itemPattern = itemPattern;
    m_autoText = autoText;
    m_itemColor = itemColor;
    m_soundURL = soundURL;
    m_regExp = regExp;

    // unique ID for every Highlight
    m_itemID = s_id++;
}

int Highlight::getID() { return m_itemID; }
TQString Highlight::getPattern() { return m_itemPattern; }
TQString Highlight::getAutoText() { return m_autoText; }
TQColor Highlight::getColor() { return m_itemColor; }
KURL Highlight::getSoundURL() { return m_soundURL; }

void Highlight::setPattern(const TQString& itemPattern) { m_itemPattern = itemPattern; }
void Highlight::setAutoText(const TQString& autoText) { m_autoText = autoText; }
void Highlight::setColor(const TQColor& itemColor) { m_itemColor = itemColor; }
void Highlight::setSoundURL(const KURL& url) { m_soundURL = url; }

void Highlight::setRegExp(bool state)  { m_regExp=state; }
bool Highlight::getRegExp() { return m_regExp; }