Class InputAPI

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class InputAPI

Summary
Public Methods
static bool response(device, xid, text)
static bool chat(device, text)
static bool cmd(device, cmd)
static bool key(device, key)
static bool click(device)
static bool mouse(device, direction, x, y, action, cbdata)
static bool hotspot(device, action, cbdata)
static bool upload(device, fileclass, filetype, imagelibid, xid)
static bool refresh(device)
static bool select(device, value)
static bool online(device, appparams)
static bool withdraw(device)
static bool timeout(device)
static bool send(request, params)

#include <InputAPI.h >

Summary

This class is used by other apps to send messages to the input channel.

Use this interface instead of sending messages directly to ensure message keywords are spelled correctly, all parameters are specified, and error checked.

The receiving app defined this interface to ensure it receives the messages correctly.

Public Methods

static bool response(device, xid, text)

const UserDevice& device

the end-user's device

const string& xid

the transaction id (GuiXact id) that guibroker assigned to the prompt

const string& text

the user response text


The user has responded and input control that is now transmitting the use's response back; relay it to the appropriate application.  Input controls include prompt boxes, pull down selectors, check boxes, textareas, etc.

Return value: true if sent successfully

static bool chat(device, text)

const UserDevice& device

the end-user's device

const string& text

the chat message


The user is sending a chat line.  Relay it to the app that handles chat.

Return value: true if sent successfully

static bool cmd(device, cmd)

const UserDevice& device

the end-user's device

const string& cmd

the action that becomes a message to appropriate app


The user has pushed a button to trigger a command

Return value: true if sent successfully

static bool key(device, key)

const UserDevice& device

the end-user's device

const string& key

the ASCII value of the key; if it leads with 0, then it's a special key


The user has pressed a keystroke.

Return value: true if sent successfully

static bool click(device)

const UserDevice& device

the end-user's device


The user has clicked on an area/region (which is implicit in UserDevice)

Return value: true if sent successfully

static bool mouse(device, direction, x, y, action, cbdata)

const UserDevice& device

the end-user's device

const string& direction

the direction of the mouse click, e.g. up, down

float x

the lower left of the image is (0,0); this is the x offset from there

float y

the lower left of the image is (0,0); this is the x offset from there

const string& action

the keyword action for the callback to the app

const XMLData& cbdata

the callback data for the app


The user has pressed or released the mouse inside an image at a point

Return value: true if sent successfully

static bool hotspot(device, action, cbdata)

const UserDevice& device

the end-user's device

const string& action

the keyword action for the callback to the app

const XMLData& cbdata

the callback data for the app


The user has activated a hotspot

Return value: true if sent successfully

static bool upload(device, fileclass, filetype, imagelibid, xid)

const UserDevice& device

the end-user's device

const string& fileclass

the provided class of the file

const string& filetype

the type of file, e.g. svg, html, etc

DbRecNum imagelibid

ImageLib idthe transaction id (GuiXact id) that guibroker assigned to the prompt

DbRecNum xid

the transaction id (GuiXact id) that guibroker assigned to the prompt


The user has uploaded a file.

Return value: true if sent successfully

static bool refresh(device)

const UserDevice& device

the end-user's device


We are getting a redraw request for the UI.

Return value: true if sent successfully

static bool select(device, value)

const UserDevice& device

the end-user's device

const string& value

selected value


The user has selected something from a list.  This is the key from that list.

Return value: true if sent successfully

static bool online(device, appparams)

const UserDevice& device

the end-user's device

const XMLData& appparams

any parameters associated with this user going -online, to relay to app


The user has activated his/her display and is now on-line.

Return value: true if sent successfully

static bool withdraw(device)

const UserDevice& device

the end-user's device


The user has disconnected or gone off-line

Return value: true if sent successfully

static bool timeout(device)

const UserDevice& device

the end-user's device


The user has disappeared (connection idle)

Return value: true if sent successfully

static bool send(request, params)

const string& request

the request keyword

const XMLData& params

the data (parameter payload)

Default value: XMLData("")


Send an API message to channel input.