spiegel-keyman/core/src/keyboard.hpp
Marc Durdin 671973baab refactor(core): split context API from Core primary API
Relates to #9999.
Fixes #10384.

The context API endpoints should no longer be considered as part of the
standard Core API. The only consumers that have a need to access these
APIs are the IMX integration in Engine for Windows, and the Keyman
Developer Debugger.

These symbols are currently used by Developer:
* `km_core_context` struct
* `km_core_context_type` enum
* `km_core_context_item` struct
* `KM_CORE_CONTEXT_ITEM_END` macro
* `km_core_state_context()`
* `km_core_context_set()`
* `km_core_context_clear()`

These symbols are currently used by Windows IMX:
* `km_core_context` struct
* `km_core_context_type` enum
* `km_core_context_item` struct
* `KM_CORE_CONTEXT_ITEM_END` macro
* `km_core_context_items_dispose()`
* `km_core_context_item_list_size()`
* `km_core_state_get_intermediate_context()`

The following functions and symbols are moving to
keyman_core_api_context.h:
* `km_core_context` struct
* `km_core_context_type` enum
* `km_core_context_item` struct
* `KM_CORE_CONTEXT_ITEM_END` macro
* `km_core_state_context()` function
* `km_core_state_get_intermediate_context()` function
* `km_core_context_set()` function
* `km_core_context_clear()` function
* `km_core_context_get()` function
* `km_core_context_items_from_utf16()` function
* `km_core_context_items_from_utf8()` function
* `km_core_context_items_to_utf8()` function
* `km_core_context_items_to_utf16()` function
* `km_core_context_items_to_utf32()` function
* `km_core_context_items_dispose()` function
* `km_core_context_length()` function
* `km_core_context_append()` function
* `km_core_context_shrink()` function
* `km_core_context_item_list_size()` function
2024-01-17 14:44:25 +11:00

62 lines
1.7 KiB
C++

/*
Copyright: © 2018 SIL International.
Description: Internal keyboard class and adaptor class for the API.
Create Date: 2 Oct 2018
Authors: Tim Eves (TSE)
History: 2 Oct 2018 - TSE - Refactored out of km_core_keyboard_api.cpp
*/
#pragma once
#include <string>
#include <vector>
#include "keyman_core.h"
#include "option.hpp"
#include "path.hpp"
// Forward declarations
class json;
namespace km {
namespace core
{
class keyboard_attributes : public km_core_keyboard_attrs
{
std::u16string _keyboard_id;
std::u16string _version_string;
core::path _folder_path;
std::vector<option> _default_opts;
void render();
public:
using options_store = decltype(_default_opts);
using path_type = decltype(_folder_path);
keyboard_attributes()
: km_core_keyboard_attrs {nullptr, nullptr, nullptr, nullptr} {}
keyboard_attributes(keyboard_attributes const &) = delete;
keyboard_attributes(keyboard_attributes &&);
keyboard_attributes(std::u16string const & id,
std::u16string const & version,
path_type const & path,
options_store const &opts);
keyboard_attributes & operator = (keyboard_attributes const &) = delete;
keyboard_attributes & operator = (keyboard_attributes &&);
friend json & operator << (json &, km::core::keyboard_attributes const &);
options_store const & default_opts_store() const noexcept { return _default_opts; }
options_store & default_opts_store() noexcept { return _default_opts; }
path_type const & path() const noexcept { return _folder_path; }
};
json & operator << (json &, km::core::keyboard_attributes const &);
} // namespace core
} // namespace km