ListBookController - partie 1

This commit is contained in:
Fournier Gabriel
2020-11-14 13:39:11 +01:00
parent a0acdc171b
commit c37b4bd1f4
6 changed files with 68 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ app_headers += apps/reader/app.h
app_sreader_src = $(addprefix apps/reader/,\
app.cpp \
list_book_controller.cpp \
)
apps_src += $(app_sreader_src)

View File

@@ -30,7 +30,8 @@ App::Descriptor * App::Snapshot::descriptor() {
App::App(Snapshot * snapshot) :
::App(snapshot, nullptr)
::App(snapshot, &m_listBookController),
m_listBookController(nullptr)
{
}

View File

@@ -2,6 +2,7 @@
#define READER_H
#include <escher.h>
#include "list_book_controller.h"
namespace reader {
@@ -20,7 +21,7 @@ public:
};
private:
App(Snapshot * snapshot);
ListBookController m_listBookController;
};
}

View File

@@ -0,0 +1,37 @@
#include "list_book_controller.h"
namespace reader
{
View* ListBookController::view()
{
return &m_tableView;
}
ListBookController::ListBookController(Responder * parentResponder):
ViewController(parentResponder),
m_tableView(this, this)
{
}
int ListBookController::numberOfRows() const
{
return 0;
}
KDCoordinate ListBookController::cellHeight()
{
return 50;
}
HighlightCell * ListBookController::reusableCell(int index)
{
return nullptr;
}
int ListBookController::reusableCellCount() const
{
return 0;
}
}

View File

@@ -0,0 +1,25 @@
#ifndef __LIST_BOOK_CONTROLLER_H__
#define __LIST_BOOK_CONTROLLER_H__
#include <escher.h>
namespace reader
{
class ListBookController : public ViewController, public SimpleListViewDataSource, public ScrollViewDataSource
{
public:
ListBookController(Responder * parentResponder);
View* view() override;
int numberOfRows() const override;
KDCoordinate cellHeight() override;
HighlightCell * reusableCell(int index) override;
int reusableCellCount() const override;
private:
TableView m_tableView;
};
}
#endif

2
themes

Submodule themes updated: 48fc1cc727...20073ead09