webengine/wmlengine/src/script/include/scr_msgs.h
changeset 74 91031d3aab7d
parent 68 92a765b5b3e7
child 85 e358f2276d3f
equal deleted inserted replaced
68:92a765b5b3e7 74:91031d3aab7d
     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 /***************************************************************************
       
    20 **   File: scr_msgs.h
       
    21 **   Purpose:  Lists the data that can be moved between the WML Browser and
       
    22 **              the scripting engine. Also has utility functions for creation
       
    23 **        and deletion.
       
    24 **************************************************************************/
       
    25 
       
    26 #ifndef NWX_SCRIPT_MSGS_H
       
    27 #define NWX_SCRIPT_MSGS_H
       
    28 
       
    29 #ifdef __cplusplus
       
    30 extern "C" {
       
    31 #endif
       
    32 
       
    33 /*
       
    34 ** Includes
       
    35 */
       
    36 
       
    37 #include "nwx_defs.h"
       
    38 #include "nwx_http_header.h"
       
    39 #include "BrsrStatusCodes.h"
       
    40 
       
    41 /*
       
    42 ** Type Definitions
       
    43 */ 
       
    44 
       
    45 typedef struct {
       
    46   NW_Ucs2         *url;
       
    47   NW_Ucs2         *postfields;
       
    48   NW_Ucs2         *referer;
       
    49   NW_Byte         *content;
       
    50   NW_Uint32       contentLen;
       
    51   NW_Http_CharSet_t charset;
       
    52 } NW_StartScript_Req_t;
       
    53 
       
    54 typedef struct {
       
    55   NW_Ucs2   *name;
       
    56   NW_Ucs2   *value;
       
    57 } NW_ScriptServerVarInf_t;
       
    58 
       
    59 typedef struct {
       
    60   NW_Ucs2   *name;
       
    61 } NW_ScriptServerVarCons_t;
       
    62 
       
    63 typedef struct {
       
    64   NW_Ucs2   *message;
       
    65   NW_Ucs2   *input;
       
    66 } NW_ScriptServerDlgPromptReq_t;
       
    67 
       
    68 typedef struct {
       
    69   NW_Ucs2     *message;
       
    70   TBrowserStatusCode status;
       
    71 } NW_ScriptServerFinishReq_t;
       
    72 
       
    73 typedef struct {
       
    74   NW_Ucs2   *message;
       
    75   NW_Ucs2   *yesStr;
       
    76   NW_Ucs2   *noStr;
       
    77   NW_Bool   response;
       
    78 } NW_ScriptServerConfirmReq_t;
       
    79 
       
    80 /*
       
    81 ** Global Function Declarations
       
    82 */
       
    83 
       
    84 /* create a new script request */
       
    85 NW_StartScript_Req_t*
       
    86 NW_StartScript_Req_New(NW_Ucs2 *url, NW_Ucs2 *postfields, 
       
    87                        NW_Ucs2 *referer, NW_Byte *content,
       
    88                        const NW_Uint32 len, const NW_Http_CharSet_t charset);
       
    89 
       
    90 /* free a script request */
       
    91 void NW_StartScript_Req_Free(NW_StartScript_Req_t *req);
       
    92 
       
    93 /* free a script request and all contents */
       
    94 void NW_StartScript_Req_DeepFree(NW_StartScript_Req_t *req);
       
    95 
       
    96 /* create a new variable request */
       
    97 NW_ScriptServerVarCons_t* NW_Script_VarCons_New(const NW_Ucs2 *name);
       
    98 
       
    99 /* free a variable request */
       
   100 void NW_Script_VarCons_Free(NW_ScriptServerVarCons_t *var);
       
   101 
       
   102 /* create a new variable request */
       
   103 NW_ScriptServerVarInf_t* NW_Script_VarInf_New(const NW_Ucs2 *name, 
       
   104                                               const NW_Ucs2 *value);
       
   105 
       
   106 /* set a value for the variable */
       
   107 TBrowserStatusCode NW_Script_VarInf_SetValue(NW_ScriptServerVarInf_t* varinf, 
       
   108                                       NW_Ucs2 *value);
       
   109 
       
   110 /* free a new varible request */
       
   111 void NW_Script_VarInf_Free(NW_ScriptServerVarInf_t *varinf);
       
   112 
       
   113 /* create a new dialog request */
       
   114 NW_ScriptServerDlgPromptReq_t* NW_Script_DlgPrompt_Req_New(const NW_Ucs2 *message,
       
   115                                                            const NW_Ucs2 *input);
       
   116 /* free a dialog request */
       
   117 void NW_Script_DlgPrompt_Req_Free(NW_ScriptServerDlgPromptReq_t *dlg);
       
   118 
       
   119 /* create a new script finish request */
       
   120 NW_ScriptServerFinishReq_t* NW_Script_Finish_Req_New(TBrowserStatusCode status,
       
   121                                                      const NW_Ucs2 *message);
       
   122 
       
   123 /* free a script finish request */
       
   124 void NW_Script_Finish_Req_Free(NW_ScriptServerFinishReq_t *data);
       
   125 
       
   126 /* create a new script confirm request */
       
   127 NW_ScriptServerConfirmReq_t* NW_Script_Confirm_Req_New(const NW_Ucs2 *message,
       
   128                                                        const NW_Ucs2 *yesStr,
       
   129                                                        const NW_Ucs2 *noStr);
       
   130 
       
   131 /* free a script confirm request */
       
   132 void NW_Script_Confirm_Req_Free(NW_ScriptServerConfirmReq_t *data);
       
   133 
       
   134 
       
   135 
       
   136 #ifdef __cplusplus
       
   137 } /* extern "C" */
       
   138 #endif
       
   139 
       
   140 #endif  /* NWX_SCRIPT_MSGS_H */