1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 #include <QTextCharFormat>
25 #include <QTextLayout>
34 UiStyle(const QString &settingsKey);
37 /** This enumerates the possible formats a text element may have. */
39 None, Bold, Italic, Underline, Reverse, // Standard formats
40 PlainMsg, NoticeMsg, ServerMsg, ErrorMsg, JoinMsg, PartMsg, QuitMsg, KickMsg, // Internal message formats
41 RenameMsg, ModeMsg, ActionMsg, // ...cnt'd
42 Timestamp, Sender, Nick, Hostmask, ChannelName, ModeFlags, Url, // individual elements
43 FgCol00, FgCol01, FgCol02, FgCol03, FgCol04, FgCol05, FgCol06, FgCol07, // Color codes
44 FgCol08, FgCol09, FgCol10, FgCol11, FgCol12, FgCol13, FgCol14, FgCol15,
45 BgCol00, BgCol01, BgCol02, BgCol03, BgCol04, BgCol05, BgCol06, BgCol07,
46 BgCol08, BgCol09, BgCol10, BgCol11, BgCol12, BgCol13, BgCol14, BgCol15,
47 NumFormatTypes, Invalid // Do not add anything after this
57 QList<QTextLayout::FormatRange> formats;
61 StyledText styleString(const QString &);
63 void setFormat(FormatType, QTextCharFormat, Settings::Mode mode/* = Settings::Custom*/);
64 QTextCharFormat format(FormatType, Settings::Mode mode = Settings::Custom) const;
66 FormatType formatType(const QString &code) const;
67 QString formatCode(FormatType) const;
73 QTextCharFormat mergedFormat(QList<FormatType>);
75 QVector<QTextCharFormat> _defaultFormats;
76 QVector<QTextCharFormat> _customFormats;
77 QHash<QString, FormatType> _formatCodes;