KVIrc  4.9.2
DeveloperAPIs
OptionsWidget_message.h
Go to the documentation of this file.
1 #ifndef _OPTW_MESSAGES_H_
2 #define _OPTW_MESSAGES_H_
3 //=============================================================================
4 //
5 // File : OptionsWidget_message.h
6 // Creation date : Sat Aug 11 2001 18:11:21 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "KviOptionsWidget.h"
28 #include "KviMessageTypeSettings.h"
29 #include "KviIconManager.h"
30 
31 #include <QTreeWidget>
32 #include <QItemDelegate>
33 #include <QCheckBox>
34 #include <QToolButton>
35 #include <QPainter>
36 #include <QMenu>
37 
38 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_message KviIconManager::Messages
39 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_message __tr2qs_no_lookup("Text")
40 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_message __tr2qs_no_lookup("theme,colors,output")
41 #define KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_message "theme"
42 #define KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_message true
43 
45 {
46  Q_OBJECT
47 public:
48  OptionsWidget_message(QWidget * pParent);
50 };
51 
52 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_privmsg KviIconManager::Raw
53 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_privmsg __tr2qs_no_lookup("Message Style")
54 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_privmsg OptionsWidget_message
55 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_privmsg 40
56 #define KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_privmsg "theme"
57 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_privmsg __tr2qs_no_lookup("theme,privmsg,output,format")
58 
60 {
61  Q_OBJECT
62 public:
63  OptionsWidget_privmsg(QWidget * parent);
65 
66 public:
70 protected slots:
72 };
73 
74 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_timestamp KviIconManager::Time
75 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_timestamp __tr2qs_no_lookup("Timestamp")
76 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_timestamp OptionsWidget_message
77 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_timestamp 20
78 #define KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_timestamp "theme"
79 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_timestamp __tr2qs_no_lookup("time,timestamp")
80 
82 {
83  Q_OBJECT
84 public:
85  OptionsWidget_timestamp(QWidget * parent);
87 
88 public:
92 protected slots:
94 };
95 
96 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_messageColors KviIconManager::IconManager
97 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_messageColors __tr2qs_no_lookup("Message Decorations")
98 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_messageColors __tr2qs_no_lookup("theme,icons,colors,messages,output")
99 #define KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_messageColors "theme"
100 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_messageColors OptionsWidget_message
101 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_messageColors 30
102 
104 {
105  Q_OBJECT
106 public:
107  MessageListWidget(QWidget * par) : KviTalListWidget(par){};
109 };
110 
111 class MessageListWidgetItemDelegate : public QItemDelegate
112 {
113  Q_OBJECT
114 public:
115  MessageListWidgetItemDelegate(QAbstractItemView * pWidget = 0)
116  : QItemDelegate(pWidget){};
118  void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const;
119 };
120 
122 {
123 public:
126 
127 private:
128  int m_iOptId;
130 
131 public:
132  inline int optionId() { return m_iOptId; };
133  inline KviMessageTypeSettings * msgType() { return m_pMsgType; };
134 };
135 
137 {
138 public:
141 
142 public:
144 
145 public:
146  inline int clrIdx() { return m_iClrIdx; };
147 };
148 
149 class MessageColorListWidgetItemDelegate : public QItemDelegate
150 {
151  Q_OBJECT
152 public:
153  MessageColorListWidgetItemDelegate(QAbstractItemView * pWidget = 0)
154  : QItemDelegate(pWidget){};
156  void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const;
157 };
158 
160 {
161  Q_OBJECT
162  friend class KviTalListWidget;
163 
164 public:
165  OptionsWidget_messageColors(QWidget * parent);
167 
168 public:
179  QCheckBox * m_pEnableLogging;
180  QToolButton * m_pIconButton;
181  QMenu * m_pIconPopup;
182 
183 public:
184  void saveLastItem();
185 protected slots:
186  void itemChanged();
187  void colorChanged();
188  void iconButtonClicked();
190  virtual void commit();
191  virtual void save();
192  virtual void load();
193 };
194 
195 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_standardColors KviIconManager::Colors
196 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_standardColors __tr2qs_no_lookup("Color Set")
197 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_standardColors __tr2qs_no_lookup("theme,colors,messages,output")
198 #define KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_standardColors "theme"
199 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_standardColors 20
200 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_standardColors OptionsWidget_message
201 
203 {
204  Q_OBJECT
205 public:
206  OptionsWidget_standardColors(QWidget * par);
208 
209 private:
211 private slots:
212  void resetToDefaults();
213 };
214 
215 #endif
void enableDisableSmartColorSelector(bool)
Definition: OptionsWidget_message.cpp:117
OptionsWidget_message(QWidget *pParent)
Definition: OptionsWidget_message.cpp:52
KviBoolSelector * m_pUseTimestampSelector
Definition: OptionsWidget_message.h:89
Definition: OptionsWidget_message.h:121
Definition: KviTalListWidget.h:35
Definition: OptionsWidget_message.h:159
QCheckBox * m_pEnableLogging
Definition: OptionsWidget_message.h:179
Definition: OptionsWidget_message.h:111
MessageColorListWidgetItem(KviTalListWidget *b, int idx)
Definition: OptionsWidget_message.cpp:303
Definition: KviSelectors.h:59
~MessageColorListWidgetItemDelegate()
Definition: OptionsWidget_message.h:155
void iconButtonClicked()
Definition: OptionsWidget_message.cpp:558
MessageListWidgetItem * m_pLastItem
Definition: OptionsWidget_message.h:178
Definition: KviTalListWidget.h:64
MessageColorListWidgetItemDelegate * m_pBackListWidgetDelegate
Definition: OptionsWidget_message.h:174
KviTalListWidget * m_pBackListWidget
Definition: OptionsWidget_message.h:173
void newIconSelected(KviIconManager::SmallIcon eIcon)
Definition: OptionsWidget_message.cpp:471
#define l
Definition: detector.cpp:76
Definition: OptionsWidget_message.h:44
KviColorSelector * m_pColorSelector[16]
Definition: OptionsWidget_message.h:210
MessageColorListWidgetItem * m_pBackItems[17]
Definition: OptionsWidget_message.h:177
Definition: OptionsWidget_message.h:81
void resetToDefaults()
Definition: OptionsWidget_message.cpp:189
KviBoolSelector * m_pUseSmartColorSelector
Definition: OptionsWidget_message.h:67
KviTalListWidget * m_pLevelListWidget
Definition: OptionsWidget_message.h:175
void itemChanged()
Definition: OptionsWidget_message.cpp:512
int clrIdx()
Definition: OptionsWidget_message.h:146
KviBoolSelector * m_pSpecialTimestampColorSelector
Definition: OptionsWidget_message.h:90
OptionsWidget_timestamp(QWidget *parent)
Definition: OptionsWidget_message.cpp:125
KviMircTextColorSelector * m_pTimestampColorSelector
Definition: OptionsWidget_message.h:91
KviTalListWidget * m_pForeListWidget
Definition: OptionsWidget_message.h:171
QToolButton * m_pIconButton
Definition: OptionsWidget_message.h:180
Definition: KviSelectors.h:349
void enableDisableTimestampSelector(bool)
Definition: OptionsWidget_message.cpp:155
KviMircTextColorSelector * m_pSmartColorSelector
Definition: OptionsWidget_message.h:69
MessageListWidgetItemDelegate * m_pListViewItemDelegate
Definition: OptionsWidget_message.h:170
Definition: KviOptionsWidget.h:40
Icon manager.
SmallIcon
Contains all KVIrc's small icons.
Definition: KviIconManager.h:168
Definition: OptionsWidget_message.h:103
~MessageListWidget()
Definition: OptionsWidget_message.h:108
KviMessageTypeSettings * m_pMsgType
Definition: OptionsWidget_message.h:129
int m_iOptId
Definition: OptionsWidget_message.h:128
Definition: KviMessageTypeSettings.h:47
MessageListWidgetItemDelegate(QAbstractItemView *pWidget=0)
Definition: OptionsWidget_message.h:115
void paint(QPainter *p, const QStyleOptionViewItem &opt, const QModelIndex &index) const
Definition: OptionsWidget_message.cpp:231
OptionsWidget_messageColors(QWidget *parent)
Definition: OptionsWidget_message.cpp:358
Definition: OptionsWidget_message.h:149
int m_iClrIdx
Definition: OptionsWidget_message.h:143
KviMessageTypeSettings * msgType()
Definition: OptionsWidget_message.h:133
OptionsWidget_standardColors(QWidget *par)
Definition: OptionsWidget_message.cpp:160
MessageColorListWidgetItemDelegate * m_pForeListWidgetDelegate
Definition: OptionsWidget_message.h:172
KviBoolSelector * m_pSpecialSmartColorSelector
Definition: OptionsWidget_message.h:68
MessageColorListWidgetItem * m_pForeItems[16]
Definition: OptionsWidget_message.h:176
MessageListWidget * m_pListView
Definition: OptionsWidget_message.h:169
MessageListWidgetItem(MessageListWidget *l, int optId)
Definition: OptionsWidget_message.cpp:209
Definition: KviTalListWidget.h:51
~OptionsWidget_messageColors()
Definition: OptionsWidget_message.cpp:450
~MessageListWidgetItemDelegate()
Definition: OptionsWidget_message.h:117
void paint(QPainter *p, const QStyleOptionViewItem &opt, const QModelIndex &index) const
Definition: OptionsWidget_message.cpp:323
Definition: OptionsWidget_message.h:202
Definition: OptionsWidget_message.h:136
QMenu * m_pIconPopup
Definition: OptionsWidget_message.h:181
Definition: KviSelectors.h:267
MessageColorListWidgetItemDelegate(QAbstractItemView *pWidget=0)
Definition: OptionsWidget_message.h:153
virtual void save()
Definition: OptionsWidget_message.cpp:579
#define p
Definition: detector.cpp:80
void saveLastItem()
Definition: OptionsWidget_message.cpp:482
virtual void load()
Definition: OptionsWidget_message.cpp:617
void colorChanged()
Definition: OptionsWidget_message.cpp:552
~MessageListWidgetItem()
Definition: OptionsWidget_message.cpp:226
OptionsWidget_privmsg(QWidget *parent)
Definition: OptionsWidget_message.cpp:60
Definition: OptionsWidget_message.h:59
MessageListWidget(QWidget *par)
Definition: OptionsWidget_message.h:107
virtual void commit()
Definition: OptionsWidget_message.cpp:563
int optionId()
Definition: OptionsWidget_message.h:132