> 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/s-adk-5.1-programmers-guide/mac_8h_source.md).

# mac.h

[Go to the documentation of this file.](/s-adk-5.1-programmers-guide/readme/files/dir_e65d4d0c0ba9865676ee3897978ecbf1/dir_517ad9dc307a0538d3e19e98627cc0af/dir_619a55c4c313d761d1f6a99da403e1c9/mac_8h.md)

```cpp
 1 #pragma once
 2 
 3 // STL
 4 #include <string>
 5 #include <vector>
 6 #include <map>
 7 #include <list>
 8 
 9 // ADK
 10 #include <ipc/jsobject.h>
 11 
 17 #ifndef DOXYGEN
 18 
 19 namespace vfimac
 20 {
 21 #endif
 22 
 23 #if defined VFI_MAC_DLL_EXPORT
 24  #define MAC_API __attribute__((visibility ("default")))
 25 
 26 #else
 27  #define MAC_API
 28 
 29 #endif
 30 
 32 enum macError
 33 {
 34  MAC_ERR_OK = 0,
 35  MAC_ERR_FAIL = -1,
 36  MAC_ERR_UNSUPPORTED = -2,
 37  MAC_ERR_LOCKED = -3,
 38  MAC_ERR_TIMEOUT = -4,
 39  MAC_ERR_LIBNOTIFY = -5,
 40  MAC_ERR_APP_NOT_RUNNING = -6,
 41  MAC_ERR_WRONG_APPID = -7,
 42  MAC_ERR_NOT_CP_APP = -8,
 43  MAC_ERR_UNKNOWN = -9,
 44  MAC_ERR_CYCLE = -10,
 45  MAC_ERR_DEPENDS = -11,
 46  MAC_ERR_MANIFEST = -12,
 47  MAC_ERR_IPC = -13,
 48  MAC_ERR_NO_APP = -14,
 49  MAC_ERR_READY = -15,
 50  MAC_ERR_ACTIVE = -16,
 51  MAC_ERR_STOP = -17,
 52  MAC_ERR_NO_APPID = -18,
 53  MAC_ERR_PERMISSION = -19,
 54  MAC_ERR_SERVICE = -20,
 55  MAC_ERR_VISIBLE = -21,
 56  MAC_ERR_DISABLED = -22,
 57  MAC_ERR_LAUNCH = -23,
 58  MAC_ERR_RUNNING = -24,
 59  MAC_ERR_LAYOUT = -25,
 60  MAC_ERR_PARAMETER = -26,
 61  MAC_ERR_IGNORE = -27,
 62  MAC_ERR_CANCELED = -28,
 63  MAC_ERR_EXISTS = -29,
 64  MAC_ERR_NO_KEYS = -30,
 65  MAC_ERR_EXPECTED_KEYS = -31,
 66  MAC_ERR_ACCESS = -32,
 67  MAC_ERR_AVAILIBLE = -33,
 68  MAC_ERR_CPR_DISABLED = -35,
 69  MAC_ERR_INVALID_FORMAT = -36,
 70 };
 71 
 73 enum macLaunchParams
 74 {
 75  NONE = 0,
 76  KEEP_IN_BACKGROUND = 1,
 77 };
 78 
 80 enum macKeyboard
 81 {
 82  MAC_KBD_OFF = (0<<0),
 83  MAC_KBD_ON = (1<<0),
 84  MAC_KBD_AUTO = (1<<1),
 85  MAC_KBD_NUMERIC = (1<<2),
 86  MAC_KBD_ALPHANUMERIC = (1<<3),
 87  MAC_KBD_CAPITALIZED = (1<<4),
 88  MAC_KBD_LAST = (1<<5),
 89 };
 90 
 92 enum macEvent
 93 {
 94  EVENT_NONE = 0,
 95  EVENT_MANIFEST_UPDATE = 1,
 96  EVENT_ACTIVATION_UPDATE = 2,
 97  EVENT_PARAMETER_UPDATE = 3,
 98  EVENT_FOCUS_UPDATE = 4,
 99  EVENT_FOREGROUND = 5,
 100  EVENT_BACKGROUND = 6,
 101  EVENT_CP_STARTED = 7,
 102  EVENT_CP_STOPPED = 8,
 103  EVENT_BOOT_COMPLETED = 9,
 104  EVENT_LAST = 10,
 105 };
 106 
 108 enum macNotifications
 109 {
 110  NOTIFICATION_NONE = (0<<0),
 111  NOTIFICATION_MANIFEST_RESCAN = (1<<0),
 112  NOTIFICATION_ACTIVATION_CFG_UPDATE = (1<<1),
 113  NOTIFICATION_PARAMETER_CFG_UPDATE = (1<<2),
 114  NOTIFICATION_CP_START = (1<<3),
 115  NOTIFICATION_CP_STOP = (1<<4),
 116  NOTIFICATION_LAST = (1<<6),
 117  NOTIFICATION_ALL = 0xFFFF
 118 };
 119 
 121 enum systemNotificationPriority
 122 {
 123  SYSTEM_NOTIFICATION_INFO = 1,
 124  SYSTEM_NOTIFICATION_WARNING = 2,
 125  SYSTEM_NOTIFICATION_CRITICAL = 3
 126 };
 127 
 133 typedef void (*macEventCallback)( macEvent event, const vfiipc::JSObject & json );
 134 
 141 typedef void (*macNotificationCallback)(macNotifications notification);
 142 
 153 MAC_API macError sysSetEventCallback( macEvent event, macEventCallback cb );
 154 
 165 MAC_API macError sysNotificationCallback( macNotificationCallback cb, long notification_mask );
 166 
 177 MAC_API macError sysNotificationCallback( macNotificationCallback cb = NULL,
 178  macNotifications notification = NOTIFICATION_NONE );
 179 
 186 MAC_API macError sysShowDesktop();
 187 
 194 MAC_API macError sysShowControlPanel();
 195 
 202 MAC_API macError sysShowPowerControlPanel();
 203 
 212 MAC_API macError sysShowPrevApp();
 213 
 224 MAC_API macError sysLaunchAppid( const std::string & appid,
 225  const std::vector< std::string > & args,
 226  const std::map< std::string,std::string > & envs, int params = 0 );
 227 
 237 MAC_API macError sysLaunchAppid( const std::string & appid,
 238  const std::vector<std::string> & args,
 239  int params );
 240 
 249 MAC_API macError sysLaunchAppid( const std::string & appid,
 250  const std::vector<std::string> & args);
 251 
 259 MAC_API macError sysLaunchAppid( const std::string & appid );
 260 
 269 MAC_API macError sysLaunchApp( const std::string & appname,
 270  const std::vector<std::string> & args );
 271 
 279 MAC_API macError sysLaunchApp( const std::string & appname );
 280 
 289 MAC_API macError sysRelaunchApps();
 290 
 299 MAC_API macError sysIsRunning( const std::string & appid, bool & running );
 300 
 309 MAC_API macError sysShowProgress( const std::string & info , size_t percent );
 310 
 321 MAC_API macError sysSetAppid( const std::string & appid );
 322 
 330 MAC_API macError sysUnSetAppid();
 331 
 340 MAC_API macError sysChangeLayout( const std::string & layoutname, bool statusbar = true, bool keyboard = false );
 341 
 349 MAC_API macError sysChangeLayout( const std::string & layoutname, bool statusbar );
 350 
 359 MAC_API macError sysAssignToLayout( const std::string & appid, const std::string & region );
 360 
 369 MAC_API macError sysFullscreenMode( bool enable );
 370 
 378 MAC_API macError sysStatusbar( bool visible );
 379 
 387 MAC_API macError sysGetCPRState( bool & active );
 388 
 395 MAC_API macError sysGetCPAppRootDir( std::string &path );
 396 
 404 MAC_API macError sysGetWMState( bool & active );
 405 
 413 MAC_API macError sysStatusbarState( bool & visible );
 414 
 423 MAC_API macError sysSetStatusbarValues( const std::map<std::string,std::string> & values );
 424 
 433 MAC_API macError sysGetStatusbarValues( std::map<std::string,std::string> & values );
 434 
 440 MAC_API macError sysStatusbarRefresh();
 441 
 452 MAC_API macError sysVirtualKeyboard( macKeyboard mode );
 453 
 464 MAC_API macError sysVirtualKeyboard( int mode );
 465 
 479 MAC_API macError sysLockLayout( bool enable );
 480 
 487 MAC_API macError sysInForeground( std::string & appid );
 488 
 495 MAC_API macError sysInForeground( bool & visible );
 496 
 505 MAC_API macError sysToForeground( const std::string & appid );
 506 MAC_API macError sysToForground( const std::string & appid );
 507 
 515 MAC_API macError sysStopAppid( const std::string & appid );
 516 
 524 MAC_API macError sysStopAppname( const std::string & appname );
 525 
 532 MAC_API macError sysStopAllUserApps();
 533 
 542 MAC_API macError sysStopOtherApps();
 543 
 558 MAC_API macError sysGetAppList( vfiipc::JSObject & applist );
 559 
 568 MAC_API macError sysScanManifests();
 569 
 578 MAC_API macError sysSetCPEnvData( const vfiipc::JSObject & envs );
 579 
 591 MAC_API macError sysInstallCPApp( const std::string & path );
 592 
 604 MAC_API macError sysLaunchCPAppFromDesktop( const std::string & trigger_id, const std::vector<std::string> & param);
 605 
 616 MAC_API macError sysLaunchCPAppFromDesktop( const std::string & trigger_id, const vfiipc::JSObject & param );
 617 
 629 MAC_API macError sysLaunchCPAppFromDesktopSync(
 630  const std::string & trigger_id,
 631  const vfiipc::JSObject & param,
 632  int flags = 0 );
 633 
 652 MAC_API macError sysLaunchCPAppByTrigger(
 653  const std::string & appid,
 654  const std::string & trigger_id,
 655  const vfiipc::JSObject & param,
 656  unsigned int flags );
 657 
 671 MAC_API macError sysInvokeCPAppAction(
 672  const std::string & appid,
 673  const std::string & name,
 674  int display_id = 0,
 675  unsigned int flags = 0 );
 676 
 686 MAC_API macError sysGetGUIRegionId(
 687  const std::string & appid,
 688  int & gui_region_id );
 689 
 695 MAC_API macError sysStopAllCPApps();
 696 
 707 MAC_API int systemNotificationAdd(
 708  systemNotificationPriority p,
 709  const std::string & message,
 710  bool sticky = false );
 711 
 716 MAC_API macError systemNotificationRemove( int id );
 717 
 722 MAC_API macError systemNotificationList( std::list<int> & list );
 723 
 727 MAC_API const char * sysMac_GetVersion();
 728 
 732 MAC_API const char * sysLibMac_GetVersion();
 733 
 734 #ifndef DOXYGEN
 735 } // namespace vfimac
 736 #endif
 737 
```


---

# 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/s-adk-5.1-programmers-guide/mac_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.
