summaryrefslogtreecommitdiff
path: root/inputmethods/dasher/DasherWidgetInterface.h
Unidiff
Diffstat (limited to 'inputmethods/dasher/DasherWidgetInterface.h') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/DasherWidgetInterface.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/inputmethods/dasher/DasherWidgetInterface.h b/inputmethods/dasher/DasherWidgetInterface.h
new file mode 100644
index 0000000..5a1387e
--- a/dev/null
+++ b/inputmethods/dasher/DasherWidgetInterface.h
@@ -0,0 +1,93 @@
1// DasherWidgetInterface.h
2//
3/////////////////////////////////////////////////////////////////////////////
4//
5// Copyright (c) 2002 Iain Murray
6//
7/////////////////////////////////////////////////////////////////////////////
8
9#ifndef __DasherWidgetInterface_h__
10#define __DasherWidgetInterface_h__
11
12
13#include "DasherTypes.h"
14#include <string>
15
16namespace Dasher {class CDasherWidgetInterface;}
17class Dasher::CDasherWidgetInterface
18{
19public:
20 //! Signal to the core that the model should be started
21 //
22 //! Call this function before providing input coordinates and whenever
23 //! reinitialising Dasher
24 virtual void Start()=0;
25
26 // Times in milliseconds are required so Dasher runs at the correct speed.
27 //! Signal an input location
28 //
29 //! Signal an input event. This may be the current location of the
30 //! mouse or a stylus tap, for example
31 //! \param MouseX The mouse X coordinate, in screen coordinates
32 //! \param MouseY The mouse Y coordinate, in screen coordinates
33 //! \param Time Time in milliseconds, required to keep Dasher running
34 //! at the correct speed
35 virtual void TapOn(int MouseX, int MouseY, unsigned long Time)=0;
36
37 //! Signal an input event and pause the simulation
38 virtual void PauseAt(int MouseX, int MouseY)=0;
39
40 //! Unpause the simulation.
41 //
42 //! \param Time should be in milliscones and should be consistent with
43 //! previous time values
44 virtual void Unpause(unsigned long Time)=0;
45
46 //! Signal that the core should redraw the screen
47 virtual void Redraw()=0;
48
49 // The widgets need to tell the engine when they have been affected
50 // by external interaction
51
52 //! Signal the core that a change has occured to the screen. (Unneeded)
53 virtual void ChangeScreen()=0;
54
55 //! Signal the core that a change has occued to the editbox. (Unneeded)
56 virtual void ChangeEdit()=0;
57
58 // These are needed so widgets know how to render the alphabet.
59 // All strings are encoded in UTF-8.
60
61 //! Request the number of symbols in the current alphabet
62 virtual unsigned int GetNumberSymbols()=0;
63
64 //! Request the text that should be displayed on the Dasher canvas
65 //
66 //! Note - the returned string is in UTF-8 encoding.
67 //! \param Symbol the symbol that is to be displayed
68 virtual const std::string& GetDisplayText(Dasher::symbol Symbol)=0;
69
70 //! Request the text that should be entered into the edit box
71 //
72 //! Note - the returned string is in UTF-8 encoding.
73 //! \param Symbol the symbol that is to be displayed
74 virtual const std::string& GetEditText(Dasher::symbol Symbol)=0;
75
76 //! Request the foreground colour for the text to be drawn on the canvas
77 //! \param Symbol the symbol that is to be displayed
78 virtual int GetTextColour(Dasher::symbol Symbol)=0;
79
80 //! Request the default screen orientation for the current alphabet
81 //
82 //! (Eg, left to right for English, right to left for Hebrew)
83 virtual Opts::ScreenOrientations GetAlphabetOrientation()=0;
84
85 //! Returns the codepage for the current alphabet
86 virtual Opts::AlphabetTypes GetAlphabetType()=0;
87
88 //! Provides a fully qualified path to the training file for the alphabet
89 virtual const std::string& GetTrainFile()=0; // Returns a fully-qualified path to file:
90 // UserLocation + TrainFile
91};
92
93#endif /* #ifndef __DasherWidgetInterface_h__ */