PebbleOS
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
Timeline action menus

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.
 

Detailed Description

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 Documentation

◆ ActionCompleteCallback

typedef void(* ActionCompleteCallback) (bool succeeded, void *cb_data)

Called when an action or batch of actions completes.

Parameters
succeededWhether it succeeded.
cb_dataContext given with the callback.

Enumeration Type Documentation

◆ TimelineItemActionSource

Where an action was invoked from.

Enumerator
TimelineItemActionSourceModalNotification 

Notification popup.

TimelineItemActionSourceNotificationApp 

Notifications app.

TimelineItemActionSourceTimeline 

Timeline app.

TimelineItemActionSourceSendTextApp 

Send Text app.

TimelineItemActionSourcePhoneUi 

Phone call UI.

Function Documentation

◆ timeline_actions_add_action_to_root_level()

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.

Parameters
actionAction to add; must outlive the menu.
root_levelLevel to add it to.

◆ timeline_actions_create_action_menu_root_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.

Also records source and requests a responsive phone connection while the menu is open.

Parameters
num_actionsNumber of actions the level holds.
separator_indexIndex of the separator, see ActionMenuLevel.
sourceWindow or app creating the menu.
Returns
Root level.

◆ timeline_actions_dismiss_all()

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.

Parameters
notif_listItems to dismiss; copied.
num_notificationsNumber of items.
action_menuMenu the request came from, frozen until done; may be NULL.
dismiss_all_complete_callbackCalled when done, may be NULL.
dismiss_all_cb_dataContext for dismiss_all_complete_callback.

◆ timeline_actions_invoke_action()

void timeline_actions_invoke_action ( const TimelineItemAction *  action,
const TimelineItem *  pin,
ActionCompleteCallback  cb,
void *  cb_data 
)

Invoke an action without an action menu.

Parameters
actionAction to perform.
pinItem the action belongs to.
cbCalled when the action completes, also immediately with false for local or failed actions; may be NULL.
cb_dataContext for cb.

◆ timeline_actions_push_action_menu()

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.

Parameters
base_configMenu configuration; its context must be the TimelineItem of the menu.
window_stackWindow stack to push to.
Returns
Action menu, or NULL if out of memory.

◆ timeline_actions_push_response_menu()

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.

Parameters
itemItem the menu belongs to.
reply_actionResponse action.
bg_colorBackground color of the menu.
did_close_cbCalled when the menu closes.
window_stackWindow stack to push to.
sourceWindow or app pushing the menu.
standalone_replyLabel the voice option "Reply with Voice", for context when no menu was shown before.
Returns
Action menu, or NULL if out of memory.