1 |
torben |
26 |
#ifndef __PLUGIN_H__ |
2 |
|
|
#define __PLUGIN_H__ |
3 |
|
|
|
4 |
|
|
#include <string> |
5 |
|
|
|
6 |
|
|
/* |
7 |
|
|
* Abstract parent class for a sms-daemon plugin. |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#include "Sms.h" |
11 |
|
|
|
12 |
|
|
class GsmModem; |
13 |
|
|
|
14 |
|
|
class Plugin |
15 |
|
|
{ |
16 |
|
|
public: |
17 |
|
|
|
18 |
|
|
/* Called when a incomming sms triggers this plugin. |
19 |
|
|
* Use the conversation object to write the response. |
20 |
|
|
* Note: the plugin is responsible for parsing and validating the arguments, |
21 |
|
|
* and if necessary write a error message back to the user. |
22 |
|
|
*/ |
23 |
|
|
virtual void Execute(GsmModem& modem, SMS& sms) = 0; |
24 |
|
|
|
25 |
|
|
/* |
26 |
|
|
* returns the command that triggers this plugin, for example: "myplugin" |
27 |
|
|
*/ |
28 |
|
|
virtual std::string GetCommand() = 0; |
29 |
|
|
|
30 |
|
|
/* |
31 |
|
|
* Returns a desciption of this plugin - displayed when somebody calls "help" |
32 |
|
|
*/ |
33 |
|
|
virtual std::string GetDescription() = 0; |
34 |
|
|
|
35 |
|
|
virtual ~Plugin() {} |
36 |
|
|
|
37 |
|
|
}; |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
#endif // __PLUGIN_H__ |