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
36
37
38
39
40
41
42
43
44
45
46
47
/********************************************************************
*
*    File:        fsITextEntryRenderData.h
*
*    Purpose:     Interface to text entry render data.
*
*********************************************************************/

#ifndef fsITextEntryRenderDatahdr
#define fsITextEntryRenderDatahdr

#include <fsCore/fsBaseTypes.h>

#include <functional>

#include "fsINativeRenderData.h"
#include "fsIRenderData.h"

class fsSColour;
class fsStr;
struct fsPoint;

class fsITextEntryRenderData : public fsINativeRenderData, public fsIRenderData
{
public:

	void virtualKeyboardActivate(const fsStr& pPrompt, fsS32 pMaxStingLength, const fsPoint& pPos,
	                             std::function<void(const fsStr&)> pFinalise);
	void update(fsS32 pDeltaMs);
	void display();

	fsITextEntryRenderData();
	virtual ~fsITextEntryRenderData();<--- Destructor in derived class

protected:

	virtual void virtualKeyboardActivateDo(const fsStr& pPrompt, fsS32 pMaxStingLength, const fsPoint& pPos,
	                                       std::function<void(const fsStr&)> pFinalise) = 0;
	virtual void updateDo(fsS32 pDeltaMs) = 0;
	void renderDo() override = 0;

private:

	std::function<void(const fsStr&)> mFinalise;
};

#endif