author | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-09-27 11:29:26 (UTC) |
commit | 651b6c612db4e809c506973996f2580c4158ac3a (patch) (side-by-side diff) | |
tree | 8c8edc86e4b206dd4542a6b556ad1a319d6698ab /inputmethods/dasher/DasherWidgetInterface.h | |
parent | d1a11b45e805fe7771ea05944757d767c3c4c8ea (diff) | |
download | opie-651b6c612db4e809c506973996f2580c4158ac3a.zip opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.gz opie-651b6c612db4e809c506973996f2580c4158ac3a.tar.bz2 |
merge dasher which has been introduced in BRANCH first (wtf?) into HEAD
Diffstat (limited to 'inputmethods/dasher/DasherWidgetInterface.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/dasher/DasherWidgetInterface.h | 93 |
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 @@ +// DasherWidgetInterface.h +// +///////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) 2002 Iain Murray +// +///////////////////////////////////////////////////////////////////////////// + +#ifndef __DasherWidgetInterface_h__ +#define __DasherWidgetInterface_h__ + + +#include "DasherTypes.h" +#include <string> + +namespace Dasher {class CDasherWidgetInterface;} +class Dasher::CDasherWidgetInterface +{ +public: + //! Signal to the core that the model should be started + // + //! Call this function before providing input coordinates and whenever + //! reinitialising Dasher + virtual void Start()=0; + + // Times in milliseconds are required so Dasher runs at the correct speed. + //! Signal an input location + // + //! Signal an input event. This may be the current location of the + //! mouse or a stylus tap, for example + //! \param MouseX The mouse X coordinate, in screen coordinates + //! \param MouseY The mouse Y coordinate, in screen coordinates + //! \param Time Time in milliseconds, required to keep Dasher running + //! at the correct speed + virtual void TapOn(int MouseX, int MouseY, unsigned long Time)=0; + + //! Signal an input event and pause the simulation + virtual void PauseAt(int MouseX, int MouseY)=0; + + //! Unpause the simulation. + // + //! \param Time should be in milliscones and should be consistent with + //! previous time values + virtual void Unpause(unsigned long Time)=0; + + //! Signal that the core should redraw the screen + virtual void Redraw()=0; + + // The widgets need to tell the engine when they have been affected + // by external interaction + + //! Signal the core that a change has occured to the screen. (Unneeded) + virtual void ChangeScreen()=0; + + //! Signal the core that a change has occued to the editbox. (Unneeded) + virtual void ChangeEdit()=0; + + // These are needed so widgets know how to render the alphabet. + // All strings are encoded in UTF-8. + + //! Request the number of symbols in the current alphabet + virtual unsigned int GetNumberSymbols()=0; + + //! Request the text that should be displayed on the Dasher canvas + // + //! Note - the returned string is in UTF-8 encoding. + //! \param Symbol the symbol that is to be displayed + virtual const std::string& GetDisplayText(Dasher::symbol Symbol)=0; + + //! Request the text that should be entered into the edit box + // + //! Note - the returned string is in UTF-8 encoding. + //! \param Symbol the symbol that is to be displayed + virtual const std::string& GetEditText(Dasher::symbol Symbol)=0; + + //! Request the foreground colour for the text to be drawn on the canvas + //! \param Symbol the symbol that is to be displayed + virtual int GetTextColour(Dasher::symbol Symbol)=0; + + //! Request the default screen orientation for the current alphabet + // + //! (Eg, left to right for English, right to left for Hebrew) + virtual Opts::ScreenOrientations GetAlphabetOrientation()=0; + + //! Returns the codepage for the current alphabet + virtual Opts::AlphabetTypes GetAlphabetType()=0; + + //! Provides a fully qualified path to the training file for the alphabet + virtual const std::string& GetTrainFile()=0; // Returns a fully-qualified path to file: + // UserLocation + TrainFile +}; + +#endif /* #ifndef __DasherWidgetInterface_h__ */ |