~aleteoryx/muditaos

ref: 7d4452f90c40b1b5d3f673f321484c6f418bbea2 muditaos/module-apps/application-calllog/windows/CallLogDetailsWindow.hpp -rw-r--r-- 2.1 KiB
7d4452f9 — Bartosz Cichocki [EGD-6052] Add idle BT device disconnect 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// 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 <string>
#include <functional>

#include "AppWindow.hpp"
#include "gui/widgets/Text.hpp"
#include "gui/widgets/Label.hpp"
#include "gui/widgets/Image.hpp"
#include "gui/widgets/Window.hpp"
#include "gui/widgets/BottomBar.hpp"
#include "gui/widgets/ListView.hpp"

#include "../data/CallLogInternals.hpp"

namespace gui
{

    class CallLogDetailsWindow : public AppWindow
    {

        enum FocusRects
        {
            Call,
            Sms,
            NumOfRects
        };

        Label *informationLabel                                                                     = nullptr;
        Label *number                                                                               = nullptr;
        gui::Rect *rects[static_cast<uint32_t>(FocusRects::NumOfRects)]                             = {nullptr};
        Image *callImg                                                                              = nullptr;
        Image *smsImg                                                                               = nullptr;
        gui::Image *callTypeImg[static_cast<uint32_t>(calllog::CallLogCallType::NUM_OF_CALL_TYPES)] = {
            nullptr, nullptr, nullptr};
        Label *typeLabel     = nullptr;
        Label *durationLabel = nullptr;
        Label *typeData      = nullptr;
        Label *durationData  = nullptr;
        Label *dateLabel     = nullptr;
        Label *dateDay       = nullptr;
        Label *dateDate      = nullptr;

        CalllogRecord record;

        Label *decorateLabel(Label *);
        Label *decorateData(Label *);

      public:
        CallLogDetailsWindow(app::Application *app);
        virtual ~CallLogDetailsWindow();

        // virtual methods
        bool onInput(const InputEvent &inputEvent) override;
        void onBeforeShow(ShowMode mode, SwitchData *data) override;

        void rebuild() override;
        void buildInterface() override;
        void destroyInterface() override;
    };

} /* namespace gui */