Changeset View
Changeset View
Standalone View
Standalone View
src/common.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | This program is free software; you can redistribute it and/or modify | 2 | This program is free software; you can redistribute it and/or modify | ||
3 | it under the terms of the GNU General Public License as published by | 3 | it under the terms of the GNU General Public License as published by | ||
4 | the Free Software Foundation; either version 2 of the License, or | 4 | the Free Software Foundation; either version 2 of the License, or | ||
5 | (at your option) any later version. | 5 | (at your option) any later version. | ||
6 | */ | 6 | */ | ||
7 | 7 | | |||
8 | /* | 8 | /* | ||
9 | Copyright (C) 2004 Peter Simonsson <psn@linux.se> | 9 | Copyright (C) 2004 Peter Simonsson <psn@linux.se> | ||
10 | Copyright (C) 2006-2008 Eike Hein <hein@kde.org> | 10 | Copyright (C) 2006-2008 Eike Hein <hein@kde.org> | ||
11 | */ | 11 | */ | ||
12 | 12 | | |||
13 | #ifndef COMMON_H | 13 | #ifndef COMMON_H | ||
14 | #define COMMON_H | 14 | #define COMMON_H | ||
15 | 15 | | |||
16 | #include <QObject> | ||||
16 | #include <QByteArray> | 17 | #include <QByteArray> | ||
17 | #include <QHash> | 18 | #include <QHash> | ||
18 | #include <QStringList> | 19 | #include <QStringList> | ||
19 | 20 | | |||
20 | class QString; | 21 | class QString; | ||
21 | class QPixmap; | 22 | class QPixmap; | ||
22 | 23 | | |||
23 | namespace Konversation | 24 | namespace Konversation | ||
24 | { | 25 | { | ||
25 | static QRegExp colorRegExp(QStringLiteral("((\003([0-9]|0[0-9]|1[0-5])(,([0-9]|0[0-9]|1[0-5])|)|\017)|\x02|\x03|\x09|\x13|\x15|\x16|\x1d|\x1f)")); | 26 | static QRegExp colorRegExp(QStringLiteral("((\003([0-9]|0[0-9]|1[0-5])(,([0-9]|0[0-9]|1[0-5])|)|\017)|\x02|\x03|\x09|\x13|\x15|\x16|\x1d|\x1f)")); | ||
26 | static QRegExp urlPattern(QString(QStringLiteral("\\b((?:(?:([a-z][\\w\\.-]+:/{1,3})|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|\\}\\]|[^\\s`!()\\[\\]{};:'\".,<>?%1%2%3%4%5%6])|[a-z0-9.\\-+_]+@[a-z0-9.\\-]+[.][a-z]{1,5}[^\\s/`!()\\[\\]{};:'\".,<>?%1%2%3%4%5%6]))")).arg(QChar(0x00AB)).arg(QChar(0x00BB)).arg(QChar(0x201C)).arg(QChar(0x201D)).arg(QChar(0x2018)).arg(QChar(0x2019))); | 27 | static QRegExp urlPattern(QString(QStringLiteral("\\b((?:(?:([a-z][\\w\\.-]+:/{1,3})|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|\\}\\]|[^\\s`!()\\[\\]{};:'\".,<>?%1%2%3%4%5%6])|[a-z0-9.\\-+_]+@[a-z0-9.\\-]+[.][a-z]{1,5}[^\\s/`!()\\[\\]{};:'\".,<>?%1%2%3%4%5%6]))")).arg(QChar(0x00AB)).arg(QChar(0x00BB)).arg(QChar(0x201C)).arg(QChar(0x201D)).arg(QChar(0x2018)).arg(QChar(0x2019))); | ||
27 | static QRegExp chanExp(QString(QStringLiteral("(^|\\s|^\"|\\s\"|,|'|\\(|\\:|!|@|%|\\+)(#[^,\\s;\\)\\:\\/\\(\\<\\>]*[^.,\\s;\\)\\:\\/\\(\"\''\\<\\>?%1%2%3%4%5%6])")).arg(QChar(0x00AB)).arg(QChar(0x00BB)).arg(QChar(0x201C)).arg(QChar(0x201D)).arg(QChar(0x2018)).arg(QChar(0x2019))); | 28 | static QRegExp chanExp(QString(QStringLiteral("(^|\\s|^\"|\\s\"|,|'|\\(|\\:|!|@|%|\\+)(#[^,\\s;\\)\\:\\/\\(\\<\\>]*[^.,\\s;\\)\\:\\/\\(\"\''\\<\\>?%1%2%3%4%5%6])")).arg(QChar(0x00AB)).arg(QChar(0x00BB)).arg(QChar(0x201C)).arg(QChar(0x201D)).arg(QChar(0x2018)).arg(QChar(0x2019))); | ||
28 | 29 | | |||
29 | enum TabNotifyType | 30 | enum TabNotifyType | ||
30 | { | 31 | { | ||
31 | tnfNick, | 32 | tnfNick, | ||
32 | tnfHighlight, | 33 | tnfHighlight, | ||
33 | tnfPrivate, | 34 | tnfPrivate, | ||
34 | tnfNormal, | 35 | tnfNormal, | ||
35 | tnfSystem, | 36 | tnfSystem, | ||
36 | tnfControl, | 37 | tnfControl, | ||
37 | tnfNone | 38 | tnfNone | ||
38 | }; | 39 | }; | ||
39 | 40 | | |||
40 | enum ConnectionState | | |||
41 | { | | |||
42 | SSNeverConnected, | | |||
43 | SSDeliberatelyDisconnected, | | |||
44 | SSInvoluntarilyDisconnected, | | |||
45 | SSScheduledToConnect, | | |||
46 | SSConnecting, | | |||
47 | SSConnected | | |||
48 | }; | | |||
49 | | ||||
50 | enum ConnectionFlag | 41 | enum ConnectionFlag | ||
51 | { | 42 | { | ||
52 | SilentlyReuseConnection, | 43 | SilentlyReuseConnection, | ||
53 | PromptToReuseConnection, | 44 | PromptToReuseConnection, | ||
54 | CreateNewConnection | 45 | CreateNewConnection | ||
55 | }; | 46 | }; | ||
56 | 47 | | |||
57 | struct TextUrlData | 48 | struct TextUrlData | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |