|
PebbleOS
|
Action menus for timeline items and the handling of action results. More...
Typedefs | |
| typedef void(* | ActionCompleteCallback) (bool succeeded, void *cb_data) |
| Called when an action or batch of actions completes. | |
Enumerations | |
| enum | TimelineItemActionSource { TimelineItemActionSourceModalNotification , TimelineItemActionSourceNotificationApp , TimelineItemActionSourceTimeline , TimelineItemActionSourceSendTextApp , TimelineItemActionSourcePhoneUi } |
| Where an action was invoked from. More... | |
Functions | |
| void | timeline_actions_add_action_to_root_level (TimelineItemAction *action, ActionMenuLevel *root_level) |
| Add an action to an action menu level. | |
| ActionMenuLevel * | timeline_actions_create_action_menu_root_level (uint8_t num_actions, uint8_t separator_index, TimelineItemActionSource source) |
| Create the root level of a timeline action menu. | |
| ActionMenu * | timeline_actions_push_action_menu (ActionMenuConfig *base_config, WindowStack *window_stack) |
| Create a timeline action menu and push it. | |
| ActionMenu * | timeline_actions_push_response_menu (TimelineItem *item, TimelineItemAction *reply_action, GColor bg_color, ActionMenuDidCloseCb did_close_cb, WindowStack *window_stack, TimelineItemActionSource source, bool standalone_reply) |
| Create a reply menu from a response action and push it. | |
| void | timeline_actions_dismiss_all (NotificationInfo *notif_list, int num_notifications, ActionMenu *action_menu, ActionCompleteCallback dismiss_all_complete_callback, void *dismiss_all_cb_data) |
| Invoke the dismiss action of several notifications and reminders. | |
| void | timeline_actions_invoke_action (const TimelineItemAction *action, const TimelineItem *pin, ActionCompleteCallback cb, void *cb_data) |
| Invoke an action without an action menu. | |
Action menus for timeline items and the handling of action results.
Invoking an action shows progress, waits for the PebbleSysNotificationActionResult and shows the result, follows chained actions or starts a reply as the result requests.
| typedef void(* ActionCompleteCallback) (bool succeeded, void *cb_data) |
Called when an action or batch of actions completes.
| succeeded | Whether it succeeded. |
| cb_data | Context given with the callback. |
Where an action was invoked from.
| void timeline_actions_add_action_to_root_level | ( | TimelineItemAction * | action, |
| ActionMenuLevel * | root_level | ||
| ) |
Add an action to an action menu level.
Response and postpone actions get a submenu; the others a plain item. The label is the action's title attribute.
| action | Action to add; must outlive the menu. |
| root_level | Level to add it to. |
| ActionMenuLevel * timeline_actions_create_action_menu_root_level | ( | uint8_t | num_actions, |
| uint8_t | separator_index, | ||
| TimelineItemActionSource | source | ||
| ) |
Create the root level of a timeline action menu.
Also records source and requests a responsive phone connection while the menu is open.
| num_actions | Number of actions the level holds. |
| separator_index | Index of the separator, see ActionMenuLevel. |
| source | Window or app creating the menu. |
| void timeline_actions_dismiss_all | ( | NotificationInfo * | notif_list, |
| int | num_notifications, | ||
| ActionMenu * | action_menu, | ||
| ActionCompleteCallback | dismiss_all_complete_callback, | ||
| void * | dismiss_all_cb_data | ||
| ) |
Invoke the dismiss action of several notifications and reminders.
Dismisses one item per KernelMain callback so the event queue drains in between; ANCS dismissals after the first use bulk mode. Failures are ignored as long as one dismissal succeeds.
| notif_list | Items to dismiss; copied. |
| num_notifications | Number of items. |
| action_menu | Menu the request came from, frozen until done; may be NULL. |
| dismiss_all_complete_callback | Called when done, may be NULL. |
| dismiss_all_cb_data | Context for dismiss_all_complete_callback. |
| void timeline_actions_invoke_action | ( | const TimelineItemAction * | action, |
| const TimelineItem * | pin, | ||
| ActionCompleteCallback | cb, | ||
| void * | cb_data | ||
| ) |
Invoke an action without an action menu.
| action | Action to perform. |
| pin | Item the action belongs to. |
| cb | Called when the action completes, also immediately with false for local or failed actions; may be NULL. |
| cb_data | Context for cb. |
| ActionMenu * timeline_actions_push_action_menu | ( | ActionMenuConfig * | base_config, |
| WindowStack * | window_stack | ||
| ) |
Create a timeline action menu and push it.
The menu hierarchy is destroyed when the menu closes.
| base_config | Menu configuration; its context must be the TimelineItem of the menu. |
| window_stack | Window stack to push to. |
| ActionMenu * timeline_actions_push_response_menu | ( | TimelineItem * | item, |
| TimelineItemAction * | reply_action, | ||
| GColor | bg_color, | ||
| ActionMenuDidCloseCb | did_close_cb, | ||
| WindowStack * | window_stack, | ||
| TimelineItemActionSource | source, | ||
| bool | standalone_reply | ||
| ) |
Create a reply menu from a response action and push it.
| item | Item the menu belongs to. |
| reply_action | Response action. |
| bg_color | Background color of the menu. |
| did_close_cb | Called when the menu closes. |
| window_stack | Window stack to push to. |
| source | Window or app pushing the menu. |
| standalone_reply | Label the voice option "Reply with Voice", for context when no menu was shown before. |