~aleteoryx/muditaos

ref: 29f455d46bbddee9a8f0ea860e84c9b6e5ab38b5 muditaos/module-apps/application-phonebook/widgets/PhonebookItem.hpp -rw-r--r-- 1.0 KiB
29f455d4 — Przemyslaw Brudny [EGD-7998] Pure image assets cleanup and update 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// 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 "Interface/ContactRecord.hpp"
#include "Label.hpp"
#include "Image.hpp"
#include "ListItem.hpp"
#include <BoxLayout.hpp>
#include <TextFixedSize.hpp>

namespace gui
{

    class PhonebookItem : public ListItem
    {
        gui::Label *contactName = nullptr;
        gui::HBox *hBox         = nullptr;

        bool favourite = false;
        void markFavourite(bool val);
        void markBlocked(bool val);
        LabelMarkerDisplayMode labeMarkerDisplayMode = LabelMarkerDisplayMode::IncludeFavourites;

      public:
        std::shared_ptr<ContactRecord> contact = nullptr;

        PhonebookItem();
        virtual ~PhonebookItem() = default;

        // sets copy of contact
        void setContact(std::shared_ptr<ContactRecord> note);
        void setMarkerItem(UTF8 text);
        UTF8 getLabelMarker();

        void setLabelMarkerDisplayMode(LabelMarkerDisplayMode mode);
    };

} /* namespace gui */