18 std::unordered_map<Action *, std::vector<ScopedConnection>> actions_;
30 StatusArea::~StatusArea() {}
36 d->actions_.erase(action);
40 insertChild(&d->separatorBeforeIM, action);
42 case StatusGroup::InputMethod:
43 insertChild(&d->separatorAfterIM, action);
49 d->actions_[action].emplace_back(
51 auto *action = static_cast<Action *>(p);
55 d->actions_[action].emplace_back(
68 d->actions_.erase(action);
76 addChild(&d->separatorBeforeIM);
77 addChild(&d->separatorAfterIM);
81 for (
auto *action :
actions(group)) {
87 std::vector<Action *> result;
88 for (
auto *ele :
childs()) {
89 if (ele == &d->separatorBeforeIM || ele == &d->separatorAfterIM) {
92 result.push_back(static_cast<Action *>(ele));
99 std::vector<Action *> result;
102 for (
auto *ele :
childs()) {
103 if (ele == &d->separatorBeforeIM) {
106 result.push_back(static_cast<Action *>(ele));
109 case StatusGroup::InputMethod: {
111 for (
auto *ele :
childs()) {
112 if (ele == &d->separatorBeforeIM) {
116 if (ele == &d->separatorAfterIM) {
120 result.push_back(static_cast<Action *>(ele));
127 for (
auto *ele :
childs()) {
128 if (ele == &d->separatorAfterIM) {
133 result.push_back(static_cast<Action *>(ele));
StatusArea(InputContext *ic)
Construct status area for associated input context.
void addAction(StatusGroup group, Action *action)
Add an action to given group.
The Action class provides an abstraction for user commands that can be added to user interfaces...
std::vector< Action * > actions(StatusGroup group) const
Get the associated actions for group.
void clearGroup(StatusGroup group)
Clear only given status group.
Action shown before input method group.
Class for status area in UI.
void clear()
Clear all the actions, will be called when input context lost focus.
void removeAction(Action *action)
Remove an action from given group.
std::vector< Action * > allActions() const
Get all the associated actions.
const std::list< Element * > & childs() const
List all childs.
bool isChild(const Element *element) const
Enable query between different elements.
Action shown after input method group.
An input context represents a client of Fcitx.
void updateUserInterface(UserInterfaceComponent component, bool immediate=false)
Notifies UI about changes in user interface.