Blame view

epsilon-master/apps/probability/responder_image_cell.h 1.2 KB
6663b6c9   adorian   projet complet av...
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
31
32
33
34
35
  #ifndef PROBABILITY_RESPONDER_IMAGE_CELL_H
  #define PROBABILITY_RESPONDER_IMAGE_CELL_H
  
  #include <escher.h>
  #include "calculation/calculation.h"
  #include "calculation_type_controller.h"
  #include "image_cell.h"
  
  namespace Probability {
  
  class ResponderImageCell : public HighlightCell, public Responder {
  public:
    ResponderImageCell(Responder * parentResponder, Law * law, Calculation * calculation, CalculationController * calculationController);
    Responder * responder() override {
      return this;
    }
    void drawRect(KDContext * ctx, KDRect rect) const override;
    KDSize minimalSizeForOptimalDisplay() const override;
    bool handleEvent(Ion::Events::Event event) override;
    void setHighlighted(bool highlight) override;
    void setImage(const Image * image, const Image * focusedImage);
    constexpr static KDCoordinate k_outline = 1;
    constexpr static KDCoordinate k_oneCellWidth = 2*k_outline+ImageCell::k_width;
    constexpr static KDCoordinate k_oneCellHeight = 2*k_outline+ImageCell::k_height;
  private:
    int numberOfSubviews() const override;
    View * subviewAtIndex(int index) override;
    void layoutSubviews() override;
    ImageCell m_imageCell;
    CalculationTypeController m_calculationTypeController;
  };
  
  }
  
  #endif