> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/gui_8h_source.md).

# gui.h

[Go to the documentation of this file.](/adk-5.0-programmers-guide/readme/files/dir_9225c15707e5fd27b700c844799f6dc5/dir_7447c8e6446ba60664134d106c4ecb69/dir_8c13e55433a2f6247a8b0f337ff26c19/gui_8h.md)

```cpp
 1 // -*- Mode: C++; -*-
 2 #ifndef GUI_H_2013_03_14
 3 #define GUI_H_2013_03_14
 4 
 10 #include <stdarg.h>
 11 #include <pthread.h>
 12 #include "jsobject.h"
 13 #include "timestamp.h"
 14 #include "gui_error.h"
 15 #include "types.h"
 16 
 17 #if defined _WIN32 && defined VFI_GUIPRT_SHARED_EXPORT
 18 # define DllSpec __declspec(dllexport)
 19 #elif defined __GNUC__ && defined VFI_GUIPRT_SHARED_EXPORT
 20 # define DllSpec __attribute__((visibility ("default")))
 21 #else
 22 # define DllSpec
 23 #endif
 24 
 26 #ifndef DOXYGEN
 27 namespace vfigui {
 28 #endif
 29 #if 0
 30 } // just to satisfy automatic indentation of the editor
 31 #endif
 32 
 33 using namespace vfihtml; // import common interfaces
 34 
 51 typedef bool (*uiCallback)(void *data);
 52 
 54 enum UICBType { UI_CB_RESULT,
 55  UI_CB_UPDATE,
 56  UI_CB_LOAD,
 57  UI_CB_ERROR_LIST,
 58  UI_CB_STATISTICS,
 59  UI_CB_EVENT
 60 };
 61 
 62 struct UIErrorEntry;
 63 struct UIStatistics;
 64 
 66 class UICBData {
 67  public:
 68 
 70  virtual ~UICBData() {}
 71 
 73  virtual int &result()=0;
 74 
 76  virtual int txn_id()=0;
 77 
 79  virtual stringmap &value()=0;
 80 
 83  virtual std::string &url()=0;
 84 
 86  virtual std::vector<UIErrorEntry> &error()=0;
 87 
 89  virtual std::string &script_error()=0;
 90 
 92  virtual UIStatistics &statistics()=0;
 93 
 94 };
 95 
 96 
 106 typedef void (*uiAsyncCallback)(void *data, UICBType type, UICBData &uidata);
 107 
 110 struct UIRegion {
 111  int id;
 112  int left;
 113  int top;
 114  int right;
 115  int bottom;
 116  int flags;
 117 };
 118 
 119 enum { UI_REGION_DEFAULT=0
 120 };
 121 
 122 enum {
 123  UI_REGION_FLAG_HIDDEN=1
 125 };
 126 
 127 
 132 DllSpec void uiSetConnectAttempts(int num);
 133 
 137 DllSpec int uiGetConnectAttempts();
 138 
 144 typedef void (*uiDisconnectCallback)(int display);
 145 
 151 DllSpec void uiSetDisconnectCallback(uiDisconnectCallback cb);
 152 
 156 DllSpec uiDisconnectCallback uiGetDisconnectCallback();
 157 
 164 DllSpec void uiSetKeepalive(int count, int interval);
 165 
 170 DllSpec void uiGetKeepalive(int &count, int &interval);
 171 
 176 DllSpec void uiDisconnect(int display);
 177 
 185 DllSpec int uiReadRuntimeID(int display, std::string &id, int timeout_msec=5000);
 186 
 195 DllSpec std::string uiPrint(const char *format, ...);
 196 
 199 DllSpec std::string uiPrintV(const char *format, va_list va);
 200 
 201 
 205 DllSpec int uiDisplayCount();
 206 
 207 
 215 DllSpec int uiDisplay(int display, int region_id, const std::string &text);
 216 
 217 DllSpec int uiDisplay(int region_id, const std::string &text);
 218 
 219 inline int uiDisplay(const std::string &text) { return uiDisplay(0,UI_REGION_DEFAULT,text); }
 220 
 221 
 233 DllSpec int uiInvoke(int display, int region_id, stringmap &value, const std::string &text, uiCallback cb=0, void *cbdata=0);
 234 
 235 DllSpec int uiInvoke(int region_id, stringmap &value, const std::string &text, uiCallback cb=0, void *cbdata=0);
 236 
 237 inline int uiInvoke(stringmap &value, const std::string &text, uiCallback cb=0, void *cbdata=0)
 238 { return uiInvoke(0,UI_REGION_DEFAULT,value,text,cb,cbdata); }
 239 
 240 inline int uiInvoke(int display, int region_id, const std::string &text, uiCallback cb=0, void *cbdata=0)
 241 { stringmap value; return uiInvoke(display, region_id,value,text,cb,cbdata); }
 242 
 243 inline int uiInvoke(int region_id, const std::string &text, uiCallback cb=0, void *cbdata=0)
 244 { stringmap value; return uiInvoke(0,region_id,value,text,cb,cbdata); }
 245 
 246 inline int uiInvoke(const std::string &text, uiCallback cb=0, void *cbdata=0)
 247 { stringmap value; return uiInvoke(0,UI_REGION_DEFAULT,value,text,cb,cbdata); }
 248 
 261 DllSpec int uiInvokeTemplate(int display, int region_id, stringmap &value, const std::string &template_name, const std::string &text, uiCallback cb=0, void *cbdata=0);
 262 
 263 DllSpec int uiInvokeTemplate(int region_id, stringmap &value, const std::string &template_name, const std::string &text, uiCallback cb=0, void *cbdata=0);
 264 
 265 inline int uiInvokeTemplate(stringmap &value, const std::string &template_name, const std::string &text, uiCallback cb=0, void *cbdata=0)
 266 { return uiInvokeTemplate(0,UI_REGION_DEFAULT,value,template_name,text,cb,cbdata); }
 267 
 268 inline int uiInvokeTemplate(int display, int region_id, const std::string &template_name, const std::string &text, uiCallback cb=0, void *cbdata=0)
 269 { stringmap value; return uiInvokeTemplate(display,region_id,value,template_name,text,cb,cbdata); }
 270 
 271 inline int uiInvokeTemplate(int region_id, const std::string &template_name, const std::string &text, uiCallback cb=0, void *cbdata=0)
 272 { stringmap value; return uiInvokeTemplate(0,region_id,value,template_name,text,cb,cbdata); }
 273 
 274 inline int uiInvokeTemplate(const std::string &template_name, const std::string &text, uiCallback cb=0, void *cbdata=0)
 275 { stringmap value; return uiInvokeTemplate(0,UI_REGION_DEFAULT,value,template_name,text,cb,cbdata); }
 276 
 277 
 290 DllSpec int uiInvokeURL(int display, int region_id, stringmap &value, const char *url, uiCallback cb=0, void *cbdata=0);
 291 
 293 DllSpec int uiInvokeURL(int region_id, stringmap &value, const char *url, uiCallback cb=0, void *cbdata=0);
 294 
 296 inline int uiInvokeURL(stringmap &value, const char *url, uiCallback cb=0, void *cbdata=0)
 297 { return uiInvokeURL(0,UI_REGION_DEFAULT,value,url,cb,cbdata); }
 298 
 300 inline int uiInvokeURL(int display, int region_id, const char *url, uiCallback cb=0, void *cbdata=0)
 301 { stringmap value; return uiInvokeURL(display, region_id,value,url,cb,cbdata); }
 302 
 304 inline int uiInvokeURL(int region_id, const char *url, uiCallback cb=0, void *cbdata=0)
 305 { stringmap value; return uiInvokeURL(0,region_id,value,url,cb,cbdata); }
 306 
 308 inline int uiInvokeURL(const char *url, uiCallback cb=0, void *cbdata=0)
 309 { stringmap value; return uiInvokeURL(0,UI_REGION_DEFAULT,value,url,cb,cbdata); }
 310 
 311 
 324 DllSpec int uiInvokeURL(int display, int region_id, stringmap &value, const std::string &url, uiCallback cb=0, void *cbdata=0);
 325 
 327 inline int uiInvokeURL(int region_id, stringmap &value, const std::string &url, uiCallback cb=0, void *cbdata=0)
 328 { return uiInvokeURL(0,region_id,value,url,cb,cbdata); }
 329 
 331 inline int uiInvokeURL(stringmap &value, const std::string &url, uiCallback cb=0, void *cbdata=0)
 332 { return uiInvokeURL(0,UI_REGION_DEFAULT,value,url,cb,cbdata); }
 333 
 335 inline int uiInvokeURL(int display, int region_id, const std::string &url, uiCallback cb=0, void *cbdata=0)
 336 { stringmap value; return uiInvokeURL(display,region_id,value,url,cb,cbdata); }
 337 
 339 inline int uiInvokeURL(int region_id, const std::string &url, uiCallback cb=0, void *cbdata=0)
 340 { stringmap value; return uiInvokeURL(0,region_id,value,url,cb,cbdata); }
 341 
 343 inline int uiInvokeURL(const std::string &url, uiCallback cb=0, void *cbdata=0)
 344 { stringmap value; return uiInvokeURL(0,UI_REGION_DEFAULT, value,url,cb,cbdata); }
 345 
 346 
 359 DllSpec int uiInvokeAsync(int display, int region_id, const stringmap &value, const std::string &text, uiAsyncCallback cb=0, void *data=0);
 360 
 362 DllSpec int uiInvokeAsync(int region_id, const stringmap &value, const std::string &text, uiAsyncCallback cb=0, void *data=0);
 363 
 365 inline int uiInvokeAsync(const stringmap &value, const std::string &text, uiAsyncCallback cb=0, void *data=0)
 366 { return uiInvokeAsync(0,UI_REGION_DEFAULT, value, text,cb,data); }
 367 
 369 inline int uiInvokeAsync(int display, int region_id, const std::string &text, uiAsyncCallback cb=0, void *data=0)
 370 { stringmap value; return uiInvokeAsync(display, region_id,value,text,cb,data); }
 371 
 373 inline int uiInvokeAsync(int region_id, const std::string &text, uiAsyncCallback cb=0, void *data=0)
 374 { stringmap value; return uiInvokeAsync(0,region_id,value,text,cb,data); }
 375 
 377 inline int uiInvokeAsync(const std::string &text, uiAsyncCallback cb=0, void *data=0)
 378 { stringmap value; return uiInvokeAsync(0,UI_REGION_DEFAULT, value, text,cb,data); }
 379 
 393 DllSpec int uiInvokeTemplateAsync(int display, int region_id, const stringmap &value, const std::string &template_name, const std::string &text, uiAsyncCallback cb=0, void *data=0);
 394 
 396 DllSpec int uiInvokeTemplateAsync(int region_id, const stringmap &value, const std::string &template_name, const std::string &text, uiAsyncCallback cb=0, void *data=0);
 397 
 399 inline int uiInvokeTemplateAsync(const stringmap &value, const std::string &template_name, const std::string &text, uiAsyncCallback cb=0, void *data=0)
 400 { return uiInvokeTemplateAsync(0, UI_REGION_DEFAULT, value, template_name, text, cb,data); }
 401 
 403 inline int uiInvokeTemplateAsync(int display, int region_id, const std::string &template_name, const std::string &text, uiAsyncCallback cb=0, void *data=0)
 404 { stringmap value; return uiInvokeTemplateAsync(display,region_id,value,template_name,text, cb,data); }
 405 
 407 inline int uiInvokeTemplateAsync(int region_id, const std::string &template_name, const std::string &text, uiAsyncCallback cb=0, void *data=0)
 408 { stringmap value; return uiInvokeTemplateAsync(0,region_id,value,template_name,text, cb,data); }
 409 
 411 inline int uiInvokeTemplateAsync(const std::string &template_name, const std::string &text, uiAsyncCallback cb=0, void *data=0)
 412 { stringmap value; return uiInvokeTemplateAsync(0,UI_REGION_DEFAULT, value, template_name, text, cb,data); }
 413 
 414 
 428 DllSpec int uiInvokeURLAsync(int display, int region_id, const stringmap &value, const char *url, uiAsyncCallback cb=0, void *data=0);
 429 
 431 DllSpec int uiInvokeURLAsync(int region_id, const stringmap &value, const char *url, uiAsyncCallback cb=0, void *data=0);
 432 
 434 inline int uiInvokeURLAsync(const stringmap &value, const char *url, uiAsyncCallback cb=0, void *data=0)
 435 { return uiInvokeURLAsync(0, UI_REGION_DEFAULT, value, url,cb,data); }
 436 
 438 inline int uiInvokeURLAsync(int display, int region_id,const char *url, uiAsyncCallback cb=0, void *data=0)
 439 { stringmap value; return uiInvokeURLAsync(display, region_id,value,url,cb,data); }
 440 
 442 inline int uiInvokeURLAsync(int region_id,const char *url, uiAsyncCallback cb=0, void *data=0)
 443 { stringmap value; return uiInvokeURLAsync(0,region_id,value,url,cb,data); }
 444 
 446 inline int uiInvokeURLAsync(const char *url, uiAsyncCallback cb=0, void *data=0)
 447 { stringmap value; return uiInvokeURLAsync(0, UI_REGION_DEFAULT, value, url,cb,data); }
 448 
 449 
 463 DllSpec int uiInvokeURLAsync(int display, int region_id, const stringmap &value, const std::string &url, uiAsyncCallback cb=0, void *data=0);
 464 
 466 inline int uiInvokeURLAsync(int region_id, const stringmap &value, const std::string &url, uiAsyncCallback cb=0, void *data=0)
 467 { return uiInvokeURLAsync(0, region_id, value, url,cb,data); }
 468 
 470 inline int uiInvokeURLAsync(const stringmap &value, const std::string &url, uiAsyncCallback cb=0, void *data=0)
 471 { return uiInvokeURLAsync(0, UI_REGION_DEFAULT, value, url,cb,data); }
 472 
 474 inline int uiInvokeURLAsync(int display, int region_id,const std::string &url, uiAsyncCallback cb=0, void *data=0)
 475 { stringmap value; return uiInvokeURLAsync(display, region_id,value,url,cb,data); }
 476 
 478 inline int uiInvokeURLAsync(int region_id,const std::string &url, uiAsyncCallback cb=0, void *data=0)
 479 { stringmap value; return uiInvokeURLAsync(0,region_id,value,url,cb,data); }
 480 
 482 inline int uiInvokeURLAsync(const std::string &url, uiAsyncCallback cb=0, void *data=0)
 483 { stringmap value; return uiInvokeURLAsync(0, UI_REGION_DEFAULT, value, url,cb,data); }
 484 
 485 
 497 DllSpec int uiInvokeWait(int txn_id, std::map<std::string,std::string> &value, int timeout_msec=-1);
 498 
 499 
 501 inline int uiInvokeWait(int txn_id, int timeout_msec=-1)
 502 {
 503  std::map<std::string,std::string> value;
 504  return uiInvokeWait(txn_id,value,timeout_msec);
 505 }
 506 
 516 DllSpec int uiInvokeCancel(int txn_id, std::map<std::string,std::string> &value);
 517 
 519 inline int uiInvokeCancel(int txn_id)
 520 {
 521  std::map<std::string,std::string> value;
 522  return uiInvokeCancel(txn_id,value);
 523 }
 524 
 528 DllSpec int uiInvokeCancelAsync(int txn_id);
 529 
 540 DllSpec int uiInvokeURLDetached(int display, int region_id, const char *url);
 541 
 543 DllSpec int uiInvokeURLDetached(int region_id, const char *url);
 544 
 546 inline int uiInvokeURLDetached(const char *url)
 547 { return uiInvokeURLDetached(0, UI_REGION_DEFAULT,url); }
 548 
 549 
 556 DllSpec int uiClear(int display, int region_id);
 557 
 559 inline int uiClear(int region_id) { return uiClear(0,region_id); }
 560 
 562 enum UIPropertyInt {
 563  UI_PROP_TIMEOUT=0,
 564  UI_PROP_PASSWORD_CHAR,
 565  UI_PROP_DEFAULT_FONT_SIZE,
 566  UI_PROP_PIN_AUTO_ENTER,
 567  UI_PROP_PIN_CLEAR_ALL,
 568  UI_PROP_PIN_BYPASS_KEY,
 573  UI_PROP_PIN_ALGORITHM,
 575  UI_PROP_PIN_INTERCHAR_TIMEOUT,
 576  UI_PROP_PASSWORD_SHOW_CHAR,
 577  UI_PROP_KEEP_DISPLAY,
 580  UI_PROP_UPDATE_EVENTS,
 582  UI_PROP_CIRCULAR_MENU,
 584  UI_PROP_TOUCH_ACTION_BEEP,
 586  UI_PROP_STATISTICS,
 587  UI_PROP_RESTRICTED,
 588  UI_PROP_CP_APP_MODE,
 589  UI_PROP_SCROLL_COLOR,
 590  UI_PROP_INPUT_ERROR_BEEP,
 593  UI_PROP_ZOOM_MAX,
 594  UI_PROP_SCROLL_DISPLAY,
 596  UI_PROP_JS_QUOTA_SIZE,
 598  UI_PROP_SCROLL_WIDTH,
 600  UI_PROP_LONG_PRESS,
 601  UI_PROP_LONG_IMMEDIATE,
 602  UI_PROP_OVERFLOW_EXT,
 606  // Readonly properties
 607  UI_DEVICE_WIDTH=1000,
 608  UI_DEVICE_HEIGHT,
 609  UI_DEVICE_COLOR_DEPTH,
 610  UI_DEVICE_SUPPORTS_TOUCH,
 611  UI_DEVICE_SUPPORTS_BEEPER, // not supported, do not use. Left here for compatibility reasons.
 612  UI_DEVICE_SUPPORTS_AUDIO,
 613  UI_DEVICE_SUPPORTS_VIDEO,
 614  UI_DEVICE_SUPPORTS_SIGCAP,
 615  UI_DEVICE_SUPPORTS_COLOR_DISPLAY,
 616  UI_DEVICE_HAS_CAP_TOUCH_KEYPAD,
 617  UI_DEVICE_SUPPORTS_NAVIGATOR_MODE,
 618  UI_DEVICE_KEY_COUNT
 619 };
 620 
 622 enum UIPropertyString {
 623  UI_PROP_DECIMAL_SEPARATOR=2000,
 624  UI_PROP_THOUSANDS_SEPARATOR,
 625  UI_PROP_DEFAULT_FONT,
 626  UI_PROP_RESOURCE_PATH,
 627  UI_PROP_FILE_PREFIX,
 629  UI_PROP_KEYMAP,
 630  UI_PROP_CSS,
 631  UI_PROP_RESOURCE_DEFAULT_PATH,
 632  UI_PROP_GUI_EXTENSIONS,
 633  UI_PROP_HTTP_HEADER_FIELDS,
 635  UI_PROP_CP_APP_DIR,
 637  UI_PROP_LANGUAGE,
 645  UI_PROP_JS_ROOT,
 648  UI_PROP_PRINT_ROOT,
 650  UI_PROP_PRINT_CSS,
 652  UI_PROP_JS_QUOTA_ROOT,
 654  // Readonly properties
 655  UI_DEVICE_MODEL=3000
 656 };
 657 
 665 DllSpec int uiSetPropertyInt(int display, enum UIPropertyInt property, int value);
 666 
 668 DllSpec int uiSetPropertyInt(enum UIPropertyInt property, int value);
 669 
 677 DllSpec int uiGetPropertyInt(int display, enum UIPropertyInt property, int *value);
 678 
 680 DllSpec int uiGetPropertyInt(enum UIPropertyInt property, int *value);
 681 
 689 DllSpec int uiSetPropertyString(int display, enum UIPropertyString property, const char *value);
 690 
 692 DllSpec int uiSetPropertyString(enum UIPropertyString property, const char *value);
 693 
 701 inline int uiSetPropertyString(int display, enum UIPropertyString property, const std::string &value)
 702 { return uiSetPropertyString(display,property,value.c_str()); }
 703 
 705 inline int uiSetPropertyString(enum UIPropertyString property, const std::string &value)
 706 { return uiSetPropertyString(0,property,value.c_str()); }
 707 
 716 DllSpec int uiGetPropertyString(int display, enum UIPropertyString property, char* value, int len);
 717 
 719 DllSpec int uiGetPropertyString(enum UIPropertyString property, char* value, int len);
 720 
 728 DllSpec int uiGetPropertyString(int display, enum UIPropertyString property, std::string &value);
 729 
 731 DllSpec int uiGetPropertyString(enum UIPropertyString property, std::string &value);
 732 
 733 
 735 enum UIServerProperty {
 736  UI_SERVER_TOUCH_ACTION_BEEP,
 739  UI_SERVER_INPUT_ERROR_BEEP,
 742  UI_SERVER_KEYMAP,
 744 };
 745 
 752 DllSpec int uiSetServerProperty(int display, enum UIServerProperty property, const std::string &value);
 753 
 760 DllSpec int uiGetServerProperty(int display, enum UIServerProperty property, std::string &value);
 761 
 769 DllSpec std::string uiGetTerminalResourceDir(int display, const std::string &www_path);
 770 
 772 DllSpec std::string uiGetTerminalResourceDir(const std::string &www_path);
 773 
 776 DllSpec std::string uiGetKeypadType(int display);
 777 
 783 DllSpec void uiSetLocalProperties(bool local);
 784 
 786 DllSpec bool uiGetLocalProperties();
 787 
 801 DllSpec int uiLayout(int display, const UIRegion *region, int regcnt, const UIRegion *oldreg, int oldregcnt);
 802 
 804 DllSpec int uiLayout(const UIRegion *region, int regcnt, const UIRegion *oldreg, int oldregcnt);
 805 
 807 DllSpec int uiLayout(int display, const UIRegion *region, int regcnt);
 808 
 810 DllSpec int uiLayout(const UIRegion *region, int regcnt);
 811 
 819 inline int uiLayout(int display, const std::vector<UIRegion> &reg) {
 820  UIRegion dummy;
 821  return uiLayout(display, reg.size() ? &reg[0] : &dummy,reg.size());
 822 }
 823 
 825 inline int uiLayout(const std::vector<UIRegion> &reg) {
 826  UIRegion dummy;
 827  return uiLayout(0, reg.size() ? &reg[0] : &dummy,reg.size());
 828 }
 829 
 840 inline int uiLayout(int display, const std::vector<UIRegion> &reg, const std::vector<UIRegion> &oldreg)
 841 {
 842  UIRegion dummy;
 843  return uiLayout(display, reg.size() ? &reg[0] : &dummy,reg.size(), oldreg.size() ? &oldreg[0] : &dummy, oldreg.size());
 844 }
 845 
 847 inline int uiLayout(const std::vector<UIRegion> &reg, const std::vector<UIRegion> &oldreg)
 848 {
 849  UIRegion dummy;
 850  return uiLayout(0,reg.size() ? &reg[0] : &dummy,reg.size(), oldreg.size() ? &oldreg[0] : &dummy, oldreg.size());
 851 }
 852 
 860 DllSpec int uiLayout(int display, const char *name);
 861 
 863 DllSpec int uiLayout(const char *name);
 864 
 871 DllSpec int uiGetLayout(int display, std::vector<UIRegion> &region);
 872 
 874 DllSpec int uiGetLayout(std::vector<UIRegion> &region);
 875 
 883 DllSpec int uiGetRegionSize(int display, int region_id, int &width, int &height);
 884 
 886 inline int uiGetRegionSize(int region_id, int &width, int &height)
 887 {
 888  return uiGetRegionSize(0,region_id,width,height);
 889 }
 890 
 899 DllSpec int uiEnterRegion(int display, int region_id);
 900 
 902 DllSpec int uiEnterRegion(int region_id);
 903 
 908 DllSpec int uiLeaveRegion(int display);
 909 
 911 DllSpec int uiLeaveRegion();
 912 
 921 DllSpec std::string uiCurrentRegionPath(int display);
 922 
 924 DllSpec std::string uiCurrentRegionPath();
 925 
 932 DllSpec int uiSetCurrentRegionPath(int display, const std::string &path);
 933 
 935 DllSpec int uiSetCurrentRegionPath(const std::string &path);
 936 
 937 
 943 DllSpec int uiRegionIsVisible(int display, int region_id);
 944 
 949 inline int uiRegionIsVisible(int region_id)
 950 {return uiRegionIsVisible(0,region_id); }
 951 
 952 
 961 DllSpec void uiReadConfig(int display);
 962 
 964 DllSpec void uiReadConfig();
 965 
 966 
 975 DllSpec int uiSetCatalog(int display, const std::string &filename);
 976 
 978 DllSpec int uiSetCatalog(const std::string &filename);
 979 
 985 DllSpec std::string uiGetCatalog(int display);
 986 
 988 DllSpec std::string uiGetCatalog();
 989 
 997 DllSpec void uiCatalogSetDelayedRelease(unsigned num);
 998 
 1004 DllSpec unsigned uiCatalogGetDelayedRelease();
 1005 
 1006 
 1015 DllSpec std::string uiGetText(int display, const std::string &name, const std::string &deflt="");
 1016 
 1018 DllSpec std::string uiGetText(const std::string &name, const std::string &deflt="");
 1019 
 1036 DllSpec std::string uiGetText(int display, const std::string &filename, const std::string &name, const std::string &deflt);
 1037 
 1039 DllSpec std::string uiGetText(const std::string &filename, const std::string &name, const std::string &deflt);
 1040 
 1050 DllSpec int uiGetHtml(int display, const std::map<std::string,std::string> &value, const std::string &text, std::string &html);
 1051 
 1053 DllSpec int uiGetHtml(const std::map<std::string,std::string> &value, const std::string &text, std::string &html);
 1054 
 1065 DllSpec int uiGetHtmlURL(int display, const std::map<std::string,std::string> &value, const std::string &url, std::string &html);
 1066 
 1068 DllSpec int uiGetHtmlURL(const std::map<std::string,std::string> &value, const std::string &url, std::string &html);
 1069 
 1070 
 1078 DllSpec std::string uiGetURLPath(int display, const std::string &url);
 1079 
 1081 DllSpec std::string uiGetURLPath(const std::string &url);
 1082 
 1083 
 1091 DllSpec int uiScreenshotPNG(int display, const char *filename);
 1092 
 1094 DllSpec int uiScreenshotPNG(const char *filename);
 1095 
 1108 DllSpec int uiScreenshotPNG(int display, const char *filename, int x, int y, int w, int h);
 1109 
 1111 inline int uiScreenshotPNG(const char *filename, int x, int y, int w, int h)
 1112 {
 1113  return uiScreenshotPNG(0,filename,x,y,w,h);
 1114 }
 1115 
 1116 
 1124 DllSpec int uiScreenshotPNGData(int display, std::vector<unsigned char> &data);
 1125 
 1127 DllSpec int uiScreenshotPNGData(std::vector<unsigned char> &data);
 1128 
 1141 DllSpec int uiScreenshotPNGData(int display, std::vector<unsigned char> &data, int x, int y, int w, int h);
 1142 
 1144 inline int uiScreenshotPNGData(std::vector<unsigned char> &data, int x, int y, int w, int h)
 1145 {
 1146  return uiScreenshotPNGData(0,data,x,y,w,h);
 1147 }
 1148 
 1149 
 1160 DllSpec int uiURL2PNG(const char *filename, int width, int height, const std::map<std::string,std::string> &value, const std::string &url);
 1161 
 1172 DllSpec int uiURL2PNGData(std::vector<unsigned char> &data, int width, int height, const std::map<std::string,std::string> &value, const std::string &url);
 1173 
 1183 DllSpec int uiHTML2PNG(const char *filename, int width, int height, const std::map<std::string,std::string> &value, const std::string &text);
 1184 
 1194 DllSpec int uiHTML2PNGData(std::vector<unsigned char> &data, int width, int height, const std::map<std::string,std::string> &value, const std::string &text);
 1195 
 1199 DllSpec const char *uiLibVersion();
 1200 
 1204 DllSpec const char *gui_GetVersion();
 1205 
 1206 
 1211 DllSpec const char *gui_GetSvcVersion(int display);
 1212 DllSpec const char *gui_GetSvcVersion();
 1213 
 1215 enum {
 1216  // lowest 4 bits: direction flags
 1217  UI_TRANS_UP =0x1,
 1218  UI_TRANS_RIGHT =0x2,
 1219  UI_TRANS_DOWN =0x4,
 1220  UI_TRANS_LEFT =0x8,
 1222  UI_TRANS_DIRECTION_MASK=0xf,
 1224  // 2 bits affecting speed:
 1225  UI_TRANS_EASE_IN =0x10,
 1226  UI_TRANS_EASE_OUT =0x20,
 1227  UI_TRANS_EASE_INOUT =0x30,
 1229  UI_TRANS_EASE_MASK=0x30,
 1231  // Transition type
 1232  UI_TRANS_NONE =0x000,
 1233  UI_TRANS_SLIDE =0x100,
 1234  UI_TRANS_SLIDEON =0x200,
 1235  UI_TRANS_SWAP =0x300,
 1237  UI_TRANS_CROSSFADE=0x400,
 1239  UI_TRANS_TYPE_MASK=0xfff00
 1240 };
 1241 
 1251 DllSpec int uiSetTransition(int display, int region_id, unsigned transtype, int duration_ms);
 1252 
 1254 DllSpec int uiSetTransition(int region_id, unsigned transtype, int duration_ms);
 1255 
 1257 inline int uiSetTransition(unsigned transtype, int duration_ms)
 1258 { return uiSetTransition(0,UI_REGION_DEFAULT,transtype,duration_ms); }
 1259 
 1260 
 1262 struct UIErrorEntry {
 1264  enum ErrorType { NOT_FOUND,
 1265  UNSUPPORTED,
 1266  CORRUPT
 1267  } type;
 1268  std::string name;
 1270  UIErrorEntry(ErrorType t, const std::string &n) :type(t),name(n) {}
 1271 };
 1272 
 1279 DllSpec const std::vector<UIErrorEntry> &uiErrorList();
 1280 
 1282 struct UIStatistics {
 1283  vfigui::TimeStamp start;
 1284  vfigui::TimeStamp css;
 1285  vfigui::TimeStamp html;
 1286  vfigui::TimeStamp draw;
 1287 };
 1288 
 1289 
 1295 DllSpec const UIStatistics &uiStatistics();
 1296 
 1297 
 1301 DllSpec std::string uiScriptError();
 1302 
 1303 
 1307 DllSpec int uiGetIdleTime(int display=0);
 1308 
 1312 DllSpec void uiSetLogMask(unsigned mask);
 1313 
 1317 DllSpec unsigned uiGetLogMask(void);
 1318 
 1320 enum UILEDShape {
 1321  UI_SHAPE_RECTANGLE,
 1322  UI_SHAPE_ELLIPSE
 1323 };
 1324 
 1338 DllSpec int uiConfigLEDs(int display,
 1339  UILEDShape shape, int width, int height,
 1340  unsigned off_rgba,
 1341  unsigned on0_rgba, unsigned on1_rgba, unsigned on2_rgba, unsigned on3_rgba);
 1342 
 1344 DllSpec int uiConfigLEDs(UILEDShape shape, int width, int height,
 1345  unsigned off_rgba,
 1346  unsigned on0_rgba, unsigned on1_rgba, unsigned on2_rgba, unsigned on3_rgba);
 1347 
 1348 
 1358 DllSpec int uiConfigLEDs(int display, const char *filename);
 1359 
 1361 DllSpec int uiConfigLEDs(const char *filename);
 1362 
 1364 enum UIEdge {
 1365  UI_EDGE_TOP,
 1366  UI_EDGE_RIGHT,
 1367  UI_EDGE_BOTTOM,
 1368  UI_EDGE_LEFT
 1369 };
 1370 
 1387 DllSpec int uiShowLEDArea(int display, UIEdge edge, int width, int height, unsigned bg_rgba);
 1388 
 1390 DllSpec int uiShowLEDArea(UIEdge edge, int width, int height, unsigned bg_rgba);
 1391 
 1396 DllSpec int uiHideLEDArea(int display);
 1397 
 1399 DllSpec int uiHideLEDArea();
 1400 
 1407 DllSpec int uiSetLED(int display, unsigned led, bool state);
 1408 
 1410 DllSpec int uiSetLED(unsigned led, bool state);
 1411 
 1412 
 1414 struct UIBacklight {
 1415  unsigned brightness;
 1416  unsigned timeout;
 1418 };
 1419 
 1433 DllSpec int uiSetBacklightConfig(int display, const std::vector<UIBacklight> &levels);
 1434 
 1440 DllSpec int uiGetBacklightConfig(int display, std::vector<UIBacklight> &levels);
 1441 
 1449 DllSpec int uiSetBacklightLevel(int display, int level);
 1450 
 1456 DllSpec int uiGetBacklightLevel(int display, int &level);
 1457 
 1458 
 1466 DllSpec int uiSetInput(int display, int region_id, const std::string &name, const std::string &value);
 1467 
 1469 inline int uiSetInput(int region_id, const std::string &name, const std::string &value)
 1470 {
 1471  return uiSetInput(0,region_id,name,value);
 1472 }
 1473 
 1480 DllSpec int uiRunAction(int display, int region_id, const std::string &name);
 1481 
 1483 inline int uiRunAction(int region_id, const std::string &name)
 1484 {
 1485  return uiRunAction(0,region_id,name);
 1486 }
 1487 
 1488 
 1495 DllSpec int uiRunAction2(int display, int region_id, const std::string &name);
 1496 
 1498 inline int uiRunAction2(int region_id, const std::string &name)
 1499 {
 1500  return uiRunAction2(0,region_id,name);
 1501 }
 1502 
 1516 DllSpec int uiAddOption(int display, int region_id, const std::string &name, const std::string &value, const std::string &text, const std::string &style="", const std::string &action="", int position=-1);
 1517 
 1519 inline int uiAddOption(int region_id, const std::string &name, const std::string &value, const std::string &text, const std::string &style="", const std::string &action="", int position=-1)
 1520 {
 1521  return uiAddOption(0,region_id,name,value,text,style,action,position);
 1522 }
 1523 
 1525 enum UIScrollPosition { UI_SCROLL_TOP,
 1526  UI_SCROLL_BOTTOM
 1527 };
 1528 
 1529 
 1539 DllSpec int uiScrollOption(int display, int region_id, const std::string &name, const std::string &value, UIScrollPosition pos);
 1540 
 1542 inline int uiScrollOption(int region_id, const std::string &name, const std::string &value, UIScrollPosition pos)
 1543 {
 1544  return uiScrollOption(0,region_id,name,value,pos);
 1545 }
 1546 
 1554 DllSpec int uiRemoveOption(int display, int region_id, const std::string &name, const std::string &value);
 1555 
 1557 inline int uiRemoveOption(int region_id, const std::string &name, const std::string &value)
 1558 {
 1559  return uiRemoveOption(0,region_id,name,value);
 1560 }
 1561 
 1563 enum UIPinStatus {
 1564  UI_PS_IDLE = 0,
 1565  UI_PS_CONFIRM = 1,
 1566  UI_PS_CANCEL = 2,
 1567  UI_PS_TIMEOUT = 3,
 1568  UI_PS_BYPASS = 4,
 1570  UI_PS_ACTIVE = 0x10,
 1571  UI_PS_UNDERFLOW = 0x11,
 1572  UI_PS_OVERFLOW = 0x12,
 1573  UI_PS_DIGIT = 0x13,
 1574  UI_PS_BACKSPACE = 0x14,
 1575  UI_PS_ASTERISK = 0x15,
 1576  UI_PS_HASH = 0x16,
 1577  UI_PS_F1 = 0x17,
 1578  UI_PS_F2 = 0x18,
 1579  UI_PS_F3 = 0x19,
 1580  UI_PS_F4 = 0x1a,
 1582  UI_PS_NAVIGATOR = 0x20,
 1583  UI_PS_NAVIGATOR_DIGIT_SELECTED = 0x21,
 1584  UI_PS_NAVIGATOR_CANCEL_SELECTED = 0x22,
 1585  UI_PS_NAVIGATOR_BACKSPACE_SELECTED = 0x23,
 1586  UI_PS_NAVIGATOR_CONFIRM_SELECTED = 0x24,
 1587  UI_PS_NAVIGATOR_MULTIPLE_TOUCHES = 0x25,
 1588  UI_PS_NAVIGATOR_ASTERISK_SELECTED = 0x26,
 1589  UI_PS_NAVIGATOR_HASH_SELECTED = 0x27,
 1590  UI_PS_NAVIGATOR_F1_SELECTED = 0x28,
 1591  UI_PS_NAVIGATOR_F2_SELECTED = 0x29,
 1592  UI_PS_NAVIGATOR_F3_SELECTED = 0x2a,
 1593  UI_PS_NAVIGATOR_F4_SELECTED = 0x2b
 1594 };
 1595 
 1602 typedef void (*uiPinStatusCallback)(int status, int digit_count);
 1603 
 1609 DllSpec void uiSetPinStatusCallback(uiPinStatusCallback cb);
 1610 
 1614 DllSpec uiPinStatusCallback uiGetPinStatusCallback();
 1615 
 1623 DllSpec int uiDisablePINOK(int display=0);
 1624 
 1631 DllSpec int uiEnablePINOK(int display=0);
 1632 
 1633 
 1645 DllSpec int uiUpdate(int display, int region_id, const std::string &name, const std::string &html);
 1646 
 1648 inline int uiUpdate(int region_id, const std::string &name, const std::string &html)
 1649 {
 1650  return uiUpdate(0,region_id,name,html);
 1651 }
 1652 
 1654 enum UIBeep {
 1655  UI_BEEP_NORMAL,
 1656  UI_BEEP_ERROR
 1657 };
 1658 
 1664 DllSpec int uiBeep(int display, UIBeep beep);
 1665 
 1667 inline int uiBeep(UIBeep beep) {
 1668  return uiBeep(0,beep);
 1669 }
 1670 
 1671 
 1673 enum UINagScreenType {
 1674  UI_NAG_TEST_DEVICE
 1675 };
 1676 
 1687 DllSpec int uiNagScreen(int display, enum UINagScreenType type, int hide, int show);
 1688 
 1689 /*****************************************************************************/
 1690 /*****************************************************************************/
 1691 /**************************** Canvas interface *******************************/
 1692 /*****************************************************************************/
 1693 /*****************************************************************************/
 1694 
 1696 enum UICanvasEvent {
 1697  UI_PUSH,
 1698  UI_DRAG,
 1699  UI_RELEASE,
 1700  UI_KEYDOWN,
 1701  UI_KEYUP,
 1702  UI_TERMINATE
 1703 };
 1704 
 1716 typedef void (*uiEventCallback)(void *data, UICanvasEvent event, int x, int y, int key, unsigned flags);
 1717 
 1719 class DllSpec UIDrawing {
 1720 
 1721  public:
 1722  vfihtml::JSObject drawlist;
 1723 
 1725  enum {
 1726  FNT_NORMAL=0x0,
 1727  FNT_ITALIC=0x1,
 1728  FNT_BOLD=0x700
 1729  };
 1730 
 1732  enum ImageType {
 1733  IMG_BMP,
 1734  IMG_GIF,
 1735  IMG_JPEG,
 1736  IMG_PAM,
 1737  IMG_PBM,
 1738  IMG_PNG,
 1739  IMG_RAW
 1740  };
 1741 
 1743  UIDrawing();
 1744 
 1746  ~UIDrawing();
 1747 
 1749  void reset();
 1750 
 1753  void clear(unsigned rgb);
 1754 
 1757  void color(unsigned rgb);
 1758 
 1761  void linewidth(int w);
 1762 
 1768  void line(int x, int y, int x2, int y2);
 1769 
 1773  void pixel(int x, int y);
 1774 
 1780  void rect(int x, int y, int w, int h);
 1781 
 1787  void rectf(int x, int y, int w, int h);
 1788 
 1796  void trif(int x, int y, int x2, int y2, int x3, int y3);
 1797 
 1802  void font(const char *name, int size, unsigned style=FNT_NORMAL);
 1803 
 1808  void font(const std::string &name, int size, unsigned style=FNT_NORMAL);
 1809 
 1817  void text(const char *text, int x, int y);
 1818 
 1820  void text(const std::string &text, int x, int y);
 1821 
 1822 
 1838  void image(ImageType type, const void *data, unsigned size, int x, int y, int w=0, int h=0);
 1839 
 1845  void image(const char *filename, int x, int y);
 1846 
 1848  void image(const std::string &filename, int x, int y);
 1849 
 1850 };
 1851 
 1852 
 1860 DllSpec int uiCanvas(int display, int region_id, uiEventCallback cb, void *data=0);
 1861 
 1863 inline int uiCanvas(int region_id, uiEventCallback cb, void *data=0)
 1864 {
 1865  return uiCanvas(0,region_id,cb,data);
 1866 }
 1867 
 1874 DllSpec int uiDraw(int display, int region_id, const UIDrawing &drawing);
 1875 
 1877 inline int uiDraw(int region_id, const UIDrawing &drawing)
 1878 {
 1879  return uiDraw(0,region_id,drawing);
 1880 }
 1881 
 1888 DllSpec int uiDrawAsync(int display, int region_id, const UIDrawing &drawing, uiAsyncCallback cb=0, void *data=0);
 1889 
 1891 inline int uiDrawAsync(int region_id, const UIDrawing &drawing, uiAsyncCallback cb=0, void *data=0)
 1892 {
 1893  return uiDrawAsync(0,region_id,drawing,cb,data);
 1894 }
 1895 
 1897 struct UITextWidth {
 1898  std::string text;
 1899  int width;
 1902  UITextWidth(const std::string &s="") { text=s; width=0; }
 1903 };
 1904 
 1905 
 1917 DllSpec int uiTextMetrics(int display, int region_id, const std::string &font, int size, unsigned style, std::vector<UITextWidth> &width, int &height, int &descent);
 1918 
 1920 inline int uiTextMetrics(int region_id, const std::string &font, int size, unsigned style, std::vector<UITextWidth> &width, int &height, int &descent)
 1921 {
 1922  return uiTextMetrics(0,region_id,font,size,style,width,height,descent);
 1923 }
 1924 
 1925 
 1930 DllSpec const char *uiDataURLType(const std::string &in);
 1931 
 1936 DllSpec bool uiDataURLToString(std::string &out,const std::string &in);
 1937 
 1942 DllSpec bool uiDataURLToFile(const char *filename,const std::string &in);
 1943 
 1944 
 1945 #ifndef DOXYGEN
 1946 } // namespace vfigui
 1947 #endif
 1948 
 1949 
 1952 #undef DllSpec
 1953 
 1954 
 1955 #include "gui_template.h" // add "old" template functions
 1956 
 1957 #endif
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/gui_8h_source.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
