webengine/wmlengine/src/script/include/scr_api.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 1999 - 2001 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SCR_API_H
       
    20 #define SCR_API_H
       
    21 
       
    22 #include "scr_defs.h"
       
    23 #include "scr_core.h"
       
    24 #include "scr_context.h"
       
    25 
       
    26 #include "nw_wml_defs.h"
       
    27 #include "nwx_msg_api.h"
       
    28 #include "BrsrStatusCodes.h"
       
    29 
       
    30 
       
    31 
       
    32 
       
    33 
       
    34 /* Crypto Lib API. Used when the User digitally signs a Text */
       
    35 NW_Bool ScriptAPI_signText(NW_Ucs2 *stringToSign, NW_Int32 option, NW_Int32 keyIdType, NW_Byte *keyIdByte, NW_Int32 keyIdLen);
       
    36 
       
    37 /* Ask for the current context */
       
    38 context_t  *ScriptAPI_getCurrentContext(void);
       
    39 
       
    40 
       
    41 /*
       
    42   Make a request to load a URL. The interperter should exit after making the request.
       
    43   If the URL contains WMLScript content - 
       
    44   The response should call the callback function CoreScript_LoadScript_CB() 
       
    45 */
       
    46 NW_Bool ScriptAPI_load(NW_Ucs2* url); 
       
    47 
       
    48 /*
       
    49   Make a request to load a URL with a specific mime type. The
       
    50   interperter should exit after making the request.
       
    51   The return content is not guaranteed to have the specified mimetype.
       
    52   The response should call the callback function CoreScript_LoadScript_CB() 
       
    53 */
       
    54 NW_Bool ScriptAPI_loadString(const NW_Ucs2* url, char *mimetype); 
       
    55 
       
    56 
       
    57 /* Same as ScriptAPI_load called to reload the current script URL */
       
    58 NW_Bool ScriptAPI_reload(void); 
       
    59 
       
    60 
       
    61 /*
       
    62   Ask the WML browser for a the value of a variable. The interperter should
       
    63   exit after making the request.
       
    64   The response should call the callback function CoreScript_GetVar_CB().
       
    65 */
       
    66 NW_Bool ScriptAPI_getVar(NW_Ucs2* name);
       
    67 
       
    68 
       
    69 /*
       
    70   Ask the WML browser to set a variable value. The interperter should
       
    71   exit after making the request.
       
    72   The response should call the callback function CoreScript_SetVar_CB().
       
    73 */
       
    74 NW_Bool ScriptAPI_setVar(NW_Ucs2* name, NW_Ucs2* value);
       
    75 
       
    76 
       
    77 /*
       
    78   Ask the WML browser to execute a <GO> task when The interperter finishes executing the script.
       
    79   The interperter should exit after making the request.
       
    80   The response should call the callback function CoreScript_Go_CB().
       
    81 */
       
    82 NW_Bool ScriptAPI_go(NW_Ucs2 *url);
       
    83 
       
    84 
       
    85 /*
       
    86   Ask the WML browser to execute a <PREV> task when The interperter finishes executing the script.
       
    87   The interperter should  exit after making the request.
       
    88   The response should call the callback function CoreScript_Prev_CB().
       
    89 */
       
    90 NW_Bool ScriptAPI_prev(void);
       
    91 
       
    92 
       
    93 /*
       
    94   Ask the WML browser to execute a <REFRESH> task.
       
    95   The response should call the callback function CoreScript_Refresh_CB().
       
    96 */
       
    97 NW_Bool ScriptAPI_refresh(void);
       
    98 
       
    99 /*
       
   100   Ask the WML browser to start a new context, The interperter should
       
   101   exit after making the request.
       
   102   The response should call the callback function CoreScript_Go_CB().
       
   103 */
       
   104 NW_Bool ScriptAPI_newContext(void);
       
   105 
       
   106 
       
   107 /*
       
   108   Ask the WML browser to suspend itself. The interperter should
       
   109   exit after making the request.
       
   110   The response should call the callback function CoreScript_Resume().
       
   111 
       
   112   This function is called priodically to allow processing of pending requests.
       
   113 */
       
   114 NW_Bool ScriptAPI_suspend(void);
       
   115 
       
   116 
       
   117 /*
       
   118   Called when the interperter finishes executing The interperter (status determine if the
       
   119   termination was normal or abnormal). The status codes are listed in scr_defs.h
       
   120 */
       
   121 NW_Bool ScriptAPI_finish(NW_Byte status, NW_Ucs2 *msg);
       
   122 NW_Bool ScriptAPI_finishNoDialog(NW_Byte status, NW_Ucs2 *msg);
       
   123 
       
   124 /* public library */
       
   125 NW_Bool ScriptAPI_wp_makeCall(NW_Ucs2 *number);
       
   126 NW_Bool ScriptAPI_wp_sendDTMF(NW_Ucs2 *dtmf);
       
   127 NW_Bool ScriptAPI_wp_addPBEntry(NW_Ucs2 *number, NW_Ucs2 *name);
       
   128 
       
   129 /* Nokia proprietary */
       
   130 NW_Bool ScriptAPI_nokia_locationInfo(NW_Ucs2 *url, 
       
   131                                      NW_Ucs2 *ll_format, 
       
   132                                      NW_Ucs2 *pn_format);
       
   133 
       
   134 /*
       
   135   ASK the OS to display a prompt dialog, The interperter should exit after making the request.
       
   136   The response should call the callback function NW_WmlsDialog_PromptResp().
       
   137 */
       
   138 NW_Bool NW_WmlsDialog_Prompt(const NW_Ucs2 *message, const NW_Ucs2 *defaultInput);
       
   139 
       
   140 
       
   141 /*
       
   142   Ask the OS to display a confirm dialog, The interperter should exit after making the request.
       
   143   The response should call the callback function NW_WmlsDialog_ConfirmResp().
       
   144 */
       
   145 NW_Bool NW_WmlsDialog_Confirm(const NW_Ucs2 *message, const NW_Ucs2 *yes_str, 
       
   146                             const NW_Ucs2 *no_str);
       
   147 
       
   148 
       
   149 /*
       
   150   Ask the OS to display an alert dialog, The interperter should exit after making the request.
       
   151   The response should call the callback function NW_WmlsDialog_AlertResp().
       
   152 */
       
   153 NW_Bool  NW_WmlsDialog_Alert(const NW_Ucs2 *message);
       
   154 
       
   155 
       
   156 /*
       
   157   Ask the OS to display an error dialog, The interperter should exit after making the request.
       
   158   The response should call the callback function NW_WmlsDialog_NotifyerrorResp().
       
   159 */
       
   160 NW_Bool  NW_WmlsDialog_Error(const TBrowserStatusCode nwStatus);
       
   161 
       
   162 
       
   163 /* Ask from the OS the script libraries table */
       
   164 lib_function_table_t *ScriptAPI_get_lib_table(void);
       
   165 NW_Int32 ScriptAPI_get_lib_index(NW_Int32 libId);
       
   166 
       
   167 /* Added functions to avoid static function table */
       
   168 lib_function_table_t* GetLibFuncTabContext(void);
       
   169 void SetLibFuncTabContext(lib_function_table_t* context);
       
   170 
       
   171 /* native character set */
       
   172 NW_Int32  ScriptAPI_character_set(void);
       
   173 #endif