mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 10:07:19 +02:00
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:
parent
50f27e0952
commit
f351e17a63
15 changed files with 782 additions and 97 deletions
16
src/Hooks.h
16
src/Hooks.h
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue