KVIrc  4.9.2
DeveloperAPIs
KviKvsTreeNodeSpecialCommandDefpopup.h
Go to the documentation of this file.
1 #ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_
2 #define _KVI_KVS_TREENODE_SPECIALCOMMANDDEFPOPUP_H_
3 //=============================================================================
4 //
5 // File : KviKvsTreeNodeSpecialCommandDefpopup.h
6 // Creation date : Fri 02 Jan 2004 13:54:00 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2004-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 "kvi_settings.h"
28 #include "KviQString.h"
29 #include "KviKvsTreeNode.h"
31 
35 class KviKvsVariant;
36 class KviKvsPopupMenu;
37 
39 {
40 public:
41  QString m_szItemName;
42 
43 public:
44  KviKvsTreeNodeSpecialCommandDefpopupLabel(const QChar * pLocation, const QString & szItemName)
45  : KviKvsTreeNode(pLocation), m_szItemName(szItemName){};
47 
48 public:
49  void setItemName(const QString & szItemName) { m_szItemName = szItemName; };
50  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p) = 0;
51 };
52 
54 {
55 protected:
56  QString m_szCondition; // may be null!
57 public:
58  KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(const QChar * pLocation, const QString & szCondition, const QString & szItemName)
59  : KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation, szItemName), m_szCondition(szCondition){};
61 
62 public:
63  void setCondition(const QString & szCondition) { m_szCondition = szCondition; };
64 };
65 
67 {
68 public:
69  KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator(const QChar * pLocation, const QString & szCondition, const QString & szItemName)
70  : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(pLocation, szCondition, szItemName){};
72 
73 public:
74  virtual void contextDescription(QString & szBuffer);
75  virtual void dump(const char * prefix);
76  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
77 };
78 
80 {
81 protected:
82  QString m_szText;
83  QString m_szIcon;
84 
85 public:
86  KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(const QChar * pLocation, const QString & szCondition, const QString & szText, const QString & szIcon, const QString & szItemName)
87  : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(pLocation, szCondition, szItemName), m_szText(szText), m_szIcon(szIcon){};
89 
90 public:
91  void setText(const QString & szText) { m_szText = szText; };
92  void setIcon(const QString & szIcon) { m_szIcon = szIcon; };
93 };
94 
96 {
97 protected:
98  QString m_szName;
99 
100 public:
101  KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup(const QChar * pLocation, const QString & szCondition, const QString & szText, const QString & szIcon, const QString & szName, const QString & szItemName)
102  : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation, szCondition, szText, szIcon, szItemName), m_szName(szName){};
104 
105 public:
106  virtual void contextDescription(QString & szBuffer);
107  virtual void dump(const char * prefix);
108  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
109 };
110 
112 {
113 protected:
115 
116 public:
117  KviKvsTreeNodeSpecialCommandDefpopupLabelItem(const QChar * pLocation, const QString & szCondition, const QString & szText, const QString & szIcon, const QString & szInstruction, const QString & szItemName)
118  : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation, szCondition, szText, szIcon, szItemName), m_szInstruction(szInstruction){};
120 
121 public:
122  virtual void contextDescription(QString & szBuffer);
123  virtual void dump(const char * prefix);
124  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
125 };
126 
128 {
129 public:
130  KviKvsTreeNodeSpecialCommandDefpopupLabelLabel(const QChar * pLocation, const QString & szCondition, const QString & szText, const QString & szIcon, const QString & szItemName)
131  : KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(pLocation, szCondition, szText, szIcon, szItemName){};
133 
134 public:
135  virtual void contextDescription(QString & szBuffer);
136  virtual void dump(const char * prefix);
137  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
138 };
139 
141 {
142 protected:
144 
145 public:
146  KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue(const QChar * pLocation, const QString & szInstruction, const QString & szItemName)
147  : KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation, szItemName), m_szInstruction(szInstruction){};
149 
150 public:
151  virtual void contextDescription(QString & szBuffer);
152  virtual void dump(const char * prefix);
153  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
154 };
155 
157 {
158 protected:
160 
161 public:
162  KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue(const QChar * pLocation, const QString & szInstruction, const QString & szItemName)
163  : KviKvsTreeNodeSpecialCommandDefpopupLabel(pLocation, szItemName), m_szInstruction(szInstruction){};
165 
166 public:
167  virtual void contextDescription(QString & szBuffer);
168  virtual void dump(const char * prefix);
169  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
170 };
171 
173 {
174 public:
175  KviKvsTreeNodeSpecialCommandDefpopupLabelPopup(const QChar * pLocation);
177 
178 protected:
180 
181 public:
182  bool isEmpty() { return m_pLabels->isEmpty(); };
183  void addLabel(KviKvsTreeNodeSpecialCommandDefpopupLabel * pLabel);
184  virtual void contextDescription(QString & szBuffer);
185  virtual void dump(const char * prefix);
186  virtual bool execute(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
187  bool fill(KviKvsRunTimeContext * c, KviKvsPopupMenu * p);
188 };
189 
191 {
192 public:
195 
196 private:
197  KviKvsTreeNodeData * m_pPopupName; // can't be zero
199 
200 public:
201  virtual void contextDescription(QString & szBuffer);
202  virtual void dump(const char * prefix);
203  virtual bool execute(KviKvsRunTimeContext * c);
204 };
205 
206 #endif
QString m_szInstruction
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:159
Treenode class.
Definition: KviKvsTreeNodeBase.h:40
~KviKvsTreeNodeSpecialCommandDefpopupLabelItem()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:119
~KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:103
~KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:71
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:79
This class defines a new data type which contains variant data.
Definition: KviKvsVariant.h:351
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:156
KviKvsTreeNodeSpecialCommandDefpopupLabelLabel(const QChar *pLocation, const QString &szCondition, const QString &szText, const QString &szIcon, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:130
#define KVIRC_API
Definition: kvi_settings.h:128
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
KviKvsTreeNodeSpecialCommandDefpopupLabelPopup * m_pMainPopup
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:198
KviPointerList< KviKvsTreeNodeSpecialCommandDefpopupLabel > * m_pLabels
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:179
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:127
~KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:148
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:66
KviKvsTreeNodeSpecialCommandDefpopupLabelExtpopup(const QChar *pLocation, const QString &szCondition, const QString &szText, const QString &szIcon, const QString &szName, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:101
QString m_szIcon
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:83
KviKvsTreeNodeSpecialCommandDefpopupLabelItem(const QChar *pLocation, const QString &szCondition, const QString &szText, const QString &szIcon, const QString &szInstruction, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:117
virtual void dump(const char *prefix)=0
Dumps the tree.
KviKvsTreeNodeSpecialCommandDefpopupLabelSeparator(const QChar *pLocation, const QString &szCondition, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:69
QString m_szCondition
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:56
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:38
QString m_szText
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:82
QString m_szInstruction
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:143
virtual bool execute(KviKvsRunTimeContext *c, KviKvsPopupMenu *p)=0
KviKvsTreeNodeData * m_pPopupName
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:197
KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel(const QChar *pLocation, const QString &szCondition, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:58
~KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:164
~KviKvsTreeNodeSpecialCommandDefpopupConditionalLabel()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:60
void setIcon(const QString &szIcon)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:92
void setItemName(const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:49
QString m_szItemName
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:41
KviKvsTreeNodeSpecialCommandDefpopupLabel(const QChar *pLocation, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:44
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:190
Definition: KviKvsTreeNodeExpression.h:67
Treenode class to handle instructions.
Definition: KviKvsTreeNodeInstruction.h:42
Treenode instruction handling.
Definition: KviKvsPopupMenu.h:270
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:140
Definition: KviKvsTreeNodeSpecialCommand.h:31
virtual void contextDescription(QString &szBuffer)=0
Sets the buffer.
void setCondition(const QString &szCondition)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:63
Definition: KviKvsRunTimeContext.h:103
QString m_szName
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:98
~KviKvsTreeNodeSpecialCommandDefpopupLabel()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:46
virtual bool execute(KviKvsRunTimeContext *c)=0
This is the main entry point to the tree visit.
QString m_szInstruction
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:114
KviKvsTreeNodeSpecialCommandDefpopupLabelEpilogue(const QChar *pLocation, const QString &szInstruction, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:162
Definition: KviKvsTreeNodeData.h:34
char szBuffer[4096]
Definition: winamp.cpp:77
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:172
bool isEmpty()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:182
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:53
KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon(const QChar *pLocation, const QString &szCondition, const QString &szText, const QString &szIcon, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:86
This file contains compile time settings.
virtual void contextDescription(QString &szBuffer)
Sets the buffer as Instruction.
Definition: KviKvsTreeNodeSpecialCommand.cpp:35
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:111
#define p
Definition: detector.cpp:80
void setText(const QString &szText)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:91
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:95
Helper functions for the QString class.
virtual void dump(const char *prefix)
Dumps the instructions tree.
Definition: KviKvsTreeNodeSpecialCommand.cpp:42
KviKvsTreeNodeSpecialCommandDefpopupLabelPrologue(const QChar *pLocation, const QString &szInstruction, const QString &szItemName)
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:146
~KviKvsTreeNodeSpecialCommandDefpopupConditionalLabelWithTextAndIcon()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:88
~KviKvsTreeNodeSpecialCommandDefpopupLabelLabel()
Definition: KviKvsTreeNodeSpecialCommandDefpopup.h:132