mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
Enhancement - Hooks
- Added Lua copyright notice to the version command. - Added Lua copyright details to API.cpp, which is the only file that interacts with Lua. - Added hook-type detection. - Added a hook-type calling mechanism in Hooks. - Implemented the post-start and pre-exit event triggers. - Context::initialize now calls Hooks::initialize, which in turn calls API::initialize. We have liftoff!
This commit is contained in:
parent
c66d6b0500
commit
57e94585e8
5 changed files with 141 additions and 6 deletions
23
src/Hooks.h
23
src/Hooks.h
|
@ -27,16 +27,31 @@
|
|||
#ifndef INCLUDED_HOOKS
|
||||
#define INCLUDED_HOOKS
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "API.h"
|
||||
|
||||
class Hooks
|
||||
{
|
||||
public:
|
||||
Hooks (); // Default constructor
|
||||
~Hooks (); // Destructor
|
||||
Hooks (); // Default constructor
|
||||
~Hooks (); // Destructor
|
||||
Hooks (const Hooks&); // Deliberately unimplemented
|
||||
Hooks& operator= (const Hooks&); // Deliberately unimplemented
|
||||
|
||||
Hooks (const Hooks&);
|
||||
Hooks& operator= (const Hooks&);
|
||||
void initialize ();
|
||||
bool trigger (const std::string&);
|
||||
bool eventType (const std::string&, std::string&);
|
||||
|
||||
private:
|
||||
bool triggerProgramEvent (const std::string&);
|
||||
bool triggerListEvent (const std::string&);
|
||||
bool triggerTaskEvent (const std::string&);
|
||||
bool triggerFieldEvent (const std::string&);
|
||||
|
||||
private:
|
||||
API api;
|
||||
std::vector <std::string> scripts;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue