Numworks Epsilon  1.4.1
Graphing Calculator Operating System
cell.h
Go to the documentation of this file.
1 #ifndef APPS_PROBABILITY_CELL_H
2 #define APPS_PROBABILITY_CELL_H
3 
4 #include <escher.h>
5 
6 namespace Probability {
7 
8 class Cell : public HighlightCell {
9 public:
10  Cell();
11  void reloadCell() override;
12  void setLabel(I18n::Message message);
13  void setImage(const Image * image, const Image * focusedImage);
14  void drawRect(KDContext * ctx, KDRect rect) const override;
15 private:
16  constexpr static KDCoordinate k_iconWidth = 35;
17  constexpr static KDCoordinate k_iconHeight = 19;
18  constexpr static KDCoordinate k_iconMargin = 10;
19  constexpr static KDCoordinate k_chevronWidth = 8;
20  constexpr static KDCoordinate k_chevronMargin = 10;
21  int numberOfSubviews() const override;
22  View * subviewAtIndex(int index) override;
23  void layoutSubviews() override;
24  MessageTextView m_labelView;
25  ImageView m_iconView;
26  /* TODO: One day, we would rather store a mask (8bits/pixel) instead of two
27  * images (16bits/pixels)*/
28  const Image * m_icon;
29  const Image * m_focusedIcon;
30  ChevronView m_chevronView;
31 };
32 
33 }
34 
35 #endif
int16_t KDCoordinate
Definition: coordinate.h:6
Definition: image.h:6
void reloadCell() override
Definition: cell.cpp:37
void drawRect(KDContext *ctx, KDRect rect) const override
Definition: cell.cpp:57
void setImage(const Image *image, const Image *focusedImage)
Definition: cell.cpp:52
void setLabel(I18n::Message message)
Definition: cell.cpp:48
Definition: rect.h:26
Definition: view.h:23