1
#ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_
2
#define _KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_
3
//=============================================================================
5
// File : kvi_kvs_treenode_specialcommanddefpopup.h
6
// Creation date : Fri 02 Jan 2004 13:54:00 by Szymon Stefanek
8
// This file is part of the KVIrc IRC client distribution
9
// Copyright (C) 2004-2008 Szymon Stefanek <pragma at kvirc dot net>
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 opinion) any later version.
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.
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.
25
//=============================================================================
27
#include "kvi_settings.h"
28
#include "kvi_qstring.h"
29
#include "kvi_kvs_treenode.h"
30
#include "kvi_kvs_treenode_specialcommand.h"
32
class KviKvsTreeNodeExpression;
33
class KviKvsTreeNodeInstruction;
34
class KviKvsRunTimeContext;
36
class KviKvsPopupMenu;
39
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabel : public KviKvsTreeNode
44
KviKvsTreeNodeSpecialCommandDefpopupLabel(const QChar * pLocation,const QString &szItemName)
45
: KviKvsTreeNode(pLocation), m_szItemName(szItemName) {};
46
~KviKvsTreeNodeSpecialCommandDefpopupLabel(){};
48
void setItemName(const QString &szItemName){ m_szItemName = szItemName; };
49
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p) = 0;
52
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel : public KviKvsTreeNodeSpecialCommandDefpopupLabel
55
QString m_szCondition; // may be null!
57
KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(const QChar * pLocation,const QString &szCondition,const QString &szItemName)
58
: KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation,szItemName), m_szCondition(szCondition) {};
59
~KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(){};
61
void setCondition(const QString &szCondition){ m_szCondition = szCondition; };
64
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel
67
KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator(const QChar * pLocation,const QString &szCondition,const QString &szItemName)
68
: KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(pLocation,szCondition,szItemName){};
69
~KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator(){};
71
virtual void contextDescription(QString &szBuffer);
72
virtual void dump(const char * prefix);
73
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
76
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel
82
KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szItemName)
83
: KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(pLocation,szCondition,szItemName), m_szText(szText), m_szIcon(szIcon){};
84
~KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(){};
86
void setText(const QString &szText){ m_szText = szText; };
87
void setIcon(const QString &szIcon){ m_szIcon = szIcon; };
90
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon
95
KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szName,const QString &szItemName)
96
: KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation,szCondition,szText,szIcon,szItemName), m_szName(szName){};
97
~KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup(){};
99
virtual void contextDescription(QString &szBuffer);
100
virtual void dump(const char * prefix);
101
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
104
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelItem : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon
107
QString m_szInstruction;
109
KviKvsTreeNodeSpecialCommandDefpopupLabelItem(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szInstruction,const QString &szItemName)
110
: KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation,szCondition,szText,szIcon,szItemName), m_szInstruction(szInstruction) {};
111
~KviKvsTreeNodeSpecialCommandDefpopupLabelItem(){};
113
virtual void contextDescription(QString &szBuffer);
114
virtual void dump(const char * prefix);
115
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
119
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelLabel : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon
122
KviKvsTreeNodeSpecialCommandDefpopupLabelLabel(const QChar * pLocation,const QString &szCondition,const QString &szText,const QString &szIcon,const QString &szItemName)
123
: KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation,szCondition,szText,szIcon,szItemName){};
124
~KviKvsTreeNodeSpecialCommandDefpopupLabelLabel(){};
126
virtual void contextDescription(QString &szBuffer);
127
virtual void dump(const char * prefix);
128
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
133
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue : public KviKvsTreeNodeSpecialCommandDefpopupLabel
136
QString m_szInstruction;
138
KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue(const QChar * pLocation,const QString &szInstruction,const QString &szItemName)
139
: KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation,szItemName), m_szInstruction(szInstruction){};
140
~KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue(){};
142
virtual void contextDescription(QString &szBuffer);
143
virtual void dump(const char * prefix);
144
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
147
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue : public KviKvsTreeNodeSpecialCommandDefpopupLabel
150
QString m_szInstruction;
152
KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue(const QChar * pLocation,const QString &szInstruction,const QString &szItemName)
153
: KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation,szItemName), m_szInstruction(szInstruction){};
154
~KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue(){};
156
virtual void contextDescription(QString &szBuffer);
157
virtual void dump(const char * prefix);
158
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
162
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopupLabelPopup : public KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon
165
KviKvsTreeNodeSpecialCommandDefpopupLabelPopup(const QChar * pLocation);
166
~KviKvsTreeNodeSpecialCommandDefpopupLabelPopup();
168
KviPointerList<KviKvsTreeNodeSpecialCommandDefpopupLabel> * m_pLabels;
170
bool isEmpty(){ return m_pLabels->isEmpty(); };
171
void addLabel(KviKvsTreeNodeSpecialCommandDefpopupLabel * pLabel);
172
virtual void contextDescription(QString &szBuffer);
173
virtual void dump(const char * prefix);
174
virtual bool execute(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
175
bool fill(KviKvsRunTimeContext * c,KviKvsPopupMenu * p);
179
class KVIRC_API KviKvsTreeNodeSpecialCommandDefpopup : public KviKvsTreeNodeSpecialCommand
182
KviKvsTreeNodeSpecialCommandDefpopup(const QChar * pLocation,KviKvsTreeNodeData * pPopupName,KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * pMainPopup);
183
~KviKvsTreeNodeSpecialCommandDefpopup();
185
KviKvsTreeNodeData * m_pPopupName; // can't be zero
186
KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * m_pMainPopup;
188
virtual void contextDescription(QString &szBuffer);
189
virtual void dump(const char * prefix);
190
virtual bool execute(KviKvsRunTimeContext * c);
193
#endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_