用于EagleEye3.0 规则集漏报和误报测试的示例项目,项目收集于github和gitee
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
3.7 KiB

10 months ago
/**
* Copyright (C) 2014-2050
* All rights reserved.
*
* @file SScriptModule-i.h
* @brief
* @version v1.0
* @author SOUI group
* @date 2014/08/02
*
* Describe
*/
#pragma once
#include "event/SEventSubscriber.h"
#include <unknown/obj-ref-i.h>
// Start of SOUI namespace section
namespace SOUI
{
class SWindow;
/*!
\brief
Abstract interface required for all scripting support modules to be used with
the SOUI system.
*/
struct IScriptModule : public IObjRef
{
/**
* GetScriptEngine
* @brief
* @return void * --
* Describe
*/
virtual void * GetScriptEngine () = 0;
/*************************************************************************
Abstract interface
*************************************************************************/
/*!
\brief
Execute a script file.
\param pszScriptFile
String object holding the filename of the script file that is to be executed
*/
virtual void executeScriptFile(LPCSTR pszScriptFile) = 0;
/*!
\brief
Execute a script buffer.
\param buff
buffer of the script that is to be executed
\param sz
size of buffer
*/
virtual void executeScriptBuffer(const char* buff, size_t sz) = 0;
/*!
\brief
Execute script code contained in the given String object.
\param str
String object holding the valid script code that should be executed.
\return
Nothing.
*/
virtual void executeString(LPCSTR str) = 0;
/*!
\brief
Execute a scripted global 'event handler' function. The function should take some kind of EventArgs like parameter
that the concrete implementation of this function can create from the passed EventArgs based object.
\param handler_name
String object holding the name of the scripted handler function.
\param EventArgs *pEvt
SWindow based object that should be passed, by any appropriate means, to the scripted function.
\return
- true if the event was handled.
- false if the event was not handled.
*/
virtual bool executeScriptedEventHandler(LPCSTR handler_name, EventArgs *pEvt)=0;
/*!
\brief
Return identification string for the ScriptModule. If the internal id string has not been
set by the ScriptModule creator, a generic string of "Unknown scripting module" will be returned.
\return
String object holding a string that identifies the ScriptModule in use.
*/
virtual LPCSTR getIdentifierString() const = 0;
/*!
\brief
Subscribes or unsubscribe the named Event to a scripted function
\param target
The target EventSet for the subscription.
\param uEvent
Event ID to subscribe to.
\param subscriber_name
String object containing the name of the script function that is to be subscribed to the Event.
\return
*/
virtual bool subscribeEvent(SWindow* target, UINT uEvent, LPCSTR subscriber_name) = 0;
/**
* unsubscribeEvent
* @brief
* @param SWindow * target --
* @param UINT uEvent --
* @param LPCSTR subscriber_name --
* @return bool -- true操作成功
* Describe
*/
virtual bool unsubscribeEvent(SWindow* target, UINT uEvent, LPCSTR subscriber_name ) = 0;
};
struct IScriptFactory : public IObjRef
{
virtual HRESULT CreateScriptModule(IScriptModule ** ppScriptModule) = 0;
};
} // End of SOUI namespace section