spiegel-keyman/core/src/ldml/ldml_processor.hpp
Steven R. Loomis a4080d2b7a feat(core): ldml: cleanup of header files
- quell debug messages unless KMXPLUS_DEBUG=1
- don't read the file twice

#5015
2022-08-19 17:42:09 -05:00

81 lines
1.9 KiB
C++

/*
Copyright: © SIL International.
Description: Internal keyboard class and adaptor class for the LDML Keyboard Processor.
Create Date: 6 Aug 2022
Authors: Marc Durdin
*/
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include <keyman/keyboardprocessor.h>
#include "processor.hpp"
#include "option.hpp"
namespace km {
namespace kbp {
#define KM_KBP_LMDL_PROCESSOR_VERSION u"1.0"
class ldml_processor : public abstract_processor {
private:
std::vector<uint8_t> rawdata; // TODO-LDML: should be 'unpacked' format instead.
public:
ldml_processor(
path const & kb_path,
const std::vector<uint8_t> & data
);
// ~ldml_processor() override;
static bool is_kmxplus_file(
path const & kb_path,
std::vector<uint8_t>& data
);
km_kbp_status
process_event(
km_kbp_state *state,
km_kbp_virtual_key vk,
uint16_t modifier_state,
uint8_t is_key_down,
uint16_t event_flags
) override;
virtual km_kbp_attr const & attributes() const override;
km_kbp_status validate() const override;
char16_t const *
lookup_option(
km_kbp_option_scope _kmn_unused(scope),
std::u16string const & _kmn_unused(key)
) const override {
return nullptr;
}
option
update_option(
km_kbp_option_scope _kmn_unused(scope),
std::u16string const & _kmn_unused(key),
std::u16string const & _kmn_unused(value)
) override {
return option();
}
km_kbp_status process_queued_actions(km_kbp_state *state) override;
bool queue_action(
km_kbp_state * state,
km_kbp_action_item const* action_item
) override;
km_kbp_context_item * get_intermediate_context() override;
km_kbp_keyboard_key * get_key_list() const override;
km_kbp_keyboard_imx * get_imx_list() const override;
};
} // namespace kbp
} // namespace km