1 #ifndef _KVI_KVS_TREENODE_SPECIALCOMMANDSWITCH_H_ 2 #define _KVI_KVS_TREENODE_SPECIALCOMMANDSWITCH_H_ 3 //============================================================================= 4 // 5 // File : KviKvsTreeNodeSpecialCommandSwitch.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" 30 #include "KviKvsTreeNodeSpecialCommand.h" 31 32 class KviKvsTreeNodeExpression; 33 class KviKvsTreeNodeInstruction; 34 class KviKvsRunTimeContext; 35 class KviKvsVariant; 36 37 class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabel : public KviKvsTreeNode 38 { 39 public: 40 KviKvsTreeNodeSpecialCommandSwitchLabel(const QChar * pLocation); 41 ~KviKvsTreeNodeSpecialCommandSwitchLabel(); 42 43 protected: 44 KviKvsTreeNodeData * m_pParameter; 45 KviKvsTreeNodeInstruction * m_pInstruction; 46 bool m_bHasTerminatingBreak; 47 48 public: 49 void setParameter(KviKvsTreeNodeData * pParameter); 50 void setInstruction(KviKvsTreeNodeInstruction * pInstruction); setTerminatingBreak(bool b)51 void setTerminatingBreak(bool b) { m_bHasTerminatingBreak = b; }; 52 virtual bool execute(KviKvsRunTimeContext * c, KviKvsVariant * pRealParameter, bool * bPassThrough) = 0; 53 }; 54 55 class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelCase : public KviKvsTreeNodeSpecialCommandSwitchLabel 56 { 57 public: 58 KviKvsTreeNodeSpecialCommandSwitchLabelCase(const QChar * pLocation); 59 ~KviKvsTreeNodeSpecialCommandSwitchLabelCase(); 60 61 public: 62 virtual void contextDescription(QString & szBuffer); 63 virtual void dump(const char * prefix); 64 virtual bool execute(KviKvsRunTimeContext * c, KviKvsVariant * pRealParameter, bool * bPassThrough); 65 }; 66 67 class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelMatch : public KviKvsTreeNodeSpecialCommandSwitchLabel 68 { 69 public: 70 KviKvsTreeNodeSpecialCommandSwitchLabelMatch(const QChar * pLocation); 71 ~KviKvsTreeNodeSpecialCommandSwitchLabelMatch(); 72 73 public: 74 virtual void contextDescription(QString & szBuffer); 75 virtual void dump(const char * prefix); 76 virtual bool execute(KviKvsRunTimeContext * c, KviKvsVariant * pRealParameter, bool * bPassThrough); 77 }; 78 79 class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelRegexp : public KviKvsTreeNodeSpecialCommandSwitchLabel 80 { 81 public: 82 KviKvsTreeNodeSpecialCommandSwitchLabelRegexp(const QChar * pLocation); 83 ~KviKvsTreeNodeSpecialCommandSwitchLabelRegexp(); 84 85 public: 86 virtual void contextDescription(QString & szBuffer); 87 virtual void dump(const char * prefix); 88 virtual bool execute(KviKvsRunTimeContext * c, KviKvsVariant * pRealParameter, bool * bPassThrough); 89 }; 90 91 class KVIRC_API KviKvsTreeNodeSpecialCommandSwitchLabelDefault : public KviKvsTreeNodeSpecialCommandSwitchLabel 92 { 93 public: 94 KviKvsTreeNodeSpecialCommandSwitchLabelDefault(const QChar * pLocation); 95 ~KviKvsTreeNodeSpecialCommandSwitchLabelDefault(); 96 97 public: 98 virtual void dump(const char * prefix); 99 virtual void contextDescription(QString & szBuffer); 100 virtual bool execute(KviKvsRunTimeContext * c, KviKvsVariant * pRealParameter, bool * bPassThrough); 101 }; 102 103 class KVIRC_API KviKvsTreeNodeSpecialCommandSwitch : public KviKvsTreeNodeSpecialCommand 104 { 105 public: 106 KviKvsTreeNodeSpecialCommandSwitch(const QChar * pLocation, KviKvsTreeNodeExpression * e); 107 ~KviKvsTreeNodeSpecialCommandSwitch(); 108 109 private: 110 KviKvsTreeNodeExpression * m_pExpression; // can't be 0 111 KviPointerList<KviKvsTreeNodeSpecialCommandSwitchLabel> * m_pLabels; //can't be 0 112 public: 113 void addLabel(KviKvsTreeNodeSpecialCommandSwitchLabel * l); isEmpty()114 bool isEmpty() { return m_pLabels->isEmpty(); }; 115 virtual void contextDescription(QString & szBuffer); 116 virtual void dump(const char * prefix); 117 virtual bool execute(KviKvsRunTimeContext * c); 118 }; 119 120 #endif //!_KVI_KVS_TREENODE_SPECIALCOMMANDSWITCH_H_ 121