Files
MuditaOS/module-apps/popups/WindowWithTimer.hpp
Jakub Pyszczak db4b41c56e [EGD-5712] Volume popup added
There is need of popup window on volume key
pressed event. This PR handles:
Creating base popup window attached to
application desktop.
Creating volume window.
Audio key events logic implementation.
2021-03-20 10:28:35 +01:00

29 lines
943 B
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "AppWindow.hpp"
#include <module-sys/Timers/TimerHandle.hpp>
namespace gui
{
inline constexpr auto defautTimeout = std::chrono::milliseconds{3000};
class WindowWithTimer : public gui::AppWindow
{
private:
sys::TimerHandle popupTimer;
void resetTimer();
void detachTimerIfExists();
public:
explicit WindowWithTimer(app::Application *app,
const std::string &name,
const std::chrono::milliseconds timeout = defautTimeout);
void destroyInterface() override;
~WindowWithTimer() override;
void onBeforeShow(ShowMode mode, SwitchData *data) override;
bool onInput(const gui::InputEvent &inputEvent) override;
};
} // namespace gui