summaryrefslogtreecommitdiffstats
path: root/apps/home_menu/main.hpp
blob: d82e2a06861683260e1736ac8ea9d2ff81fff695 (plain)
1
2
3
4
5
6
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Mul
#pragma once

#include "pico/util/datetime.h"

// Includes also buttons, API and ss_oled
#include "../../base_app.hpp"

#define NUMBER_OF_APPS 3
#define SIZE_APP_NAME 12

class app_home_menu : public BaseApp {
    private:
        const char *APPS_NAME[NUMBER_OF_APPS] = {"Home", "Clock", "Settings"};
        int selected_app = 0;
        char display_app_name[SIZE_APP_NAME];

        void title_str(char *buf, uint buf_size, const datetime_t *t);
        void show_title(Api *app_api);

        AppAttributes app_attributes = {0, false};
    public:
        const AppAttributes& app_get_attributes() {
            return app_attributes;
        }
        
        app_home_menu(Api *app_api);
        AppReturnValues render(Api *app_api);
        AppReturnValues btnpressed(Api *app_api, uint gpio, unsigned long delta);
        AppReturnValues bgrefresh(Api *app_api, bool in_foreground);
        ~app_home_menu();
};