diff options
Diffstat (limited to 'native/src/proximity_info.h')
-rw-r--r-- | native/src/proximity_info.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/native/src/proximity_info.h b/native/src/proximity_info.h index 327cd0940..435a60151 100644 --- a/native/src/proximity_info.h +++ b/native/src/proximity_info.h @@ -25,11 +25,26 @@ namespace latinime { class ProximityInfo { public: + typedef enum { // Used as a return value for character comparison + SAME_OR_ACCENTED_OR_CAPITALIZED_CHAR, // Same char, possibly with different case or accent + NEAR_PROXIMITY_CHAR, // It is a char located nearby on the keyboard + UNRELATED_CHAR // It is an unrelated char + } ProximityType; + ProximityInfo(const int maxProximityCharsSize, const int keyboardWidth, const int keybaordHeight, const int gridWidth, const int gridHeight, const uint32_t *proximityCharsArray); ~ProximityInfo(); bool hasSpaceProximity(const int x, const int y) const; + void setInputParams(const int* inputCodes, const int inputLength); + const int* getProximityCharsAt(const int index) const; + unsigned short getPrimaryCharAt(const int index) const; + bool existsCharInProximityAt(const int index, const int c) const; + bool existsAdjacentProximityChars(const int index) const; + ProximityType getMatchedProximityId( + const int index, const unsigned short c, const int skipPos, + const int excessivePos, const int transposedPos) const; + bool sameAsTyped(const unsigned short *word, int length) const; private: int getStartIndexFromCoordinates(const int x, const int y) const; const int MAX_PROXIMITY_CHARS_SIZE; @@ -39,7 +54,9 @@ private: const int GRID_HEIGHT; const int CELL_WIDTH; const int CELL_HEIGHT; + const int *mInputCodes; uint32_t *mProximityCharsArray; + int mInputLength; }; } // namespace latinime |