Files
MuditaOS/module-apps/application-desktop/windows/PowerOffWindow.hpp
Wojtek Rzepecki abdca6d635 [EGD-5090] Add Brownout GUI window
Gui window will appear due to brownout
event. System shutdown will be also called.
2021-01-22 13:23:58 +01:00

44 lines
1.1 KiB
C++

// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include <vector>
#include "AppWindow.hpp"
#include "gui/widgets/Label.hpp"
#include "gui/widgets/Image.hpp"
#include "gui/widgets/BottomBar.hpp"
namespace gui
{
class PowerOffWindow : public AppWindow
{
enum class State
{
PowerDown,
Return,
};
gui::Label *titleLabel = nullptr;
gui::Label *infoLabel = nullptr;
std::vector<gui::Label *> selectionLabels;
gui::Label *eventMgrLabel = nullptr;
gui::Image *powerImage = nullptr;
gui::Image *powerDownImage = nullptr;
State state = State::Return;
public:
PowerOffWindow(app::Application *app);
void onBeforeShow(ShowMode mode, SwitchData *data) override;
bool onInput(const InputEvent &inputEvent) override;
void rebuild() override;
void buildInterface() override;
void destroyInterface() override;
private:
void invalidate() noexcept;
};
} /* namespace gui */