Loading...
Searching...
No Matches
calendar_store.h File Reference

Active calendar store. It owns the appmessage calendar channel and its place on the shared cadence, so a face just hands it the rules (live / poll interval), optionally seeds it, then reads the events and subscribes for repaints. The phone data flows straight in and nobody wires it. More...

#include <pebble.h>
#include "wire/calendar_wire.h"

Go to the source code of this file.

Data Structures

struct  CalendarConfig
 The rules a face hands the store, built from its own settings so the store names no SETTING_*. More...
struct  CalendarSeed
 Optional prefill: shown until the first real reading lands, or pinned when live = false. More...

Functions

void calendar_store_init (CalendarConfig cfg, const CalendarSeed *seed)
 Start the store with its rules. Pass seed = NULL for normal use.
void calendar_store_reconfigure (CalendarConfig cfg)
 Re-apply the rules (e.g. the poll interval changed). Moves the next poll to the new interval, and switching the store off here stops it asking the phone. Only init decides whether the store is live, so one init started with live = false stays on its seed whatever cfg says, and one never started ignores the call.
void calendar_store_subscribe (void(*cb)(void))
 Hand it the function to call when the agenda changes (the screen redraw).
const CalendarStrip * calendar_store_strip (void)
 The whole agenda strip. count is 0 until a reading lands.
const CalendarEvent * calendar_store_event (uint8_t index)
 One event by index, or NULL when the index is past what is filled.
int calendar_store_age_s (void)
 How many seconds since the last reading turned up, or -1 if we have none.

Detailed Description

Active calendar store. It owns the appmessage calendar channel and its place on the shared cadence, so a face just hands it the rules (live / poll interval), optionally seeds it, then reads the events and subscribes for repaints. The phone data flows straight in and nobody wires it.