/[projects]/smsdaemon/Plugin.h
ViewVC logotype

Annotation of /smsdaemon/Plugin.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 196 - (hide annotations) (download)
Thu Dec 18 06:53:29 2008 UTC (15 years, 5 months ago) by torben
File MIME type: text/plain
File size: 1115 byte(s)
Make pretty

astyle -t -b -N

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    
11 torben 149 class ISmsTransceiver;
12 torben 53 class SMS;
13 torben 26
14     class Plugin
15     {
16     public:
17 torben 28 Plugin(std::string cmd, std::string desc);
18 torben 26
19     /* Called when a incomming sms triggers this plugin.
20     * Use the conversation object to write the response.
21 torben 196 * Note: the plugin is responsible for parsing and validating the arguments,
22 torben 26 * and if necessary write a error message back to the user.
23     */
24 torben 149 virtual void Execute(ISmsTransceiver& modem, SMS& sms) = 0;
25 torben 26
26     /*
27     * returns the command that triggers this plugin, for example: "myplugin"
28     */
29 torben 196 virtual std::string GetCommand()
30     {
31     return _command;
32     }
33 torben 26
34     /*
35     * Returns a desciption of this plugin - displayed when somebody calls "help"
36     */
37 torben 196 virtual std::string GetDescription()
38     {
39     return _description;
40     }
41 torben 26
42 torben 184
43     /*
44 torben 196 * A helper plugin is not accessible to the client but can be used to build a proxy / decorater plugin
45     */
46     virtual bool IsHelper()
47     {
48     return false;
49     }
50 torben 184
51 torben 26 virtual ~Plugin() {}
52 torben 28 protected:
53 torben 30
54     std::string _command;
55 torben 28 std::string _description;
56 torben 26 };
57    
58    
59     #endif // __PLUGIN_H__

  ViewVC Help
Powered by ViewVC 1.1.20