LibreOffice Module framework (master) 1
|
can be used to map key identifier to the corresponding key codes ... More...
#include <keymapping.hxx>
Classes | |
struct | KeyIdentifierInfo |
is used to map a key code to the right key identifier, which is used to make the xml file "human readable" More... | |
Public Member Functions | |
KeyMapping () | |
sal_uInt16 | mapIdentifierToCode (const OUString &sIdentifier) |
return a suitable key code for the specified key identifier. More... | |
OUString | mapCodeToIdentifier (sal_uInt16 nCode) |
return a suitable key identifier for the specified key code. More... | |
Static Public Member Functions | |
static KeyMapping & | get () |
Private Types | |
typedef std::unordered_map< OUString, sal_Int16 > | Identifier2CodeHash |
hash structure to map identifier to key codes. More... | |
typedef std::unordered_map< sal_Int16, OUString > | Code2IdentifierHash |
hash structure to map key codes to identifier. More... | |
Private Member Functions | |
bool | impl_st_interpretIdentifierAsPureKeyCode (std::u16string_view sIdentifier, sal_uInt16 &rCode) |
check if the given string describe a numeric value ... and convert it. More... | |
Private Attributes | |
Identifier2CodeHash | m_lIdentifierHash |
hash to map identifier to key codes. More... | |
Code2IdentifierHash | m_lCodeHash |
hash to map key codes to identifier. More... | |
Static Private Attributes | |
static KeyIdentifierInfo const | KeyIdentifierMap [] |
can be used to map key identifier to the corresponding key codes ...
Definition at line 34 of file keymapping.hxx.
|
private |
hash structure to map key codes to identifier.
Definition at line 55 of file keymapping.hxx.
|
private |
hash structure to map identifier to key codes.
Definition at line 52 of file keymapping.hxx.
framework::KeyMapping::KeyMapping | ( | ) |
Definition at line 144 of file keymapping.cxx.
References framework::KeyMapping::KeyIdentifierInfo::Code, i, Identifier, KeyIdentifierMap, m_lCodeHash, and m_lIdentifierHash.
|
static |
Definition at line 159 of file keymapping.cxx.
Referenced by framework::XCUBasedAcceleratorConfiguration::impl_ts_load(), framework::AcceleratorConfigurationWriter::impl_ts_writeKeyCommandPair(), framework::lcl_getKeyString(), framework::XCUBasedAcceleratorConfiguration::reloadChanged(), and framework::AcceleratorConfigurationReader::startElement().
|
private |
check if the given string describe a numeric value ... and convert it.
sIdentifier | the string value, which should be converted. |
rCode | contains the converted code, but is defined only if this method returns sal_True! |
Definition at line 192 of file keymapping.cxx.
References o3tl::toInt32(), and u.
Referenced by mapIdentifierToCode().
OUString framework::KeyMapping::mapCodeToIdentifier | ( | sal_uInt16 | nCode | ) |
return a suitable key identifier for the specified key code.
nCode | short value, which describe the key. |
Definition at line 182 of file keymapping.cxx.
References m_lCodeHash.
Referenced by framework::AcceleratorConfigurationWriter::impl_ts_writeKeyCommandPair().
sal_uInt16 framework::KeyMapping::mapIdentifierToCode | ( | const OUString & | sIdentifier | ) |
return a suitable key code for the specified key identifier.
sIdentifier | string value, which describe the key. |
[css::lang::IllegalArgumentException] | if the given identifier does not describe a well known key code. |
Definition at line 164 of file keymapping.cxx.
References impl_st_interpretIdentifierAsPureKeyCode(), and m_lIdentifierHash.
Referenced by framework::XCUBasedAcceleratorConfiguration::impl_ts_load(), framework::XCUBasedAcceleratorConfiguration::reloadChanged(), and framework::AcceleratorConfigurationReader::startElement().
|
staticprivate |
Definition at line 61 of file keymapping.hxx.
Referenced by KeyMapping().
|
private |
hash to map key codes to identifier.
Definition at line 67 of file keymapping.hxx.
Referenced by KeyMapping(), and mapCodeToIdentifier().
|
private |
hash to map identifier to key codes.
Definition at line 64 of file keymapping.hxx.
Referenced by KeyMapping(), and mapIdentifierToCode().