Lab4

Dependencies:   SeeedStudioTFTv2 TFT_fonts mbed

Fork of Seeed_TFT_Touch_Shield by Shields

ActionListener.h

Committer:
uswickra
Date:
2014-09-26
Revision:
6:ebffa73d4f95
Parent:
4:ebcf8d366b91

File content as of revision 6:ebffa73d4f95:

#pragma once
#include <vector>
#include "mbed.h"

typedef enum { CORD, STR, CORD_STR } ActionType;

class ActionEvent{
public:
    //pixel x that event took place
    int x;  
    //pixel y that event took place
    int y;   
    
    char* str;
};

class ActionListener{
public:
    ActionListener();
    
    void registerForEvents(ActionListener* widg);
    
    void action(ActionType type, ActionEvent evnt);

protected:
    virtual void trigger_action( ActionType type, ActionEvent evnt, void* target)=0;
    bool is_reg;
    
private:
    ActionListener* target; 
       
};