librime: rime::Switches Class Reference

| librime 1.2 Rime Input Method Engine, the core library

Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
rime::Switches Class Reference

`#include <switches.h>`

## Classes
struct | SwitchOption

## Public Types
enum | SwitchType { kToggleOption , kRadioGroup }
enum | FindResult { kContinue , kFound }

## Public Member Functions
| Switches (Config *config)
SwitchOption | FindOption (function< FindResult(SwitchOption option)> callback)
SwitchOption | OptionByName (const string &option_name)
SwitchOption | ByIndex (size_t switch_index)
StringSlice | GetStateLabel (const string &option_name, int state, bool abbreviated)

## Static Public Member Functions
static SwitchOption | Cycle (const SwitchOption &option)
static SwitchOption | Reset (const SwitchOption &option)
static SwitchOption | FindRadioGroupOption (an< ConfigMap > the_switch, function< FindResult(SwitchOption option)> callback)
static StringSlice | GetStateLabel (an< ConfigMap > the_switch, size_t state_index, bool abbreviated)

## Member Enumeration Documentation

## ◆ FindResult

enum rime::Switches::FindResult

Enumerator
kContinue |
kFound |

## ◆ SwitchType

enum rime::Switches::SwitchType

Enumerator
kToggleOption |
kRadioGroup |

## Constructor & Destructor Documentation

## ◆ Switches()

rime::Switches::Switches | ( | Config * | config | ) |
| inlineexplicit

## Member Function Documentation

## ◆ ByIndex()

Switches::SwitchOption rime::Switches::ByIndex | ( | size_t | switch_index | ) |

## ◆ Cycle()

Switches::SwitchOption rime::Switches::Cycle | ( | const SwitchOption & | option | ) |
| static

## ◆ FindOption()

Switches::SwitchOption rime::Switches::FindOption | ( | function< FindResult(SwitchOption option)> | callback | ) |

## ◆ FindRadioGroupOption()

Switches::SwitchOption rime::Switches::FindRadioGroupOption | ( | an< ConfigMap > | the_switch,
|  | function< FindResult(SwitchOption option)> | callback )
| static

## ◆ GetStateLabel() [1/2]

StringSlice rime::Switches::GetStateLabel | ( | an< ConfigMap > | the_switch,
|  | size_t | state_index,
|  | bool | abbreviated )
| static

## ◆ GetStateLabel() [2/2]

StringSlice rime::Switches::GetStateLabel | ( | const string & | option_name,
|  | int | state,
|  | bool | abbreviated )

## ◆ OptionByName()

Switches::SwitchOption rime::Switches::OptionByName | ( | const string & | option_name | ) |

## ◆ Reset()

Switches::SwitchOption rime::Switches::Reset | ( | const SwitchOption & | option | ) |
| static

The documentation for this class was generated from the following files:

- switches.h
- switches.cc