Build 1.0_r1(from source)

android.provider
Class Gmail.MessageModification

java.lang.Object
  extended by android.provider.Gmail.MessageModification
Enclosing class:
Gmail

public static class Gmail.MessageModification
extends Object

A helper class for creating or updating messags. Use the putXxx methods to provide initial or new values for the message. Then save or send the message. To save or send an existing message without making other changes to it simply provide an emty ContentValues.


Constructor Summary
Gmail.MessageModification()
           
 
Method Summary
static String joinedAttachmentsString(List<Gmail.Attachment> attachments)
          The string produced here is parsed by Gmail.MessageCursor#getAttachmentInfos.
static void putAttachments(ContentValues values, List<Gmail.Attachment> attachments)
          Sets the attachments on a message.
static void putBccAddresses(ContentValues values, String[] bccAddresses)
          Sets the message's bcc address.
static void putBody(ContentValues values, String body)
          Saves a new body for the message.
static void putCcAddresses(ContentValues values, String[] ccAddresses)
          Sets the message's cc address.
static void putSubject(ContentValues values, String subject)
          Sets the message's subject.
static void putToAddresses(ContentValues values, String[] toAddresses)
          Sets the message's to address.
static void sendOrSaveExistingMessage(ContentResolver contentResolver, String account, long messageId, ContentValues updateValues, boolean save)
          Update an existing draft and save it as a new draft or send it.
static long sendOrSaveNewMessage(ContentResolver contentResolver, String account, ContentValues values, long refMessageId, boolean save)
          Create a new message and save it as a draft or send it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gmail.MessageModification

public Gmail.MessageModification()
Method Detail

putSubject

public static void putSubject(ContentValues values,
                              String subject)
Sets the message's subject. Only valid for drafts.

Parameters:
values - the ContentValues that will be used to create or update the message
subject - the new subject

putToAddresses

public static void putToAddresses(ContentValues values,
                                  String[] toAddresses)
Sets the message's to address. Only valid for drafts.

Parameters:
values - the ContentValues that will be used to create or update the message
toAddresses - the new to addresses

putCcAddresses

public static void putCcAddresses(ContentValues values,
                                  String[] ccAddresses)
Sets the message's cc address. Only valid for drafts.

Parameters:
values - the ContentValues that will be used to create or update the message
ccAddresses - the new cc addresses

putBccAddresses

public static void putBccAddresses(ContentValues values,
                                   String[] bccAddresses)
Sets the message's bcc address. Only valid for drafts.

Parameters:
values - the ContentValues that will be used to create or update the message
bccAddresses - the new bcc addresses

putBody

public static void putBody(ContentValues values,
                           String body)
Saves a new body for the message. Only valid for drafts.

Parameters:
values - the ContentValues that will be used to create or update the message
body - the new body of the message

putAttachments

public static void putAttachments(ContentValues values,
                                  List<Gmail.Attachment> attachments)
Sets the attachments on a message. Only valid for drafts.

Parameters:
values - the ContentValues that will be used to create or update the message
attachments -

sendOrSaveNewMessage

public static long sendOrSaveNewMessage(ContentResolver contentResolver,
                                        String account,
                                        ContentValues values,
                                        long refMessageId,
                                        boolean save)
Create a new message and save it as a draft or send it.

Parameters:
contentResolver - the content resolver to use
account - the account to use
values - the values for the new message
refMessageId - the message that is being replied to or forwarded
save - whether to save or send the message
Returns:
the id of the new message

sendOrSaveExistingMessage

public static void sendOrSaveExistingMessage(ContentResolver contentResolver,
                                             String account,
                                             long messageId,
                                             ContentValues updateValues,
                                             boolean save)
Update an existing draft and save it as a new draft or send it.

Parameters:
contentResolver - the content resolver to use
account - the account to use
messageId - the id of the message to update
updateValues - the values to change. Unspecified fields will not be altered
save - whether to resave the message as a draft or send it

joinedAttachmentsString

public static String joinedAttachmentsString(List<Gmail.Attachment> attachments)
The string produced here is parsed by Gmail.MessageCursor#getAttachmentInfos.


Build 1.0_r1(from source)

Please submit a feedback, bug or feature