hwc namespace

The namespace for the Hybrid Web Container javascript

Classes

Name Description
hwc.SUPStorage Storage
hwc.SUPStorageException Storage

Namespaces

Name Description
NativeErrorCodes This object contains constants representing the different types of public native error codes.

Members

Name Description
APP_ADDED A constant indicating that a hybrid app has been added.
APP_REFRESH A constant indicating that the application list requires a refresh.
APP_REMOVED A constant indicating that a hybrid app was removed.
APP_UPDATED A constant indicating that a hybrid app was updated.
CONNECTED Constant indicating that the hwc is connected.
CONNECTION_CONNECTED A constant indicating that the log message is about the connection being established.
CONNECTION_DISCONNECTED A constant indicating that the log message is about the connection being disconnected.
CONNECTION_ERROR A constant indicating that the log message is about a connection error.
CONNECTION_OTHER A constant indicating that the log message is not about the connection.
CONNECTION_RETRIEVED_ITEMS a constant indicating that the log message is about retrieved items.
DEFAULT_CUSTOM_ICON_INDEX A constant indicating the custom icon index.
DISCONNECTED Constant indicating that the hwc is disconnected.
e2eTrace Represents an E2E Trace.
INSTALLATION_BEGIN A constant indicating that the application is starting to be installed.
INSTALLATION_END A constant indicating that the application has finished being installed.
MediaCache Represents a Media Cache.
MSG_ADDED A constant indicating that a message has been added.
MSG_PRIORITY_HIGH A constant indicating a message has high priority.
MSG_PRIORITY_NORMAL A constant indicating a message has normal priority.
MSG_REFRESH A constant indicating that a message needs to be refreshed.
MSG_REMOVED A constant indicating that a message has been removed.
MSG_UPDATED A constant indicating that a message has been updated.
NOTIFICATION_CANCEL A constant indicating that no more push notification listeners should be called.
NOTIFICATION_CONTINUE A constant indicating that other push notification listeners should continue to be called.
OPEN_APP_NOT_EXIST A constant indicating that hwc.openApp failed because the specified app does not exist.
OPEN_APP_OTHER A constant indicating that hwc.openApp failed for an unspecified reason.
OPEN_APP_SUCCESS A constant indicating that hwc.openApp completed successfully.
OPEN_MSG_APP_NOT_EXIST A constant indicating that a message could not be opened because there was no associated hybrid app.
OPEN_MSG_NOT_EXIST A constant indicating that a message could not be opened because no message with the given ID exists.
OPEN_MSG_OTHER A constant indicating that a message could not be opened due to an unspecified error.
OPEN_MSG_SUCCESS A constant indicating that a message was successfully opened.
perf Represents the Performance Manager.
PictureError An array that holds all possible error codes
REG_ERR_AUTO_REG_NOT_ENABLED Constant indicating that auto registration was not enabled in the template.
REG_ERR_AUTO_REG_TEMPLATE_NOT_FOUND Constant indicating that no MBS template was found for given AppId and/or Security configuration.
REG_ERR_AUTO_REG_USER_NAME_TOO_LONG Constant indicating that the user name is longer than the legal limit.
REG_ERR_AUTO_REG_WRONG_USER_FOR_DEVICE Constant indicating that the given device id is already registered for another user.
REG_ERR_COULD_NOT_REACH_MMS_SERVER Constant indicating that the connection to the MMS service failed.
REG_ERR_INVALID_USER_NAME Constant indicating that the user name contains invalid characters.
REG_ERR_MMS_AUTHENTICATION_FAILED Constant indicating that MMS Authentication failed.
REGISTRATION_METHOD_AFARIA Constant indicating that automatic registration using a certificate from Afaria is the preferred method.
REGISTRATION_METHOD_AUTOMATIC Constant indicating that automatic registration using password is the preferred method.
REGISTRATION_METHOD_CERTIFICATE Constant indicating that automcatic registration using a local certificate is the preferred method.
REGISTRATION_METHOD_MANUAL Constant indicating that manual registration is the preferred method.
REGISTRATION_METHOD_NO_PREFERENCE Constant indicating no registration method preference.
SETTING_SUCCESS Constant indicating hwc.saveSettings completed successfully.
STATUS This object contains constants representing the status of the hybrid app.

Methods

Name Description
activationRequired() This function sets the activation required state of this hybrid app to true.
addAppInstallationListener( AppInstallationListener ) Register the application installation listener.
addAppListener( ApplicationListener, [containingObject] ) Register the application listener.
addConnectionListener( ConnectionStateListener, [containingObject] ) Register the connection state listener.
addLogListener( LogListener, [containingObject] ) Register the log listener.
addMenuItemCollection( collection ) This function adds a menu item collection to the menu items for the screen.
addMessageListener( filters, MessageListener, [containingObject] ) Registers a message listener.
addPushNotificationListener( PushNotificationListener, [containingObject] ) Register a push notification listener.
CertificateStore() Use these functions for X.509 credential handling.
clearCache() This function clears the contents of the on-device request result cache for the current hybrid app.
clearCacheItem( cachekey ) This function clears an item from the contents of the on-device request result cache for the current hybrid app.
ClientVariables( clientVariablesVersion, clientVariableItems ) Represents a ClientVariables object.
ClientVariablesException( errCode, errMsg ) This exception is thrown when hwc.ClientVariables#getVariableValueByName is called with a variable name that does not exist.
close() This function closes the hybrid app.
ConnectionSettings( regmethod, server, port, server, user, activationcode, protocol, password, urlsuffix ) Represents the connection settings for connecting to the SUP Server.
connectToServer( [onNotification] ) Resumes the connection to the SUP server.
convertLocalTimeToUtc( date ) Timezone
convertUtcToLocalTime( date ) Timezone
CustomIcon( width, height, type, name, path, processedPath, moduleId, moduleVersion, index ) Represents a CustomIcon.
disconnectFromServer() Suspends the connection to the SUP server.
expireCredentials() Allows the user to set the credentials to the expired state for the current hybrid app.
getAllMessages( [messageFilter], [completeList] ) Gets received messages based on a filter and the existance of a default hybrid app.
getAppByID( moduleID, version ) Gets a hwc.HybridApp object with the given module id and version.
getAppIconUrl( app, processed ) This function gets the URL of the icon for a hybrid app depending on whether custom icons are defined.
getApplicationConnectionID() Gets the Hybrid Web Container application connection ID.
getBuiltInIconUrl( iconIndex, processed ) Gets the icon URL for the built-in icon.
getCallbackFromNativeError( errString ) Extract the error call back method name from a URL string.
getClientVariables( moduleID, version ) Gets the client variables of the hybrid app with given module id and version.
getCodeFromNativeError( errString ) Extract an error code from a URL string.
getCurrentApp() Gets the hybrid app that is currently open.
getCurrentLocale() Timezone
getCustomIconUrl( moduleId, moduleVersion, iconIndex, processed ) Gets the URL to the custom icon.
getDstOffsetAtGivenTimeInMinutes( date ) Timezone
getExternalResource( url, options ) Makes an external cross domain request.
getInstalledApps( [completeList] ) Returns an array of hwc.HybridApp objects.
getLocalizedDate( date ) Timezone
getLocalizedDateTime( date ) Timezone
getLocalizedTime( date ) Timezone
getLogEntries() Call this function to get an array of hwc.LogEntry objects.
getLoggingAlertDialog() This function gets the callback used by hwc.log when it is required to notify the user of a log item.
getLoggingCurrentLevel() This function gets the logging level.
getMessageByID( msgId ) Gets a hwc.Message object with the given message ID.
getMsgIconUrl( msg ) This function gets the URL of the icon for a message object depending on its processed status and whether there are custom icons defined.
getNativeMessageFromNativeError( errString ) Extract a native message from a URL string.
getOffsetFromUTC( date ) Timezone
getOnErrorMessageFromNativeError( errString ) Extract the error message from a URL string.
getPicture( onGetPictureError, onGetPictureSuccess, options ) Camera
getQueryVariable( variable ) This function looks in the query string on the URL for the value corresponding to the given name.
getServerInitiatedApps() Returns an array of hwc.HybridApp objects that are server initiated.
getSharedStorageKey() Storage
getTimezoneId() Timezone
getTransformData() Returns the transform data for the hybridapp.
getURLParamFromNativeError( paramName, url ) Extract a parameter value from a URL string with a given parameter name.
getUsesDST() Timezone
getXMLHTTPRequest() Reliably returns an XMLHttpRequest object regardless of what platform this code is being executed on.
guid() This function generates a GUID (globally unique identifier).
hideProgressDialog() This function hides the progress dialog displaying the spinner.
HybridApp( moduleId, version, displayName, iconIndex, defaultCustomIcon, customIconList ) This object represents a hybrid app.
isAndroid() Platform
isAndroid3() Platform
isBlackBerry() Platform
isBlackBerry5() Platform
isBlackBerry5WithTouchScreen() Platform
isBlackBerry6NonTouchScreen() Platform
isBlackBerry7() Platform
isClosed() This function checks if the hybrid app has been closed.
isDstActiveAtGivenTime( date ) Timezone
isIOS() Platform
isIOS4() Returns true if the hybrid app application is being run on iOS4
isIOS5() Platform
isIOS6() Returns true if the hybrid app application is being run on iOS6
isIOS7() Returns true if the hybrid app application is being run on iOS7
isIPad() Platform
isSharedStorageEnabled() Storage
isWindows() Platform
isWindowsMobile() Platform
loadSettings() Loads the current connection settings from the native application storage.
log( sMsg, eLevel, notifyUser ) Allows the user to log a message to the device trace log which can be remotely retrieved from the server.
LogEntry( date, event, msg ) This object represents a log entry.
markAsActivated() This function sets the activation required state for the current hybrid app to false.
markAsProcessed() Allows the user to set the processed state to true for the current message.
MenuItemCollection() This class represents a collection of menu items.
Message( msgId, date, icon, sender, isRead, processed, priority, subject, module, version ) Represents a message received by the HWC.
MessageFilter( [sender], [subject], [moduleId], [version], [isread], [processed] ) Represents a filter used to filter messages.
openApp( moduleId, version ) Launch the hybrid app with the given module ID and version.
openMessage( msgId ) Launch the server initiated hybrid app associated with a message.
removeAllMenuItems() This function removes all menu items that were added by the hybrid app.
removeAppInstallationListener( AppInstallationListener ) Remove the application installation listener.
removeAppListener( ApplicationListener, [containingObject] ) Remove the application listener.
removeConnectionListener( ConnectionStateListener, [containingObject] ) Remove the connection state listener.
removeLogListener( LogListener, [containingObject] ) Remove the log listener.
removeMessage( msgId ) Removes (deletes) a message.
removeMessageListener( MessageListener, [containingObject] ) Removes the message listener.
removePushNotificationListener( PushNotificationListener, [containingObject] ) Remove the push notification listener.
sample_AppListener( event, moduleId, version ) A sample anonymous.ApplicationListener callback function.
sample_ConnectionListener( event, errorCode, errorMessage ) A sample anonymous.ConnectionStateListener callback function.
sample_InstallationAppListener( event, moduleId, version, moduleName, designerVersion, containerVersion ) Sample application listener callback function
sample_LogListener( milliseconds, event, optionalString ) Sample anonymous.LogListener callback function.
sample_MessageListener( flag, msgId ) A sample anonymous.MessageListener callback function.
sample_PushNotificationListener( notifications ) A sample implementation of a anonymous.PushNotificationListener callback function.
saveLoginCertificate( certificate ) This function saves login credentials from a certificate to the credential cache.
saveLoginCredentials( userName, password ) This function saves login credentials to the credential cache.
saveSettings( settings ) Save the connection settings to native application storage.
setLoggingAlertDialog( newAlertDialogCallback ) This function sets the callback used by hwc.log when it is required to notify the user of a log item.
setLoggingCurrentLevel( newLoggingLevel ) This function sets the logging level.
setReportErrorFromNativeCallback( callbackToSet ) This function sets the callback function called when there is a native error reported.
setScreenTitle_CONT( screenTitle ) Sets the title of the screen.
SharedStorage() Storage
showAlertDialog( message, [title] ) Displays an alert dialog to the user.
showAttachmentContents_CONT( contents, mimeType, fileName, waitDialogCallbackString ) Shows the given file contents in a content-appropriate way.
showAttachmentFromCache_CONT( uniqueKey, mimeType, fileName, waitDialogCallbackString ) Shows the given file contents in a content-appropriate way.
showCertificatePicker() This function opens a form on the device that allows the user to specify the credentials for the use of certificate-based authentication.
showConfirmDialog( message, [title] ) Shows a confirm dialog to the user.
showLocalAttachment( key ) Shows a local attachment.
showProgressDialog( [message] ) This function shows a progress dialog with spinner.
showUrlInBrowser( url ) This function opens the supplied URL in a browser.
shutdown() Shutdown the client connection to the SUP server.
startClient( [onNotification] ) Start the client connection to the SUP server.
this.getIconUrl( processed ) Gets the URL of this custom icon.
updateMessageProcessed( msgId, status ) Updates the message processed status.
updateMessageRead( msgId, status ) Updates the message read status.

Source

Callbacks.js, line 15.