Files
MuditaOS/module-apps/application-calendar/widgets/NewEventCheckBoxWithLabel.hpp
Michał Kamoń b16523e325 [EGD-6222] Fix the App Calendar memory leaks
This PR fixes:
 -several explicit uses of `new` that were not matched by `delete`
 -dangling `CalendarTimeItem`s
 -reset of focus on the `allDayEventCheckBox` check/uncheck
 -exiting the app form `allEventsWindow` on `KEY_RF`
2021-03-22 10:35:04 +01:00

32 lines
945 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 "CheckBoxWithLabelItem.hpp"
#include <widgets/DateWidget.hpp>
namespace gui
{
class NewEventCheckBoxWithLabel : public CheckBoxWithLabelItem
{
using OnCheckCallback = std::function<void(bool)>;
OnCheckCallback onCheck = nullptr;
app::Application *app = nullptr;
gui::DateWidget *dateItem = nullptr;
void applyCallbacks() override;
public:
NewEventCheckBoxWithLabel(app::Application *application,
const std::string &description,
OnCheckCallback onCheck);
void setConnectionToDateItem(gui::DateWidget *item);
};
namespace allDayEvents
{
bool isAllDayEvent(TimePoint start, TimePoint end);
}
} /* namespace gui */