Pebble Foundation Classes
0.2.0
C++ for Pebble
|
Classes | |
struct | ActionMenuConfig |
Configuration struct for the ActionMenu. More... | |
Typedefs | |
typedef struct ActionMenuItem | ActionMenuItem |
typedef struct ActionMenuLevel | ActionMenuLevel |
typedef struct ActionMenu | ActionMenu |
typedef void(* | ActionMenuDidCloseCb) (ActionMenu *menu, const ActionMenuItem *performed_action, void *context) |
typedef void(* | ActionMenuPerformActionCb) (ActionMenu *action_menu, const ActionMenuItem *action, void *context) |
typedef void(* | ActionMenuEachItemCb) (const ActionMenuItem *item, void *context) |
Enumerations | |
enum | ActionMenuAlign { ActionMenuAlignTop = 0, ActionMenuAlignCenter } |
enum | ActionMenuLevelDisplayMode { ActionMenuLevelDisplayModeWide, ActionMenuLevelDisplayModeThin } |
Functions | |
char * | action_menu_item_get_label (const ActionMenuItem *item) |
void * | action_menu_item_get_action_data (const ActionMenuItem *item) |
ActionMenuLevel * | action_menu_level_create (uint16_t max_items) |
void | action_menu_level_set_display_mode (ActionMenuLevel *level, ActionMenuLevelDisplayMode display_mode) |
ActionMenuItem * | action_menu_level_add_action (ActionMenuLevel *level, const char *label, ActionMenuPerformActionCb cb, void *action_data) |
ActionMenuItem * | action_menu_level_add_child (ActionMenuLevel *level, ActionMenuLevel *child, const char *label) |
void | action_menu_hierarchy_destroy (const ActionMenuLevel *root, ActionMenuEachItemCb each_cb, void *context) |
void * | action_menu_get_context (ActionMenu *action_menu) |
ActionMenuLevel * | action_menu_get_root_level (ActionMenu *action_menu) |
ActionMenu * | action_menu_open (ActionMenuConfig *config) |
void | action_menu_freeze (ActionMenu *action_menu) |
void | action_menu_unfreeze (ActionMenu *action_menu) |
void | action_menu_set_result_window (ActionMenu *action_menu, Window *result_window) |
void | action_menu_close (ActionMenu *action_menu, bool animated) |
typedef void(* ActionMenuDidCloseCb) (ActionMenu *menu, const ActionMenuItem *performed_action, void *context) |
Callback executed after the ActionMenu has closed, so memory may be freed.
root_level | the root level passed to the ActionMenu |
performed_action | the ActionMenuItem for the action that was performed, NULL if the ActionMenu is closing without an action being selected by the user |
context | the context passed to the ActionMenu |
typedef void(* ActionMenuEachItemCb) (const ActionMenuItem *item, void *context) |
Callback invoked for each item in an action menu hierarchy.
item | the current action menu item |
a | caller-provided context callback |
typedef void(* ActionMenuPerformActionCb) (ActionMenu *action_menu, const ActionMenuItem *action, void *context) |
Callback executed when a given action is selected
action_menu | the action menu currently on screen |
action | the action that was triggered |
context | the context passed to the action menu |
enum value that controls whether menu items are displayed in a grid (similarly to the emoji replies) or in a single column (reminiscent of MenuLayer)
Enumerator | |
---|---|
ActionMenuLevelDisplayModeWide | Each item gets its own row. |
ActionMenuLevelDisplayModeThin | Grid view: multiple items per row. |
void action_menu_close | ( | ActionMenu * | action_menu, |
bool | animated | ||
) |
Close the ActionMenu, whether it is frozen or not.
action_menu | the ActionMenu to close |
animated | whether or not show a close animation |
void action_menu_freeze | ( | ActionMenu * | action_menu | ) |
Freeze the ActionMenu. The ActionMenu will no longer respond to user input.
action_menu | the ActionMenu |
void* action_menu_get_context | ( | ActionMenu * | action_menu | ) |
Get the context pointer this ActionMenu was created with
action_menu | A pointer to an ActionMenu |
ActionMenuLevel* action_menu_get_root_level | ( | ActionMenu * | action_menu | ) |
Get the root level of an ActionMenu
action_menu | the ActionMenu you want to know about |
void action_menu_hierarchy_destroy | ( | const ActionMenuLevel * | root, |
ActionMenuEachItemCb | each_cb, | ||
void * | context | ||
) |
Destroy a hierarchy of ActionMenuLevels
root | the root level in the hierarchy |
each_cb | a callback to call on every ActionMenuItem in every level |
context | a context pointer to pass to each_cb on invocation |
void* action_menu_item_get_action_data | ( | const ActionMenuItem * | item | ) |
Getter for the action_data pointer of a given ActionMenuitem.
item | the ActionMenuItem of interest |
char* action_menu_item_get_label | ( | const ActionMenuItem * | item | ) |
Getter for the label of a given ActionMenuItem
item | the ActionMenuItem of interest |
ActionMenuItem* action_menu_level_add_action | ( | ActionMenuLevel * | level, |
const char * | label, | ||
ActionMenuPerformActionCb | cb, | ||
void * | action_data | ||
) |
Add an action to an ActionLevel
level | the level to add the action to |
label | the text to display for the action in the menu |
cb | the callback that will be triggered when this action is actuated |
action_data | data to pass to the callback for this action |
ActionMenuItem* action_menu_level_add_child | ( | ActionMenuLevel * | level, |
ActionMenuLevel * | child, | ||
const char * | label | ||
) |
Add a child to this ActionMenuLevel
level | the parent level |
child | the child level |
label | the text to display in the action menu for this level |
ActionMenuLevel* action_menu_level_create | ( | uint16_t | max_items | ) |
Create a new action menu level with storage allocated for a given number of items
max_items | the max number of items that will be displayed at that level |
void action_menu_level_set_display_mode | ( | ActionMenuLevel * | level, |
ActionMenuLevelDisplayMode | display_mode | ||
) |
Set the action menu display mode
level | The ActionMenuLevel whose display mode you want to change |
display_mode | The display mode for the action menu (3 vs. 1 item per row) |
ActionMenu* action_menu_open | ( | ActionMenuConfig * | config | ) |
Open a new ActionMenu. The ActionMenu acts much like a window. It fills the whole screen and handles clicks.
config | the configuration info for this new ActionMenu |
void action_menu_set_result_window | ( | ActionMenu * | action_menu, |
Window * | result_window | ||
) |
Set the result window for an ActionMenu. The result window will be shown when the ActionMenu closes
action_menu | the ActionMenu |
result_window | the window to insert, pass NULL to remove the current result window |
void action_menu_unfreeze | ( | ActionMenu * | action_menu | ) |
Unfreeze the ActionMenu previously frozen with action_menu_freeze
action_menu | the ActionMenu to unfreeze |