#ifndef TERMINAL_TILE_H
#define TERMINAL_TILE_H

#include "piscreentile.h"
#include "pikbdlistener.h"


class TileTerminal: public PIScreenTile {
	PIOBJECT_SUBCLASS(TileTerminal, PIScreenTile)
public:
	TileTerminal(const PIString & n);

	void setContent(const PIVector<PIVector<PIScreenTypes::Cell> > & c) {cells = c;}

	EVENT(resizeRequest)
	EVENT1(keyPressed, PIKbdListener::KeyEvent, k)
	EVENT(closeRequest)

private:
	void drawEvent(PIScreenDrawer * d);
	bool keyEvent(PIKbdListener::KeyEvent key);
	void resizeEvent(int w, int h);

	PIVector<PIVector<PIScreenTypes::Cell> > cells;
	char lastp[3];

};


#endif // TERMINAL_TILE_H
