Files
MuditaOS/module-apps/application-messages/widgets/ThreadModel.hpp
kkleczkowski b66ae1fa8b Edg 2286 browsing history of conversations (#92)
* WiP on thread view.

* Missing db code.

* Fixes in sericeDB, working on listView in threads window.

* Changes in thread Db message.

* Missing responseTo value bug tracking.

* Fixed threads DB getter.

* Show threads list.

* Added missing code in service-db.

* Small fixes.

* WiP listView swich page.

* Code clean-up.

* Code formatted.

* PR sugestions applied.
2019-11-27 10:09:03 +01:00

43 lines
993 B
C++

/*
* ThreadeModel.hpp
*
* Created on: 13 lis 2019
* Author: kuba
*/
#pragma once
#include <vector>
#include <stdint.h>
#include "DatabaseModel.hpp"
#include "Application.hpp"
#include "ListItemProvider.hpp"
#include "Interface/ThreadRecord.hpp"
class ThreadModel: public app::DatabaseModel<ThreadRecord>,
public gui::ListItemProvider {
public:
ThreadModel() = delete;
ThreadModel(app::Application *app);
virtual ~ThreadModel() = default;
void requestRecordsCount() override;
bool updateRecords(std::unique_ptr<std::vector<ThreadRecord>> records,
const uint32_t offset, const uint32_t limit, uint32_t count)
override;
void requestRecords(const uint32_t offset, const uint32_t limit) override;
gui::ListItem* getItem(int index, int firstElement, int prevElement,
uint32_t limit, int remaining, bool topDown) override;
int getItemCount() const override {
return recordsCount;
}
;
app::Application* getApplication(void) {
return application;
}
;
};