KVIrc 5.2.4
Developer APIs
RawEditorWindow.h
Go to the documentation of this file.
1#ifndef _RAWEDITOR_H_
2#define _RAWEDITOR_H_
3//=============================================================================
4//
5// File : RawEditorWindow.h
6// Creation date : Mon Dec 23 2002 20:24:55 CEST by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2002-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 "KviWindow.h"
28#include "KviQString.h"
29#include <QTreeWidget>
30#include "KviIconManager.h"
31
32#include <QWidget>
33#include <QLineEdit>
34
35class KviScriptEditor;
36class QMenu;
37
38class RawTreeWidget : public QTreeWidget
39{
40public:
41 RawTreeWidget(QWidget * par)
42 : QTreeWidget(par){};
43 void updateItem(QTreeWidgetItem * item)
44 {
45 update(indexFromItem(item, 0));
46 };
48};
49
50class RawTreeWidgetItem : public QTreeWidgetItem
51{
52public:
53 int m_iIdx;
54
55public:
56 RawTreeWidgetItem(QTreeWidget * par, int idx, bool bEnabled);
58
59public:
60 void setEnabled(bool bEnabled)
61 {
62 if(bEnabled)
64 else
66 ((RawTreeWidget *)treeWidget())->updateItem(this);
67 };
68};
69
70class RawHandlerTreeWidgetItem : public QTreeWidgetItem
71{
72public:
73 RawHandlerTreeWidgetItem(QTreeWidgetItem * par, const QString & name, const QString & buffer, bool bEnabled)
74 : QTreeWidgetItem(par), m_szBuffer(buffer), m_bEnabled(bEnabled)
75 {
76 setText(0, name);
77 setEnabled(bEnabled);
78 };
80
81public:
82 void setEnabled(bool bEnabled)
83 {
84 if(bEnabled)
86 else
88 ((RawTreeWidget *)treeWidget())->updateItem(this);
89 };
90 QString m_szBuffer;
92 void setName(const QString & szName);
93};
94
95class RawEditorWidget : public QWidget
96{
97 Q_OBJECT
98public:
99 RawEditorWidget(QWidget * par);
101
102public:
105 QLineEdit * m_pNameEditor;
109
110public:
111 void commit();
112 void saveLastEditedItem();
113 void getUniqueHandlerName(RawTreeWidgetItem * it, QString & buffer);
115protected slots:
116 void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *);
117 void customContextMenuRequested(const QPoint & pnt);
121 void addRaw();
122 void exportAllEvents();
124
125protected:
126 void showEvent(QShowEvent * e) override;
127
128private:
129 void oneTimeSetup();
130};
131
133{
134 Q_OBJECT
135public:
138
139protected:
141
142protected:
143 QPixmap * myIconPtr() override;
144 void fillCaptionBuffers() override;
145 void getConfigGroupName(QString & szName) override;
146 void saveProperties(KviConfigurationFile *) override;
147 void loadProperties(KviConfigurationFile *) override;
148protected slots:
149 void cancelClicked();
150 void okClicked();
151 void applyClicked();
152};
153
154#endif //_RAWEDITOR_H_
KviIconManager * g_pIconManager
Definition KviIconManager.cpp:81
Icon manager.
Helper functions for the QString class.
Contains the KviWindow class.
Definition KviConfigurationFile.h:50
@ Handler
Definition KviIconManager.h:256
@ RawEvent
Definition KviIconManager.h:357
@ HandlerDisabled
Definition KviIconManager.h:257
@ RawEventNoHandlers
Definition KviIconManager.h:358
QPixmap * getSmallIcon(SmallIcon eIcon)
Returns the small icon.
Definition KviIconManager.h:599
Definition KviScriptEditor.h:45
Base class for all windows in KVIrc.
Definition KviWindow.h:75
Definition RawEditorWindow.h:96
RawTreeWidget * m_pTreeWidget
Definition RawEditorWindow.h:104
QLineEdit * m_pNameEditor
Definition RawEditorWindow.h:105
bool m_bOneTimeSetupDone
Definition RawEditorWindow.h:108
void getExportEventBuffer(QString &szBuffer, RawHandlerTreeWidgetItem *it)
Definition RawEditorWindow.cpp:372
void exportAllEvents()
Definition RawEditorWindow.cpp:430
void showEvent(QShowEvent *e) override
Definition RawEditorWindow.cpp:366
~RawEditorWidget()
Definition RawEditorWindow.cpp:107
void currentItemChanged(QTreeWidgetItem *it, QTreeWidgetItem *)
Definition RawEditorWindow.cpp:343
void commit()
Definition RawEditorWindow.cpp:286
void oneTimeSetup()
Definition RawEditorWindow.cpp:112
void exportCurrentHandler()
Definition RawEditorWindow.cpp:399
void customContextMenuRequested(const QPoint &pnt)
Definition RawEditorWindow.cpp:139
void addHandlerForCurrentRaw()
Definition RawEditorWindow.cpp:238
void toggleCurrentHandlerEnabled()
Definition RawEditorWindow.cpp:275
void saveLastEditedItem()
Definition RawEditorWindow.cpp:322
void addRaw()
Definition RawEditorWindow.cpp:207
QMenu * m_pContextPopup
Definition RawEditorWindow.h:106
void removeCurrentHandler()
Definition RawEditorWindow.cpp:259
void getUniqueHandlerName(RawTreeWidgetItem *it, QString &buffer)
Definition RawEditorWindow.cpp:176
RawHandlerTreeWidgetItem * m_pLastEditedItem
Definition RawEditorWindow.h:107
KviScriptEditor * m_pEditor
Definition RawEditorWindow.h:103
Definition RawEditorWindow.h:133
void okClicked()
Definition RawEditorWindow.cpp:502
void cancelClicked()
Definition RawEditorWindow.cpp:513
RawEditorWidget * m_pEditor
Definition RawEditorWindow.h:140
void saveProperties(KviConfigurationFile *) override
Definition RawEditorWindow.cpp:533
QPixmap * myIconPtr() override
Definition RawEditorWindow.cpp:518
~RawEditorWindow()
Definition RawEditorWindow.cpp:497
void getConfigGroupName(QString &szName) override
Definition RawEditorWindow.cpp:528
void loadProperties(KviConfigurationFile *) override
Definition RawEditorWindow.cpp:537
void fillCaptionBuffers() override
Definition RawEditorWindow.cpp:523
RawEditorWindow()
Definition RawEditorWindow.cpp:467
void applyClicked()
Definition RawEditorWindow.cpp:508
Definition RawEditorWindow.h:71
void setEnabled(bool bEnabled)
Definition RawEditorWindow.h:82
RawHandlerTreeWidgetItem(QTreeWidgetItem *par, const QString &name, const QString &buffer, bool bEnabled)
Definition RawEditorWindow.h:73
void setName(const QString &szName)
Definition RawEditorWindow.cpp:62
~RawHandlerTreeWidgetItem()
Definition RawEditorWindow.h:79
QString m_szBuffer
Definition RawEditorWindow.h:90
bool m_bEnabled
Definition RawEditorWindow.h:91
Definition RawEditorWindow.h:51
~RawTreeWidgetItem()
Definition RawEditorWindow.h:57
int m_iIdx
Definition RawEditorWindow.h:53
void setEnabled(bool bEnabled)
Definition RawEditorWindow.h:60
Definition RawEditorWindow.h:39
void updateItem(QTreeWidgetItem *item)
Definition RawEditorWindow.h:43
RawTreeWidget(QWidget *par)
Definition RawEditorWindow.h:41
~RawTreeWidget()
Definition RawEditorWindow.h:47
#define e
Definition detector.cpp:70
char szBuffer[4096]
Definition winamp.cpp:77