webengine/wmlengine/src/wml/include/nw_wae.h
branchRCL_3
changeset 49 919f36ff910f
equal deleted inserted replaced
48:79859ed3eea9 49:919f36ff910f
       
     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 **   File: nw_wae.h
       
    20 **   Subsystem Name: WAE User Agent
       
    21 **   Purpose:  Provides interface to the WAE Browser. This module
       
    22 **   has mostly glue logic that integrates the WML Interpreter with 
       
    23 **   the URL Loaders
       
    24 **************************************************************************/
       
    25 #ifndef NW_WAE_H
       
    26 #define NW_WAE_H
       
    27 
       
    28 #ifdef __cplusplus
       
    29 extern "C" {
       
    30 #endif
       
    31 
       
    32 /*
       
    33 **----------------------------------------------------------------------
       
    34 ** Includes
       
    35 **----------------------------------------------------------------------
       
    36 */
       
    37 #include "nw_errnotify.h"
       
    38 #include "nw_scrproxy.h"
       
    39 #include "nw_wml_core.h"
       
    40 #include "nw_wml_api.h"
       
    41 #include "nw_wtai_api.h"
       
    42 #include "nwx_generic_dlg.h"
       
    43 #include "nw_evlog_api.h"
       
    44 #include "wml_wae_transaction.h"
       
    45 #include "BrsrStatusCodes.h"
       
    46 
       
    47 /*                                                                          */
       
    48 /* Spectrum uses the new SIA/OTA Push application, which registers directly */
       
    49 /* with the WSP stack, rather than the Rainbow OEM Push handlering code     */
       
    50 /*                                                                          */
       
    51 
       
    52 /* Define the default port number */
       
    53 #define NW_DEFAULT_PORT 2948
       
    54 
       
    55 /*
       
    56 **----------------------------------------------------------------------
       
    57 ** Type Declarations
       
    58 **----------------------------------------------------------------------
       
    59 */
       
    60   
       
    61 /*
       
    62  * ---------------------------------------------------------------------
       
    63  */
       
    64 
       
    65 typedef struct _NW_UrlLoadProgressApi_t     NW_UrlLoadProgressApi_t;
       
    66 typedef struct _NW_AuthenticationApi_t      NW_AuthenticationApi_t;
       
    67 typedef struct _NW_GenDlgApi_t              NW_GenDlgApi_t;
       
    68 typedef struct _NW_WaeUsrAgent_t            NW_WaeUsrAgent_t;
       
    69 typedef struct _NW_UserRedirectionApi_t     NW_UserRedirectionApi_t;
       
    70 
       
    71 struct _NW_WaeUsrAgent_t {
       
    72   NW_Wml_t                        *wml;             /* WML Interpreter */
       
    73   NW_WaeTransaction_t             wmlReq;           /* WML Interpreter loader request */
       
    74   NW_ScrProxy_t                   *scrProxy;        /* WML Script Proxy */
       
    75   const NW_AuthenticationApi_t    *authApi;         /* Authentication API */
       
    76   const NW_GenDlgApi_t            *genDlgApi;       /* Generic dialogs API */
       
    77   const NW_UrlLoadProgressApi_t   *loadProgApi;     /* URL Load Progress API */
       
    78   const NW_ErrorApi_t             *errorApi;        /* Error API */
       
    79   const NW_WtaiApi_t              *wtaiApi;         /* Wtai API */
       
    80   const NW_EvLogApi_t             *evLogApi;        /* Event Logging API */
       
    81   void                            *uiCtx;           /* GUI Context */
       
    82   
       
    83   const NW_UserRedirectionApi_t   *userRedirection;  /* User Redirection */
       
    84 };
       
    85 
       
    86 /* The callback to call when done displaying a authentication dialog */
       
    87 typedef TBrowserStatusCode (NW_Wae_AuthenticationCB_t)(void *callback_ctx, 
       
    88                                                 TBrowserStatusCode status,
       
    89                                                 const NW_Ucs2 *username, 
       
    90                                                 const NW_Ucs2 *password,
       
    91                                                 NW_Bool cancel,
       
    92                                                 NW_Bool endPressed);
       
    93 
       
    94 typedef TBrowserStatusCode (NW_Wae_UserRedirectionCB_t)(void *callback_ctx, 
       
    95                                                  TBrowserStatusCode status,
       
    96                                                  NW_Dlg_Confirm_Result_t resp);
       
    97 
       
    98 /* Display a authentication dialog to the user */
       
    99 struct _NW_AuthenticationApi_t {
       
   100   void (*getAuthenticationData)(void *wae,
       
   101                                 void  *callbackCtx,
       
   102                                 NW_Wae_AuthenticationCB_t *callback);
       
   103   void (*getAuthenticationDataFailed)(void *msg,
       
   104                                       NW_Dlg_ConfirmCB_t *callback);
       
   105 }; 
       
   106 
       
   107 /* Display a authentication dialog to the user */
       
   108 struct _NW_UserRedirectionApi_t {
       
   109   void (*getUserRedirectionData)(void *wae,
       
   110                                  const NW_Ucs2 *originalUrl,
       
   111                                  const NW_Ucs2 *redirectedUrl,
       
   112                                  void  *callbackCtx,
       
   113                                  NW_Wae_UserRedirectionCB_t *callback);
       
   114 }; 
       
   115 
       
   116 struct _NW_GenDlgApi_t {
       
   117   void (*DialogListSelect)(NW_Dlg_ListSelect_t *data, void* callbackCtx, NW_Dlg_ListSelectCB_t* callback);
       
   118   void (*DialogPrompt)(NW_Dlg_Prompt_t *data, void* callbackCtx, NW_Dlg_PromptCB_t* callback);
       
   119   void (*DialogInputPrompt)(NW_Dlg_InputPrompt_t *data, void* callbackCtx, NW_Dlg_InputPromptCB_t* callback);
       
   120   void (*DialogSelectOption)(NW_Dlg_SelectData_t *data, void* callbackCtx, NW_Dlg_SelectCB_t* callback);
       
   121   void (*DetailsDialogHashkeyPressed)(NW_Ucs2* input, void* callbackCtx, NW_Dlg_DetailsDlgCB_t* callback);
       
   122 }; 
       
   123 
       
   124 /* URL load process API, UI interface*/
       
   125 struct _NW_UrlLoadProgressApi_t {
       
   126   /* start of a URL load ie. request to load a URL has been
       
   127   sent to the URL Loader. */
       
   128   TBrowserStatusCode (*start)  (void *wae, const NW_Ucs2 *url);
       
   129   /* the URL Loader has completed the load. */
       
   130   TBrowserStatusCode (*finish) (void *wae, const NW_Ucs2 *url);
       
   131   /* Progress status is available */
       
   132   TBrowserStatusCode (*load_progress_on) (void *wae, NW_Uint16 transactionId);
       
   133 
       
   134 }; 
       
   135 
       
   136 /*
       
   137 **----------------------------------------------------------------------
       
   138 ** Global Function Declarations
       
   139 **----------------------------------------------------------------------
       
   140 */
       
   141 
       
   142 /* Create the wae browser */
       
   143 NW_WaeUsrAgent_t *NW_WaeUsrAgent_New();
       
   144 
       
   145 /*
       
   146  * Free the wae browser. This function will shutdown the
       
   147  * URL Loader, WML Interpreter, Image Loader and the script proxy. 
       
   148  */
       
   149 void NW_WaeUsrAgent_Free(NW_WaeUsrAgent_t *wae);
       
   150 
       
   151 
       
   152 
       
   153 TBrowserStatusCode NW_Wae_RegisterWml(NW_WaeUsrAgent_t *wae, NW_Wml_t *wml);
       
   154 
       
   155 TBrowserStatusCode NW_Wae_UnRegisterWml(NW_WaeUsrAgent_t *wae);
       
   156 
       
   157 TBrowserStatusCode NW_Wae_RegisterWmlScriptProxy(NW_WaeUsrAgent_t *wae, 
       
   158                                           NW_ScrProxy_t *scrProxy);
       
   159 
       
   160 TBrowserStatusCode NW_Wae_UnRegisterWmlScriptProxy(NW_WaeUsrAgent_t *wae);
       
   161 
       
   162 
       
   163 /*                                                                          */
       
   164 /* Spectrum uses the new SIA/OTA Push application, which registers directly */
       
   165 /* with the WSP stack, rather than the Rainbow OEM Push handlering code     */
       
   166 /*                                                                          */
       
   167 
       
   168 TBrowserStatusCode 
       
   169 NW_WaeUsrAgent_RegisterGenDlg(NW_WaeUsrAgent_t *wae,
       
   170                           const NW_GenDlgApi_t *genDlgApi);
       
   171 
       
   172 TBrowserStatusCode 
       
   173 NW_WaeUsrAgent_UnRegisterGenDlg(NW_WaeUsrAgent_t *wae);
       
   174 
       
   175 
       
   176 /* 
       
   177  * Get a pointer to the script proxy. The caller should not free 
       
   178  * the returned pointer. 
       
   179  */
       
   180 NW_ScrProxy_t *NW_WaeUsrAgent_GetScript(NW_WaeUsrAgent_t *wae);
       
   181 
       
   182 
       
   183 /*                                                                          */
       
   184 /* Spectrum uses the new SIA/OTA Push application, which registers directly */
       
   185 /* with the WSP stack, rather than the Rainbow OEM Push handlering code     */
       
   186 /*                                                                          */
       
   187 
       
   188 TBrowserStatusCode NW_WaeUsrAgent_RegisterError(NW_WaeUsrAgent_t *wae, 
       
   189                                          const NW_ErrorApi_t *errorApi);
       
   190 
       
   191 TBrowserStatusCode NW_WaeUsrAgent_RegisterLoadProgress(NW_WaeUsrAgent_t *wae, 
       
   192                                                 const NW_UrlLoadProgressApi_t *loadProgApi);
       
   193 
       
   194 
       
   195 /*                                                                          */
       
   196 /* Spectrum uses the new SIA/OTA Push application, which registers directly */
       
   197 /* with the WSP stack, rather than the Rainbow OEM Push handlering code     */
       
   198 /*                                                                          */
       
   199 
       
   200 /* Register event log API */
       
   201 TBrowserStatusCode NW_WaeUsrAgent_RegisterEvLog(NW_WaeUsrAgent_t *wae,
       
   202                                          const NW_EvLogApi_t *evLogApi);
       
   203 
       
   204 /* Unregister event log API */
       
   205 TBrowserStatusCode NW_WaeUsrAgent_UnRegisterEvLog(NW_WaeUsrAgent_t *wae);
       
   206 
       
   207 /* Get a pointer to the EvLogApi. */
       
   208 const NW_EvLogApi_t *NW_WaeUsrAgent_GetEvLog(NW_WaeUsrAgent_t *wae);
       
   209 
       
   210 TBrowserStatusCode 
       
   211 NW_WaeUsrAgent_RegisterUserRedirection(NW_WaeUsrAgent_t *wae,
       
   212                                        const NW_UserRedirectionApi_t *userRedirectionapi);
       
   213 
       
   214 TBrowserStatusCode 
       
   215 NW_WaeUsrAgent_UnRegisterUserRedirection(NW_WaeUsrAgent_t *wae);
       
   216 
       
   217 
       
   218 
       
   219 TBrowserStatusCode NW_WaeUsrAgent_DlgListSelect(NW_WaeUsrAgent_t *wae, 
       
   220                                          NW_Dlg_ListSelect_t *data,
       
   221                                          void *callbackCtx,
       
   222                                          NW_Dlg_ListSelectCB_t callback);
       
   223 
       
   224 TBrowserStatusCode NW_WaeUsrAgent_DlgPrompt(NW_WaeUsrAgent_t *wae, 
       
   225                                      NW_Dlg_Prompt_t *data,
       
   226                                      void *callbackCtx,
       
   227                                      NW_Dlg_PromptCB_t callback);
       
   228 
       
   229 TBrowserStatusCode NW_WaeUsrAgent_DlgInputPrompt(NW_WaeUsrAgent_t *wae, 
       
   230                                           NW_Dlg_InputPrompt_t *data,
       
   231                                           void *callbackCtx,
       
   232                                           NW_Dlg_InputPromptCB_t callback);
       
   233 
       
   234 
       
   235 
       
   236 #ifdef __cplusplus
       
   237 } /* extern "C" */
       
   238 #endif
       
   239 
       
   240 #endif  /* NW_WAE_H */