Files
MuditaOS/module-apps/application-notes/windows/NoteEditWindow.hpp
Piotr Tanski c8c4f82080 [EGD-4487] Application notes implemented. (#1094)
* [EGD-4487] Implementation of notes application.
2020-11-30 13:48:05 +01:00

44 lines
1.3 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 <cstdint>
#include "AppWindow.hpp"
#include <module-db/Interface/NotesRecord.hpp>
#include "gui/widgets/Label.hpp"
#include "gui/widgets/Text.hpp"
#include "gui/input/InputEvent.hpp"
#include <module-apps/application-notes/presenter/NoteEditWindowPresenter.hpp>
namespace app::notes
{
class NoteEditWindow : public gui::AppWindow, public NoteEditWindowContract::View
{
public:
NoteEditWindow(app::Application *app, std::unique_ptr<NoteEditWindowContract::Presenter> &&windowPresenter);
~NoteEditWindow() noexcept override;
void onBeforeShow(gui::ShowMode mode, gui::SwitchData *data) override;
bool onInput(const gui::InputEvent &inputEvent) override;
void rebuild() override;
void buildInterface() override;
void destroyInterface() override;
private:
void setCharactersCount(std::uint32_t count);
void setNoteText(const UTF8 &text);
void saveNote();
std::unique_ptr<NoteEditWindowContract::Presenter> presenter;
std::unique_ptr<NotesRecord> notesRecord;
gui::Label *charactersCounter;
gui::Text *edit;
};
} // namespace app::notes