--- smsdaemon/Plugin.h 2008/06/09 18:15:53 26 +++ smsdaemon/Plugin.h 2008/12/18 06:53:29 196 @@ -7,33 +7,52 @@ * Abstract parent class for a sms-daemon plugin. */ -#include "Sms.h" -class GsmModem; +class ISmsTransceiver; +class SMS; class Plugin { public: + Plugin(std::string cmd, std::string desc); /* Called when a incomming sms triggers this plugin. * Use the conversation object to write the response. - * Note: the plugin is responsible for parsing and validating the arguments, + * Note: the plugin is responsible for parsing and validating the arguments, * and if necessary write a error message back to the user. */ - virtual void Execute(GsmModem& modem, SMS& sms) = 0; + virtual void Execute(ISmsTransceiver& modem, SMS& sms) = 0; /* * returns the command that triggers this plugin, for example: "myplugin" */ - virtual std::string GetCommand() = 0; + virtual std::string GetCommand() + { + return _command; + } /* * Returns a desciption of this plugin - displayed when somebody calls "help" */ - virtual std::string GetDescription() = 0; + virtual std::string GetDescription() + { + return _description; + } + + + /* + * A helper plugin is not accessible to the client but can be used to build a proxy / decorater plugin + */ + virtual bool IsHelper() + { + return false; + } virtual ~Plugin() {} +protected: + std::string _command; + std::string _description; };