Files
Upsilon/apps/home/controller.h
Émilie Feral 2e16365100 [escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
2017-02-20 10:54:02 +01:00

43 lines
1.3 KiB
C++

#ifndef HOME_CONTROLLER_H
#define HOME_CONTROLLER_H
#include <escher.h>
#include "app_cell.h"
class AppsContainer;
namespace Home {
class Controller : public ViewController, public SimpleTableViewDataSource, public SelectableTableViewDelegate {
public:
Controller(Responder * parentResponder, ::AppsContainer * container);
View * view() override;
bool handleEvent(Ion::Events::Event event) override;
void didBecomeFirstResponder() override;
virtual int numberOfRows() override;
virtual int numberOfColumns() override;
virtual KDCoordinate cellHeight() override;
virtual KDCoordinate cellWidth() override;
virtual HighlightCell * reusableCell(int index) override;
virtual int reusableCellCount() override;
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
private:
int numberOfIcons();
AppsContainer * m_container;
SelectableTableView m_selectableTableView;
static constexpr int k_numberOfColumns = 4;
static constexpr int k_numberOfApps = 10;
static constexpr int k_maxNumberOfCells = 16;
static constexpr int k_cellHeight = 98;
static constexpr int k_cellWidth = 104;
AppCell m_cells[k_maxNumberOfCells];
};
}
#endif