Files
MuditaOS/module-apps/apps-common/notifications/NotificationListItem.hpp
Lefucjusz 674a768364 [MOS-669] Add too hot battery notification when charging
* Added notification showing on the main
screen if the battery has reached too
high temperature to continue charging.
* Code cleanups.
2023-10-16 12:54:13 +02:00

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