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

34 lines
994 B
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 <module-gui/gui/widgets/Label.hpp>
#include <module-gui/gui/widgets/ListItem.hpp>
#include <module-gui/gui/widgets/TextFixedSize.hpp>
#include <module-db/Interface/NotesRecord.hpp>
namespace gui
{
class NotesItem : public ListItem
{
public:
explicit NotesItem(std::shared_ptr<NotesRecord> record);
bool onDimensionChanged(const BoundingBox &oldDim, const BoundingBox &newDim) override;
private:
static gui::Label *createEmptyLabel(Item *parent);
void buildInterface();
void setSnippet(const UTF8 &noteText);
void setDateText(std::uint32_t timestamp);
std::shared_ptr<NotesRecord> note;
gui::Label *date = nullptr;
gui::Label *title = nullptr;
gui::TextFixedSize *snippet = nullptr;
};
} // namespace gui