1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
//
// Copyleft RIME Developers
// License: GPLv3
//
// 2011-03-14 GONG Chen <chen.sst@gmail.com>
//
#ifndef RIME_PROCESSOR_H_
#define RIME_PROCESSOR_H_
#include <rime/component.h>
#include <rime/ticket.h>
namespace rime {
class Engine;
class KeyEvent;
enum ProcessResult {
kRejected, // do the OS default processing
kAccepted, // consume it
kNoop, // leave it to other processors
};
class Processor : public Class<Processor, const Ticket&> {
public:
explicit Processor(const Ticket& ticket)
: engine_(ticket.engine), name_space_(ticket.name_space) {}
virtual ~Processor() {}
virtual ProcessResult ProcessKeyEvent(const KeyEvent& key_event) {
return kNoop;
}
protected:
Engine *engine_;
std::string name_space_;
};
} // namespace rime
#endif // RIME_PROCESSOR_H_
|