Loading...
Searching...
No Matches
calendar_store.h
Go to the documentation of this file.
1
11#pragma once
12#include <pebble.h>
13
14#include "wire/calendar_wire.h"
15
20
25typedef struct
26{
27 bool live;
29 uint32_t persist_key;
31
35typedef struct
36{
39
47
55
57void calendar_store_subscribe(void (*cb)(void));
58
61
68const CalendarEvent *calendar_store_event(uint8_t index);
69
71int calendar_store_age_s(void);
72
The agenda as the phone packs it, and the reader that unpacks it.
const CalendarEvent * calendar_store_event(uint8_t index)
One event by index, or NULL when the index is past what is filled.
Definition calendar_store.c:219
int calendar_store_age_s(void)
How many seconds since the last reading turned up, or -1 if we have none.
Definition calendar_store.c:228
void calendar_store_subscribe(void(*cb)(void))
Hand it the function to call when the agenda changes (the screen redraw).
Definition calendar_store.c:153
const CalendarStrip * calendar_store_strip(void)
The whole agenda strip. count is 0 until a reading lands.
Definition calendar_store.c:214
void calendar_store_init(CalendarConfig cfg, const CalendarSeed *seed)
Start the store with its rules. Pass seed = NULL for normal use.
Definition calendar_store.c:158
void calendar_store_reconfigure(CalendarConfig cfg)
Re-apply the rules (e.g. the poll interval changed). Moves the next poll to the new interval,...
Definition calendar_store.c:207
The rules a face hands the store, built from its own settings so the store names no SETTING_*.
Definition calendar_store.h:26
uint32_t persist_key
Slot for the last good strip so the face owns the key instead of the store.
Definition calendar_store.h:29
bool live
True subscribes the channel and polls. False just keeps the fake data for screenshots.
Definition calendar_store.h:27
int poll_min
Minutes between calendar requests.
Definition calendar_store.h:28
One event. start and end are absolute epochs so the readouts stay fresh against the watch's own clock...
Definition calendar_wire.h:33
Optional prefill: shown until the first real reading lands, or pinned when live = false.
Definition calendar_store.h:36
const CalendarStrip * strip
The events to show, or NULL for none.
Definition calendar_store.h:37
The agenda strip. count is 0 until a reading lands.
Definition calendar_wire.h:43