/*---------------------------------------------------------------------------*/
/* launcherapi.h                                                             */
/* copyright (c) innovaphone 2018                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

enum StartCallVideoMode {
    START_CALL_VIDEO_MODE_DEFAULT,
    START_CALL_VIDEO_MODE_ON,
    START_CALL_VIDEO_MODE_OFF,
};

class ULauncherApi {
public:
    virtual ~ULauncherApi() {};

    virtual void LauncherApiClosing(class ILauncherApi * launcherApi) {};
    virtual void LauncherApiDisablePowerSaving(bool active) {};
    virtual void LauncherApiSetDocked(bool docked) {};
    virtual void LauncherApiSetFocus(const char * app, const char * title) {};
    virtual void LauncherApiJavascriptObjPosition(const char* obj, int x, int y, int width, int height, int screenX, int screenY) {};
    virtual void LauncherApiAppWindowOpened(const char * app, const char * title) {};
    virtual void LauncherApiSetResize(const char * app, int width, int height) {};
    virtual void LauncherApiSetMaximized(const char * app, bool on) {};
    virtual void LauncherApiRegistrationState(bool up) {};
    virtual void LauncherApiDialGsm(const char * number) {};
    virtual void LauncherApiShowIfLocked(const char * ref, bool show) {};
    virtual void LauncherApiShowUnlock() {};
    virtual void LauncherApiAddLocalNotification(const char * ref, LocalNotificationType type, const char * title, const char * text, const char * smallIcon, const char * largeIcon, const char * soundUrl, const char * buttonTitle, const char * acceptTitle, const char * rejectTitle, const char * replyTitle, const char * link, void * ctx) {};
    virtual void LauncherApiRemoveLocalNotification(const char * ref) {};
    virtual void LauncherApiSetBadgeCount(const char * ref, unsigned count, const char * text) {};
    virtual void LauncherApiStatusBarAppearance(bool hidden, bool blackText, dword color) {};
    virtual void LauncherApiCacheable(const char * url, const char * filename) {};
    virtual void LauncherApiSetPushPassword(const char * pwd) {};
    virtual void LauncherApiSetDownloadedBuild(const char * build) {};
    virtual void LauncherApiSoftwareUpdate() {};
    virtual void LauncherApiInstallUpdate(const char * installFile) {};
    virtual void LauncherApiNoPushAutostart(bool noPushAutostart) {};
    virtual void LauncherApiClose() {};
    virtual void LauncherApiSetLangId(const char * langId) {};
    virtual void LauncherApiSetAdminSettings(class json_io & model, word baseSettings) {};
    virtual void LauncherApiSetUser(const char * sip) {};
    virtual void LauncherApiAppClientUrl(const char * url) {};
    virtual void LauncherApiRccAppConnected(bool up){};
    virtual void LauncherApiCheckPin(const char * client, const char * consumer, const char * src, class json_io & msg, word base) {};
    virtual void LauncherApiSetConnInfo(bool up, bool standby, const char * cur, const char * pri, const char * sec, const char * master) {};
};

enum GsmCallState {
    GSM_CALL_STATE_IDLE,
    GSM_CALL_STATE_RINGING,
    GSM_CALL_STATE_OFFHOOK,
};

class ILauncherApi {
public:
    virtual ~ILauncherApi(){};
    virtual void AddLauncherApiUser(class ULauncherApi * launcherApiUser) = 0;
    virtual void RemoveLauncherApiUser(class ULauncherApi * launcherApiUser) = 0;

    virtual void StartCall(const char * sip, const char * num, const char * name, enum StartCallVideoMode videoMode) = 0;
    virtual void PrepareCall(const char * text) = 0;
    virtual void StartChat(const char * sip) = 0;
    virtual void SendEvent(dword code, int severtiy, ulong64 time, const char * text, const char * details, const char * src) = 0;
    virtual void SetPushToken(const char * pushToken) = 0;
    virtual void SetClose(bool closeSupported) = 0;
    virtual void SetDocking(bool dockingSupported, bool docked) = 0;
    virtual void SetDetach(bool detach) = 0;
    virtual void SetGsmState(bool gsmSupported, enum GsmCallState gsmCallState) = 0;
    virtual void SetConfigApp(const char* url) = 0;
    virtual void SetStatusHeader(const char * url) = 0;
    virtual void SetRingerServiceUrl(const char * url) = 0;
    virtual void SetAudioServiceUrl(const char * url) = 0;
    virtual void SetVideoServiceUrl(const char * url) = 0;
    virtual void SetAppSharingServiceUrl(const char * url) = 0;
    virtual void SetRemoteControlServiceUrl(const char* url) {};
    virtual void SetSignalingServiceUrl(const char * url) = 0;
    virtual void SetServicePassword(const char * url) = 0;
    virtual void SetAutoOffline(bool offlineSupported, bool offline) = 0;
    virtual void SetHotkeyAction(bool hotkeySupported, int action, const char * dialNumber) = 0;
    virtual void SetAutostart(bool autostartSupported, bool autostart) = 0;
    virtual void SetExpectTouches(bool expectTouchesSupported, bool expectTouches) = 0;
    virtual void SetShownLocked(bool shownLockedSupported, bool shownLocked) = 0;
    virtual void SetProximity(bool proximitySupported, bool proximity) = 0;
    virtual void SetNoPushAutostart(bool noPushAutostartSupported) = 0;
    virtual void SetRunningClientServer(bool runningClientServer) = 0;
    virtual void SetBusylightHttpPort(int port) = 0;
    virtual void SetLock(bool lockSupported) = 0;
    virtual void SetLockPinNumberCount(int signCount) = 0;
    virtual void SetLockClock(char * clock) = 0;
    virtual void SetLockTimeout(int timeout) = 0;
    virtual void SetLockEmergencyNumbers(char * emergency) = 0;
    virtual void LauncherApiLocalNotificationClicked(const char * ref, enum LocalNotificationAction action, const char * replyText = nullptr) = 0;
    virtual void WakePhone() = 0;
    virtual void GoHome() = 0;
    virtual void Lock() = 0;
    virtual void OpenPermalink(const char * link) = 0;
    virtual void SendCheckPinResult(const char * client, const char * consumer, const char * src, bool ok) = 0;
};
