~aleteoryx/muditaos

ref: 196c02686ae5b344e6814800b7cb8aa2473f15ea muditaos/module-apps/application-messages/models/SMSThreadModel.hpp -rw-r--r-- 973 bytes
196c0268 — Przemyslaw Brudny [EGD-2395] Added BottomTop orientation support for listView. Created SMSThreadViewWindow and SMSOutputWidget. MessagesStyle moved from global Style.hpp. Fixes in Text. ListView fixes, BoxLayout callback for requestedSize. Added smsInput into list. Drafts handling added. 5 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
#pragma once

#include "DatabaseModel.hpp"
#include "Application.hpp"
#include "ListItemProvider.hpp"
#include "Interface/SMSRecord.hpp"
#include <application-messages/widgets/SMSInputWidget.hpp>

class SMSThreadModel : public app::DatabaseModel<SMSRecord>, public gui::ListItemProvider
{
  public:
    unsigned int smsThreadID      = 0;
    gui::SMSInputWidget *smsInput = nullptr;
    std::unique_ptr<utils::PhoneNumber::View> number;

    SMSThreadModel(app::Application *app);
    ~SMSThreadModel() override;

    void addReturnNumber();
    void handleDraftMessage();
    void resetInputWidget();

    auto handleQueryResponse(db::QueryResult *) -> bool;

    unsigned int requestRecordsCount() override;
    bool updateRecords(std::unique_ptr<std::vector<SMSRecord>> records) override;
    void requestRecords(uint32_t offset, uint32_t limit) override;
    unsigned int getMinimalItemHeight() const override;
    gui::ListItem *getItem(gui::Order order) override;
};