librime: selector.h Source File

| librime 1.2 Rime Input Method Engine, the core library

selector.h
Go to the documentation of this file.
1//
2// Copyright RIME Developers
3// Distributed under the BSD License
4//
5// 2011-09-11 GONG Chen <chen.sst@gmail.com>
6//
7#ifndef RIME_SELECTOR_H_
8#define RIME_SELECTOR_H_
9
10#include <rime/common.h>
11#include <rime/component.h>
12#include <rime/processor.h>
13#include <rime/gear/key_binding_processor.h>
14
15namespace rime {
16
17 class Selector : public Processor, public KeyBindingProcessor<Selector, 4> {
18 public:
19 enum TextOrientation {
20 Horizontal = 0,
21 Vertical = 1,
22 };
23 enum CandidateListLayout {
24 Stacked = 0,
25 Linear = 2,
26 };
27
28 explicit Selector(const Ticket& ticket);
29
30 ProcessResult ProcessKeyEvent(const KeyEvent& key_event) override;
31
32 Handler PreviousCandidate;
33 Handler NextCandidate;
34 Handler PreviousPage;
35 Handler NextPage;
36 Handler Home;
37 Handler End;
38
39 bool SelectCandidateAt(Context* ctx, int index);
40};
41
42} // namespace rime
43
44#endif // RIME_SELECTOR_H_
common.h
component.h
processor.h
key_binding_processor.h
rime
Definition algebra.cc:12
rime::ProcessResult
ProcessResult
Definition processor.h:18
rime::Context
Definition context.h:19
rime::KeyBindingProcessor< Selector, 4 >::KeyBindingProcessor
KeyBindingProcessor(ActionDef *action_definitions)
Definition key_binding_processor.h:36
rime::KeyBindingProcessor< Selector, 4 >::Handler
bool Handler(Context *ctx)
Definition key_binding_processor.h:19
rime::Selector::SelectCandidateAt
bool SelectCandidateAt(Context *ctx, int index)
Definition selector.cc:255
rime::Selector::ProcessKeyEvent
ProcessResult ProcessKeyEvent(const KeyEvent &key_event) override
Definition selector.cc:118
rime::Selector::PreviousPage
Handler PreviousPage
Definition selector.h:34
rime::Selector::CandidateListLayout
CandidateListLayout
Definition selector.h:23
rime::Selector::Linear
@ Linear
Definition selector.h:25
rime::Selector::Stacked
@ Stacked
Definition selector.h:24
rime::Selector::NextPage
Handler NextPage
Definition selector.h:35
rime::Selector::PreviousCandidate
Handler PreviousCandidate
Definition selector.h:32
rime::Selector::Home
Handler Home
Definition selector.h:36
rime::Selector::Selector
Selector(const Ticket &ticket)
Definition selector.cc:29
rime::Selector::End
Handler End
Definition selector.h:37
rime::Selector::TextOrientation
TextOrientation
Definition selector.h:19
rime::Selector::Horizontal
@ Horizontal
Definition selector.h:20
rime::Selector::Vertical
@ Vertical
Definition selector.h:21
rime::Selector::NextCandidate
Handler NextCandidate
Definition selector.h:33
rime::KeyEvent
Definition key_event.h:17
rime::Processor::Processor
Processor(const Ticket &ticket)
Definition processor.h:26
rime::Ticket
Definition ticket.h:17