mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 06:59:13 -04:00
Fixed inability to save a contact without a phone number when contact lose the number after replace similar number and visibility of the SAVE button when editing/creating a contact.
54 lines
2.2 KiB
C++
54 lines
2.2 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 "application-phonebook/data/PhonebookInternals.hpp"
|
|
#include "application-phonebook/data/PhonebookItemData.hpp"
|
|
#include "application-phonebook/widgets/ContactListItem.hpp"
|
|
|
|
#include <ListItem.hpp>
|
|
#include <Text.hpp>
|
|
#include <TextFixedSize.hpp>
|
|
|
|
namespace gui
|
|
{
|
|
class InputLinesWithLabelWidget : public ContactListItem
|
|
{
|
|
public:
|
|
explicit InputLinesWithLabelWidget(
|
|
phonebookInternals::ListItemName listItemName,
|
|
const std::function<void(const UTF8 &text, bool emptyOthers)> &navBarTemporaryMode = nullptr,
|
|
const std::function<void()> &navBarRestoreFromTemporaryMode = nullptr,
|
|
const std::function<void(const UTF8 &text, bool active)> &navBarSetOptionsLabel = nullptr,
|
|
const std::function<void()> &selectSpecialCharacter = nullptr,
|
|
const std::function<void(std::function<void()> restoreFunction)> &restoreInputMode = nullptr,
|
|
const std::function<void(Text *text)> &inputOptions = nullptr,
|
|
unsigned int lines = 1);
|
|
|
|
VBox *vBox = nullptr;
|
|
Label *titleLabel = nullptr;
|
|
TextFixedSize *inputText = nullptr;
|
|
|
|
auto getListItemName() -> phonebookInternals::ListItemName;
|
|
|
|
private:
|
|
phonebookInternals::ListItemName listItemName;
|
|
void applyItemNameSpecificSettings();
|
|
|
|
std::function<void(const UTF8 &text, bool emptyOthers)> navBarTemporaryMode = nullptr;
|
|
std::function<void()> navBarRestoreFromTemporaryMode = nullptr;
|
|
std::function<void(const UTF8 &text, bool active)> navBarSetOptionsLabel = nullptr;
|
|
std::function<void(Text *text)> inputOptions = nullptr;
|
|
|
|
void firstNameHandler();
|
|
void secondNameHandler();
|
|
void numberHandler();
|
|
void secondNumberHandler();
|
|
void emailHandler();
|
|
void addressHandler();
|
|
void noteHandler();
|
|
};
|
|
|
|
} /* namespace gui */
|