~aleteoryx/muditaos

ref: 621304168edc83453e0f60a7c4a459401f68f822 muditaos/module-apps/application-settings/models/network/SimContactsImportModel.cpp -rw-r--r-- 1.1 KiB
62130416 — Przemyslaw Brudny [EGD-7203] Added extra space removal in Text draw line ending 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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SimContactsImportModel.hpp"

#include <application-settings/widgets/network/SimContactImportSelectWidget.hpp>
#include <ListView.hpp>
#include <i18n/i18n.hpp>

SimContactsImportModel::SimContactsImportModel(app::Application *app) : application(app)
{
    createData();
}

auto SimContactsImportModel::requestRecordsCount() -> unsigned int
{
    return internalData.size();
}

auto SimContactsImportModel::getMinimalItemSpaceRequired() const -> unsigned int
{
    return style::window::label::big_h + style::margins::big;
}

void SimContactsImportModel::requestRecords(const uint32_t offset, const uint32_t limit)
{
    setupModel(offset, limit);
    list->onProviderDataUpdate();
}

auto SimContactsImportModel::getItem(gui::Order order) -> gui::ListItem *
{
    return getRecord(order);
}

void SimContactsImportModel::createData()
{
    for (auto item : internalData) {
        item->deleteByList = false;
    }
}

void SimContactsImportModel::clearData()
{
    list->reset();
    eraseInternalData();
}