mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-22 16:09:10 -04:00
* Added notification showing on the main screen if the battery has reached too high temperature to continue charging. * Code cleanups.
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <ListItem.hpp>
|
|
#include <BoxLayout.hpp>
|
|
#include <Text.hpp>
|
|
#include <widgets/ButtonTriState.hpp>
|
|
|
|
#include "NotificationData.hpp"
|
|
|
|
namespace gui
|
|
{
|
|
class TextFixedSize;
|
|
|
|
class NotificationListItem : public ListItem
|
|
{
|
|
using NotificationType = notifications::NotificationType;
|
|
const NotificationType type = NotificationType::NotSeenSms;
|
|
bool dismissible = false;
|
|
|
|
protected:
|
|
gui::HBox *box = nullptr;
|
|
gui::TextFixedSize *text = nullptr;
|
|
|
|
public:
|
|
explicit NotificationListItem(NotificationType type);
|
|
|
|
[[nodiscard]] bool isDismissible() const noexcept;
|
|
[[nodiscard]] NotificationType getType() const noexcept;
|
|
void setName(const UTF8 &name, bool isRich = false, gui::text::RichTextParser::TokenMap &&tokens = {});
|
|
void setDismissible(bool isDismissible) noexcept;
|
|
|
|
std::function<void()> dismissCallback = nullptr;
|
|
};
|
|
|
|
class NotificationWithEventCounter : public NotificationListItem
|
|
{
|
|
public:
|
|
NotificationWithEventCounter(notifications::NotificationType type, unsigned count);
|
|
};
|
|
|
|
class NotificationWithOnOffButton : public NotificationListItem
|
|
{
|
|
public:
|
|
NotificationWithOnOffButton(notifications::NotificationType type, gui::ButtonTriState::State state);
|
|
};
|
|
|
|
} // namespace gui
|