Enhancement - Hooks

- Implemented all command hooks.
- Implemented several field hooks.
- Implemented several task hooks.
- Reorganized event validation code.
- Finalized Hooks -> API::call* mechanism.
- Implemented several hook unit tests.
- Corrected unit tests that didn't specify rc.hooks=on.
- Corrected builds that include Lua.
This commit is contained in:
Paul Beckingham 2010-01-31 23:29:22 -05:00
parent 50f27e0952
commit f351e17a63
15 changed files with 782 additions and 97 deletions

View file

@ -58,22 +58,22 @@ public:
void initialize ();
void setTaskId (int);
// void setField (const std::string&, const std::string&);
// void setTaskList (const std::vector <int>&);
bool trigger (const std::string&);
bool trigger (const std::string&); // Program
bool trigger (const std::string&, std::vector <Task>&); // List
bool trigger (const std::string&, Task&); // Task
bool trigger (const std::string&, const std::string&, std::string&); // Field
private:
bool eventType (const std::string&, std::string&);
bool validProgramEvent (const std::string&);
bool validListEvent (const std::string&);
bool validTaskEvent (const std::string&);
bool validFieldEvent (const std::string&);
private:
#ifdef HAVE_LIBLUA
API api;
#endif
std::vector <Hook> all; // All current hooks.
#ifdef HAVE_LIBLUA
int task_id;
#endif
};
#endif