#ifndef WATCH_APP_MESSAGE_H
#define WATCH_APP_MESSAGE_H

#include "config.h"

/* Invoked with the freshly-saved config whenever a settings submission
 * arrives from the config page (src/pkjs/index.js, task #43) - main.c
 * uses this to recompute the reading and refresh/show the menu. */
typedef void (*ConfigUpdatedCallback)(const WatchConfig *cfg);

/* Registers the AppMessage inbox handler and opens the message buffers.
 * Call once at startup, before app_event_loop(). Message keys
 * (BIRTH_YEAR, BIRTH_UTC_OFFSET_MINUTES, LANG, NOTIFY_ENABLED, etc.) are
 * declared in watch/package.json's "messageKeys" and turn into
 * MESSAGE_KEY_* constants in the auto-generated message_keys.auto.h -
 * see app_message.c's own comment on why latitude/longitude/utc offset
 * travel as scaled integers rather than floats. */
void app_message_init(ConfigUpdatedCallback on_config_updated);

#endif
