1#ifndef _KVI_KVS_MODULEINTERFACE_H_
2#define _KVI_KVS_MODULEINTERFACE_H_
86 bool hasSwitch(
unsigned short u,
const QString & szSwitch) {
return (m_pSwitchList->
find(
u, szSwitch) != 0); };
102 :
KviKvsModuleCommandCall(pModule, pContext, pParams, pSwitches), m_pCallback(pCallback), m_pParameterDataList(pDataList){};
108 virtual bool getParameterCode(
unsigned int uParamIdx, QString & szParamBuffer);
137 friend class KviKvsModuleManager;
157 m_pModuleSimpleCommandExecRoutineDict->
remove(szCommand);
161 m_pModuleCallbackCommandExecRoutineDict->
remove(szCommand);
165 m_pModuleFunctionExecRoutineDict->
remove(szFunction);
167 void kvsUnregisterAppEventHandler(
unsigned int iEventIdx);
168 void kvsUnregisterRawEventHandler(
unsigned int iRawIdx);
172 m_pModuleSimpleCommandExecRoutineDict->
clear();
176 m_pModuleCallbackCommandExecRoutineDict->
clear();
180 m_pModuleFunctionExecRoutineDict->
clear();
182 void kvsUnregisterAllAppEventHandlers();
183 void kvsUnregisterAllRawEventHandlers();
184 void kvsUnregisterAllEventHandlers();
188 return m_pModuleSimpleCommandExecRoutineDict->
find(szCommand);
192 return m_pModuleCallbackCommandExecRoutineDict->
find(szCommand);
196 return m_pModuleFunctionExecRoutineDict->
find(szFunction);
199 void completeCommand(
const QString & cmd, std::vector<QString> & matches);
200 void completeFunction(
const QString & cmd, std::vector<QString> & matches);
201 void getAllFunctionsCommandsModule(QStringList * list, QString & szModuleName);
204 void registerDefaultCommands();
207#define KVSM_REGISTER_SIMPLE_COMMAND(_pModule, _szCmd, _procname) \
208 _pModule->kvsRegisterSimpleCommand(_szCmd, _procname);
210#define KVSM_UNREGISTER_SIMPLE_COMMAND(_pModule, _szCmd) \
211 _pModule->kvsUnregisterSimpleCommand(_szCmd);
213#define KVSM_REGISTER_CALLBACK_COMMAND(_pModule, _szCmd, _procname) \
214 _pModule->kvsRegisterCallbackCommand(_szCmd, _procname);
216#define KVSM_UNREGISTER_CALLBACK_COMMAND(_pModule, _szCmd) \
217 _pModule->kvsUnregisterCallbackCommand(_szCmd);
219#define KVSM_REGISTER_FUNCTION(_pModule, _szFnc, _procname) \
220 _pModule->kvsRegisterFunction(_szFnc, _procname);
222#define KVSM_UNREGISTER_FUNCTION(_pModule, _szFnc) \
223 _pModule->kvsUnregisterFunction(_szFnc);
225#define KVSM_UNREGISTER_ALL_SIMPLE_COMMANDS(_pModule) \
226 _pModule->kvsUnregisterAllSimpleCommands();
228#define KVSM_UNREGISTER_ALL_CALLBACK_COMMANDS(_pModule) \
229 _pModule->kvsUnregisterAllCallbackCommands();
231#define KVSM_UNREGISTER_ALL_FUNCTIONS(_pModule) \
232 _pModule->kvsUnregisterAllFunctions();
234#define KVSM_PARAMETER(a, b, c, d) KVS_PARAMETER(a, b, c, d)
235#define KVSM_PARAMETER_IGNORED(a) KVS_PARAMETER_IGNORED(a)
237#define KVSM_PARAMETERS_BEGIN(pCall) \
238 KVS_PARAMETERS_BEGIN(parameter_format_list)
240#define KVSM_PARAMETERS_END(pCall) \
242 if(!KviKvsParameterProcessor::process(pCall->params(), pCall->context(), parameter_format_list)) \
245#define KVSM_REQUIRE_CONNECTION(pCall) \
246 if(!pCall->window()->context()) \
247 return c->context()->errorNoIrcContext(); \
248 if(!pCall->window()->connection()) \
249 return c->context()->warningNoIrcConnection();
bool(* KviKvsModuleEventHandlerRoutine)(KviKvsModuleEventCall *c)
Definition KviKvsModuleInterface.h:133
bool(* KviKvsModuleCallbackCommandExecRoutine)(KviKvsModuleCallbackCommandCall *c)
Definition KviKvsModuleInterface.h:132
bool(* KviKvsModuleSimpleCommandExecRoutine)(KviKvsModuleCommandCall *c)
Definition KviKvsModuleInterface.h:130
bool(* KviKvsModuleFunctionExecRoutine)(KviKvsModuleFunctionCall *c)
Definition KviKvsModuleInterface.h:131
Helper functions for the QString class.
Definition KviKvsModuleInterface.h:91
KviKvsModuleCallbackCommandCall(KviModule *pModule, KviKvsRunTimeContext *pContext, KviKvsVariantList *pParams, KviKvsSwitchList *pSwitches, const KviKvsScript *pCallback, KviKvsTreeNodeDataList *pDataList)
Definition KviKvsModuleInterface.h:96
~KviKvsModuleCallbackCommandCall()
Definition KviKvsModuleInterface.h:103
const KviKvsScript * m_pCallback
Definition KviKvsModuleInterface.h:93
KviKvsTreeNodeDataList * m_pParameterDataList
Definition KviKvsModuleInterface.h:94
const KviKvsScript * callback()
Definition KviKvsModuleInterface.h:107
Definition KviKvsModuleInterface.h:69
KviKvsVariant * getSwitch(unsigned short u, const QString &szSwitch)
Definition KviKvsModuleInterface.h:87
KviKvsSwitchList * m_pSwitchList
Definition KviKvsModuleInterface.h:71
KviKvsSwitchList * switches()
Definition KviKvsModuleInterface.h:82
KviKvsModuleCommandCall(KviModule *pModule, KviKvsRunTimeContext *pContext, KviKvsVariantList *pParams, KviKvsSwitchList *pSwitches)
Definition KviKvsModuleInterface.h:74
bool hasSwitch(unsigned short u, const QString &szSwitch)
Definition KviKvsModuleInterface.h:86
~KviKvsModuleCommandCall()
Definition KviKvsModuleInterface.h:79
KviKvsSwitchList * switchList()
Definition KviKvsModuleInterface.h:83
Definition KviKvsModuleInterface.h:59
KviKvsModuleEventCall(KviModule *pModule, KviKvsRunTimeContext *pContext, KviKvsVariantList *pParams)
Definition KviKvsModuleInterface.h:61
~KviKvsModuleEventCall()
Definition KviKvsModuleInterface.h:65
Definition KviKvsModuleInterface.h:112
KviKvsVariant * m_pResult
Definition KviKvsModuleInterface.h:116
KviKvsModuleFunctionCall(KviModule *pModule, KviKvsRunTimeContext *pContext, KviKvsVariantList *pParams, KviKvsVariant *pResult)
Definition KviKvsModuleInterface.h:119
KviKvsVariant * returnValue()
Definition KviKvsModuleInterface.h:127
~KviKvsModuleFunctionCall()
Definition KviKvsModuleInterface.h:124
Definition KviKvsModuleInterface.h:136
void kvsUnregisterSimpleCommand(const QString &szCommand)
Definition KviKvsModuleInterface.h:155
void kvsUnregisterFunction(const QString &szFunction)
Definition KviKvsModuleInterface.h:163
KviKvsModuleSimpleCommandExecRoutine * kvsFindSimpleCommand(const QString &szCommand)
Definition KviKvsModuleInterface.h:186
KviPointerHashTable< QString, KviKvsModuleSimpleCommandExecRoutine > * m_pModuleSimpleCommandExecRoutineDict
Definition KviKvsModuleInterface.h:144
KviPointerHashTable< QString, KviKvsModuleCallbackCommandExecRoutine > * m_pModuleCallbackCommandExecRoutineDict
Definition KviKvsModuleInterface.h:146
void kvsUnregisterCallbackCommand(const QString &szCommand)
Definition KviKvsModuleInterface.h:159
KviKvsModuleFunctionExecRoutine * kvsFindFunction(const QString &szFunction)
Definition KviKvsModuleInterface.h:194
KviPointerHashTable< QString, KviKvsModuleFunctionExecRoutine > * m_pModuleFunctionExecRoutineDict
Definition KviKvsModuleInterface.h:145
void kvsUnregisterAllFunctions()
Definition KviKvsModuleInterface.h:178
void kvsUnregisterAllCallbackCommands()
Definition KviKvsModuleInterface.h:174
KviKvsModuleCallbackCommandExecRoutine * kvsFindCallbackCommand(const QString &szCommand)
Definition KviKvsModuleInterface.h:190
void kvsUnregisterAllSimpleCommands()
Definition KviKvsModuleInterface.h:170
Definition KviKvsModuleInterface.h:43
KviKvsModuleRunTimeCall(KviModule *pModule, KviKvsRunTimeContext *pContext, KviKvsVariantList *pParams)
Definition KviKvsModuleInterface.h:48
~KviKvsModuleRunTimeCall()
Definition KviKvsModuleInterface.h:52
KviModule * module()
Definition KviKvsModuleInterface.h:55
KviModule * m_pModule
Definition KviKvsModuleInterface.h:45
Definition KviKvsRunTimeCall.h:34
virtual bool getParameterCode(unsigned int uParamIdx, QString &szParamBuffer)
Definition KviKvsRunTimeCall.cpp:44
Definition KviKvsRunTimeContext.h:104
The KVIrc Script class.
Definition KviKvsScript.h:60
Definition KviKvsSwitchList.h:34
KviKvsVariant * find(const QChar &c)
Definition KviKvsSwitchList.h:50
Definition KviKvsTreeNodeDataList.h:36
Definition KviKvsTreeNodeModuleFunctionCall.h:36
Class to handle variant variables lists.
Definition KviKvsVariantList.h:42
This class defines a new data type which contains variant data.
Definition KviKvsVariant.h:352
Definition KviModule.h:131
A fast pointer hash table implementation.
Definition KviPointerHashTable.h:450
void clear()
Removes all the items from the hash table.
Definition KviPointerHashTable.h:650
bool remove(const Key &hKey)
Removes the item pointer associated to the key hKey, if such an item exists in the hash table.
Definition KviPointerHashTable.h:581
T * find(const Key &hKey)
Returns the item associated to the key.
Definition KviPointerHashTable.h:471
#define u
Definition detector.cpp:86
#define r
Definition detector.cpp:83
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127