summaryrefslogtreecommitdiffstats
path: root/src/modules/options/optw_messages.h
blob: b82a541d7e764516007ca50f7c02db66077f3373 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#ifndef _OPTW_MESSAGES_H_
#define _OPTW_MESSAGES_H_

//
//   File : optw_messages.h
//   Creation date : Sat Aug 11 2001 18:11:21 CEST by Szymon Stefanek
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot 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 opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//

#include "kvi_optionswidget.h"

#include "kvi_msgtype.h"

#include "kvi_tal_listview.h"
#include "kvi_tal_listbox.h"
#include <tqcheckbox.h>
#include <tqtoolbutton.h>
#include "kvi_tal_popupmenu.h"

#define KVI_OPTIONS_WIDGET_ICON_KviMessageOptionsWidget KVI_SMALLICON_MESSAGES
#define KVI_OPTIONS_WIDGET_NAME_KviMessageOptionsWidget __tr2qs_no_lookup("Text")
#define KVI_OPTIONS_WIDGET_KEYWORDS_KviMessageOptionsWidget __tr2qs_no_lookup("theme,colors,output")
#define KVI_OPTIONS_WIDGET_GROUP_KviMessageOptionsWidget "theme"
#define KVI_OPTIONS_WIDGET_CONTAINER_KviMessageOptionsWidget true

class KviMessageOptionsWidget : public KviOptionsWidget
{
	TQ_OBJECT
  
public:
	KviMessageOptionsWidget(TQWidget * pParent);
	~KviMessageOptionsWidget();
};


#define KVI_OPTIONS_WIDGET_ICON_KviPrivmsgOptionsWidget KVI_SMALLICON_RAW
#define KVI_OPTIONS_WIDGET_NAME_KviPrivmsgOptionsWidget __tr2qs_no_lookup("Message Style")
#define KVI_OPTIONS_WIDGET_PARENT_KviPrivmsgOptionsWidget KviMessageOptionsWidget
#define KVI_OPTIONS_WIDGET_PRIORITY_KviPrivmsgOptionsWidget 40
#define KVI_OPTIONS_WIDGET_GROUP_KviPrivmsgOptionsWidget "theme"
#define KVI_OPTIONS_WIDGET_KEYWORDS_KviPrivmsgOptionsWidget __tr2qs_no_lookup("theme,privmsg,output,format")

class KviPrivmsgOptionsWidget : public KviOptionsWidget
{
	TQ_OBJECT
  
public:
	KviPrivmsgOptionsWidget(TQWidget * parent);
	~KviPrivmsgOptionsWidget();
};

#define KVI_OPTIONS_WIDGET_ICON_KviTimestampOptionsWidget KVI_SMALLICON_TIME
#define KVI_OPTIONS_WIDGET_NAME_KviTimestampOptionsWidget __tr2qs_no_lookup("Timestamp")
#define KVI_OPTIONS_WIDGET_PARENT_KviTimestampOptionsWidget KviMessageOptionsWidget
#define KVI_OPTIONS_WIDGET_PRIORITY_KviTimestampOptionsWidget 20
#define KVI_OPTIONS_WIDGET_GROUP_KviTimestampOptionsWidget "theme"
#define KVI_OPTIONS_WIDGET_KEYWORDS_KviTimestampOptionsWidget __tr2qs_no_lookup("time,timestamp")

class KviTimestampOptionsWidget : public KviOptionsWidget
{
	TQ_OBJECT
  
public:
	KviTimestampOptionsWidget(TQWidget * parent);
	~KviTimestampOptionsWidget();
public:
	KviBoolSelector * m_pUseTimestampSelector;
	KviBoolSelector * m_pSpecialTimestampColorSelector;
	KviMircTextColorSelector * m_pTimestampColorSelector;
protected slots:
	void enableDisableTimestampSelector(bool);
};

#define KVI_OPTIONS_WIDGET_ICON_KviMessageColorsOptionsWidget KVI_SMALLICON_MESSAGES
#define KVI_OPTIONS_WIDGET_NAME_KviMessageColorsOptionsWidget __tr2qs_no_lookup("Message Colors")
#define KVI_OPTIONS_WIDGET_KEYWORDS_KviMessageColorsOptionsWidget __tr2qs_no_lookup("theme,colors,messages,output")
#define KVI_OPTIONS_WIDGET_GROUP_KviMessageColorsOptionsWidget "theme"
#define KVI_OPTIONS_WIDGET_PARENT_KviMessageColorsOptionsWidget KviMessageOptionsWidget
#define KVI_OPTIONS_WIDGET_PRIORITY_KviMessageColorsOptionsWidget 30

class KviMessageListView : public KviTalListView
{
	TQ_OBJECT
  
public:
	KviMessageListView(TQWidget * par);
	~KviMessageListView();
protected:
	void paintEmptyAreaInternal(TQPainter * p,const TQRect &viewportRect,const TQRect &painterRect);
public:
	void paintEmptyArea(TQPainter * p,const TQRect &rct);
};


class KviMessageListViewItem : public KviTalListViewItem
{
public:
	KviMessageListViewItem(KviTalListView * l,int optId);
	~KviMessageListViewItem();
private:
	int          m_iOptId;
	KviMsgType * m_pMsgType;
public:
	int optionId(){ return m_iOptId; };
	KviMsgType * msgType(){ return m_pMsgType; };
	virtual void paintCell(TQPainter * p,const TQColorGroup &,int,int,int);
};


class KviMessageColorListBoxItem : public KviTalListBoxText
{
public:
	KviMessageColorListBoxItem(KviTalListBox * b,const TQColor & clr,int idx);
	~KviMessageColorListBoxItem();
public:
	int m_iClrIdx;
	TQColor m_clr;
public:
	virtual void paint(TQPainter * p);
	virtual int width(const KviTalListBox * lv) const { return 120; };
};




class KviMessageColorsOptionsWidget : public KviOptionsWidget
{
	TQ_OBJECT
  
public:
	KviMessageColorsOptionsWidget(TQWidget * parent);
	~KviMessageColorsOptionsWidget();
public:
	KviMessageListView         * m_pListView;
	KviTalListBox                   * m_pForeListBox;
	KviTalListBox                   * m_pBackListBox;
	KviTalListBox                   * m_pLevelListBox;
	KviMessageColorListBoxItem * m_pForeItems[16];
	KviMessageColorListBoxItem * m_pBackItems[17];
	KviMessageListViewItem     * m_pLastItem;
	TQCheckBox                  * m_pEnableLogging;
	TQToolButton                * m_pIconButton;
	KviTalPopupMenu                 * m_pIconPopup;
public:
	void saveLastItem();
protected slots:
	void itemChanged(KviTalListViewItem * it);
	void colorChanged(KviTalListBoxItem *);
	void iconButtonClicked();
	void newIconSelected(int iconId);
	virtual void commit();
	virtual void save();
	virtual void load();
};

#define KVI_OPTIONS_WIDGET_ICON_KviStandardColorsOptionsWidget KVI_SMALLICON_COLORS
#define KVI_OPTIONS_WIDGET_NAME_KviStandardColorsOptionsWidget __tr2qs_no_lookup("Color Set")
#define KVI_OPTIONS_WIDGET_KEYWORDS_KviStandardColorsOptionsWidget __tr2qs_no_lookup("theme,colors,messages,output")
#define KVI_OPTIONS_WIDGET_GROUP_KviStandardColorsOptionsWidget "theme"
#define KVI_OPTIONS_WIDGET_PRIORITY_KviStandardColorsOptionsWidget 20
#define KVI_OPTIONS_WIDGET_PARENT_KviStandardColorsOptionsWidget KviMessageOptionsWidget

class KviStandardColorsOptionsWidget : public KviOptionsWidget
{
	TQ_OBJECT
  
public:
	KviStandardColorsOptionsWidget(TQWidget * par);
	~KviStandardColorsOptionsWidget();
	
};




#endif //!_OPTW_MESSAGES_H_