Add new global module hooks, which allow global modules to be 'module providers'.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2119 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
darthgandalf
2010-09-07 09:53:13 +00:00
parent 9109df9227
commit ffcd42232f
2 changed files with 77 additions and 0 deletions
+39
View File
@@ -991,6 +991,39 @@ public:
* @param bState On or off, depending on which case client needs.
*/
virtual void OnClientCapRequest(const CString& sCap, bool bState);
/** Called when a module is going to be loaded.
* @param sModName name of the module.
* @param sArgs arguments of the module.
* @param[out] bSuccess the module was loaded successfully
* as result of this module hook?
* @param[out] sRetMsg text about loading of the module.
* @return See CModule::EModRet.
*/
virtual EModRet OnModuleLoading(const CString& sModName, const CString& sArgs,
bool& bSuccess, CString& sRetMsg);
/** Called when a module is going to be unloaded.
* @param pModule the module.
* @param[out] bSuccess the module was unloaded successfully
* as result of this module hook?
* @param[out] bRetMsg text about unloading of the module.
* @return See CModule::EModRet.
*/
virtual EModRet OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg);
/** Called when info about a module is needed.
* @param[out] ModInfo put result here, if your module knows it.
* @param sModule name of the module.
* @param bSuccess this module provided info about the module.
* @param sRetMsg text describing possible issues.
* @return See CModule::EModRet.
*/
virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg);
/** Called when list of available mods is requested.
* @param ssMods put new modules here.
* @param bGlobal true if global modules are needed.
*/
virtual void OnGetAvailableMods(set<CModInfo>& ssMods, bool bGlobal);
private:
};
@@ -1009,6 +1042,12 @@ public:
bool OnClientCapLs(SCString& ssCaps);
bool IsClientCapSupported(const CString& sCap, bool bState);
bool OnClientCapRequest(const CString& sCap, bool bState);
bool OnModuleLoading(const CString& sModName, const CString& sArgs,
bool& bSuccess, CString& sRetMsg);
bool OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg);
bool OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg);
bool OnGetAvailableMods(set<CModInfo>& ssMods, bool bGlobal);
private:
};