Zimlet JavaScript API Reference - ZmComposeController

Class ZmComposeController


Extends ZmController.

This class manages message composition.

Defined in: ZmComposeController.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmComposeController(container, mailApp, type, sessionId)
Creates a new compose controller to manage message composition.
Field Summary
Field Attributes Field Name and Description
<static>  
ZmComposeController.DRAFT_TYPE_AUTO
Defines the "auto" draft type reason.
<static>  
ZmComposeController.DRAFT_TYPE_DELAYSEND
Defines the "delaysend" draft type reason.
<static>  
ZmComposeController.DRAFT_TYPE_MANUAL
Defines the "manual" draft type reason.
<static>  
ZmComposeController.DRAFT_TYPE_NONE
Defines the "none" draft type reason.
Method Summary
Method Attributes Method Name and Description
 
Detaches compose view to child window.
 
doAction(params, action, inNewWindow, msg, toOverride, ccOverride, subjOverride, extraBodyText, callback, accountName, accountName, hideView)
Begins a compose session by presenting a form to the user.
 
Return ZmMailMsg object
 
Gets the selected signature.
 
Creates a new ZmComposeView if one does not already exist
<static>  
ZmComposeController.readFilesAsDataURL(files, callback, errorCallback)
Read files in DataURL Format and execute the callback with param dataURLArray.
 
resetSignatureToolbar(selected, account)
Resets the signature dropdown based on the given account and selects the given signature if provided.
 
sendDocs(docIds, draftType, callback, contactId)
Sends the message represented by the content of the compose view with specified docIds as attachment.
 
sendMsg(attId, draftType, callback, processImages, processImages)
Sends the message represented by the content of the compose view.
 
Gets the selected signature.
 
Toggles the spell check button.
Methods borrowed from class ZmController:
getApp, getCurrentViewId, getCurrentViewType, getKeyMapName, getNewFolderCallback, getSessionId, getTabGroup, getViewElements, handleKeyAction, isTransient, mapSupported, popupErrorDialog, popupUploadErrorDialog, setCurrentViewId, setCurrentViewType, setSessionId
Class Detail
ZmComposeController(container, mailApp, type, sessionId)
Creates a new compose controller to manage message composition.
Author: Conrad Damon.
Parameters:
{DwtShell} container
the containing shell
{ZmApp} mailApp
the containing app
{constant} type
controller type
{string} sessionId
the session id
Field Detail
<static> ZmComposeController.DRAFT_TYPE_AUTO
Defines the "auto" draft type reason.

<static> ZmComposeController.DRAFT_TYPE_DELAYSEND
Defines the "delaysend" draft type reason.

<static> ZmComposeController.DRAFT_TYPE_MANUAL
Defines the "manual" draft type reason.

<static> ZmComposeController.DRAFT_TYPE_NONE
Defines the "none" draft type reason.
Method Detail
detach()
Detaches compose view to child window.

doAction(params, action, inNewWindow, msg, toOverride, ccOverride, subjOverride, extraBodyText, callback, accountName, accountName, hideView)
Begins a compose session by presenting a form to the user.
Parameters:
{Hash} params
a hash of parameters:
{constant} action
the new message, reply, forward, or an invite action
{Boolean} inNewWindow
if true, we are in detached window
{ZmMailMsg} msg
the original message (reply/forward), or address (new message)
{String} toOverride
the initial value for To: field
{String} ccOverride
Cc: addresses (optional)
{String} subjOverride
the initial value for Subject: field
{String} extraBodyText
the canned text to prepend to body (invites)
{AjxCallback} callback
the callback to run after view has been set
{String} accountName
the on-behalf-of From address
{String} accountName
on-behalf-of From address
{boolean} hideView
if true, don't show compose view

{ZmMailMsg} getMsg()
Return ZmMailMsg object
Returns:
{ZmMailMsg} message object

{String} getSelectedSignature()
Gets the selected signature.
Returns:
{String} the selected signature key or null if none selected

initComposeView()
Creates a new ZmComposeView if one does not already exist

<static> ZmComposeController.readFilesAsDataURL(files, callback, errorCallback)
Read files in DataURL Format and execute the callback with param dataURLArray. dataURLArray is an array of objects, with each object containing name, type, size and data in data-url format for an file.
Parameters:
{FileList} files
Object containing one or more files
{AjxCallback/Bound} callback
the success callback
{AjxCallback/Bound} errorCallback
the error callback

resetSignatureToolbar(selected, account)
Resets the signature dropdown based on the given account and selects the given signature if provided.
Parameters:
selected
[String]* ID of the signature to select
account
[ZmZimbraAccount]* account for which to load signatures

sendDocs(docIds, draftType, callback, contactId)
Sends the message represented by the content of the compose view with specified docIds as attachment.
Parameters:
{Array} docIds
the document Ids
{constant} draftType
the draft type (see ZmComposeController.DRAFT_TYPE_ constants)
{AjxCallback} callback
the callback
contactId

sendMsg(attId, draftType, callback, processImages, processImages)
Sends the message represented by the content of the compose view.
Parameters:
{String} attId
the id
{constant} draftType
the draft type (see ZmComposeController.DRAFT_TYPE_ constants)
{AjxCallback} callback
the callback
{Boolean} processImages
remove webkit-fake-url images and upload data uri images
processImages

setSelectedSignature(value)
Gets the selected signature.
Parameters:
{String} value
the selected signature key

toggleSpellCheckButton(selected)
Toggles the spell check button.
Parameters:
{Boolean} selected
if true, toggle the spell check to "selected"

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:35 GMT-0400 (EDT)