-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRC_Plugin.h
61 lines (45 loc) · 1.29 KB
/
IRC_Plugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef IRC_PLUGIN_H
#define IRC_PLUGIN_H
#include "Plugin.h"
#include <vector>
#include "IRC_Server.h"
class IRC_Plugin : public Plugin
{
public:
enum Call_Type
{
ON_CLIENT_CONNECT = 0,
ON_CLIENT_DISCONNECT,
ON_CLIENT_REGISTERED,
BEFORE_MESSAGE_PARSE,
AFTER_MESSAGE_PARSE,
ON_RECIEVE_MESSAGE
};
enum Result_Of_Call
{
FAILURE = -1,
NOT_HANDLED = 0,
HANDLED = 1,
PARSED = 2
};
IRC_Plugin(std::string path, IRC_Server* link, bool isService);
virtual ~IRC_Plugin();
virtual std::vector<Call_Type> get_supported_calls();
virtual Result_Of_Call plugin_call(Call_Type type, IRC_Server::User* user, std::vector<std::string> &parts);
virtual std::string get_name_of_plugin(bool absolute = false);
private:
std::vector<Call_Type> supported_calls;
typedef std::vector<Call_Type> (*supported_calls_function)();
typedef Result_Of_Call (*plugin_call_function)(Call_Type type, IRC_Server::User* user, std::vector<std::string> &parts, IRC_Server* link);
typedef std::string (*name_of_plugin_function)();
typedef void (*init_function)(IRC_Server* link);
typedef void (*dealloc_function)();
IRC_Server* link;
protected:
supported_calls_function scf;
plugin_call_function pcf;
name_of_plugin_function nop;
init_function init;
dealloc_function dealloc;
};
#endif