Build 1.1_r1 (from source)

android.provider
Class Gmail.MessageCursor

java.lang.Object
  extended by android.database.ContentObserver
      extended by android.provider.Gmail.MailCursor
          extended by android.provider.Gmail.MessageCursor
Enclosing class:
Gmail

public static final class Gmail.MessageCursor
extends Gmail.MailCursor

A cursor over messages.


Field Summary
(package private)  long mInReplyToLocalMessageId
          Only valid if mCursor == null, in which case we are inserting a new message.
(package private)  boolean mPreserveAttachments
           
 
Fields inherited from class android.provider.Gmail.MailCursor
mAccount, mCursor
 
Constructor Summary
protected Gmail.MessageCursor(ContentResolver cr, String account, long inReplyToMessageId, boolean preserveAttachments)
           
  Gmail.MessageCursor(Gmail gmail, ContentResolver cr, String account, Cursor cursor)
           
 
Method Summary
 void addOrRemoveLabel(String label, boolean add)
          Adds a label to a message (if add is true) or removes it (if add is false).
 ArrayList<Gmail.Attachment> getAttachmentInfos()
           
 String[] getBccAddresses()
          Gets the message's bcc addresses.
 String getBody()
          Gets the message's body.
 boolean getBodyEmbedsExternalResources()
           
 String[] getCcAddresses()
          Gets the message's cc addresses.
 long getConversationId()
          Gets the message's conversation id.
 long getDateReceivedMs()
           
 long getDateSentMs()
           
 String getErrorText()
           
 boolean getExpanded()
          Deprecated.  
 String getFromAddress()
          Gets the message's from address.
 Set<Long> getLabelIds()
           
 String getListInfo()
           
 long getMessageId()
          Gets the message id of the current message.
 Gmail.PersonalLevel getPersonalLevel()
           
 String getRawLabelIds()
           
 String[] getReplyToAddress()
          Gets the message's replyTo address.
 String getSnippet()
          Gets the message's snippet (the short piece of the body).
 Gmail.CursorStatus getStatus()
           
 String getSubject()
          Gets the message's subject.
 String[] getToAddresses()
          Gets the message's to addresses.
protected  void onCursorPositionChanged()
          Called whenever mCursor is changed to point to a different row.
 void retry()
          Retry a network request after errors.
 
Methods inherited from class android.provider.Gmail.MailCursor
checkCursor, checkThread, count, deliverSelfNotifications, getAccount, getCursor, getStringInColumn, getUpdateValues, moveTo, next, onChange, position, registerContentObserver, registerDataSetObserver, registerObserver, release, unregisterContentObserver, unregisterDataSetObserver, unregisterObserver
 
Methods inherited from class android.database.ContentObserver
dispatchChange, getContentObserver, releaseContentObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mInReplyToLocalMessageId

long mInReplyToLocalMessageId
Only valid if mCursor == null, in which case we are inserting a new message.


mPreserveAttachments

boolean mPreserveAttachments
Constructor Detail

Gmail.MessageCursor

public Gmail.MessageCursor(Gmail gmail,
                           ContentResolver cr,
                           String account,
                           Cursor cursor)

Gmail.MessageCursor

protected Gmail.MessageCursor(ContentResolver cr,
                              String account,
                              long inReplyToMessageId,
                              boolean preserveAttachments)
Method Detail

onCursorPositionChanged

protected void onCursorPositionChanged()
Description copied from class: Gmail.MailCursor
Called whenever mCursor is changed to point to a different row. Subclasses should override this if they need to clear out state when this happens. Subclasses must call the inherited version if they override this.

Overrides:
onCursorPositionChanged in class Gmail.MailCursor

getStatus

public Gmail.CursorStatus getStatus()

retry

public void retry()
Retry a network request after errors.


getMessageId

public long getMessageId()
Gets the message id of the current message. Note that this is an immutable local message (not, for example, GMail's message id, which is immutable).

Returns:
the message's id

getConversationId

public long getConversationId()
Gets the message's conversation id. This must be immutable. (For example, with GMail this should be the original conversation id rather than the default notion of converation id.)

Returns:
the message's conversation id

getSubject

public String getSubject()
Gets the message's subject.

Returns:
the message's subject

getSnippet

public String getSnippet()
Gets the message's snippet (the short piece of the body). The snippet is generated from the body and cannot be set directly.

Returns:
the message's snippet

getFromAddress

public String getFromAddress()
Gets the message's from address.

Returns:
the message's from address

getToAddresses

public String[] getToAddresses()
Gets the message's to addresses.

Returns:
the message's to addresses

getCcAddresses

public String[] getCcAddresses()
Gets the message's cc addresses.

Returns:
the message's cc addresses

getBccAddresses

public String[] getBccAddresses()
Gets the message's bcc addresses.

Returns:
the message's bcc addresses

getReplyToAddress

public String[] getReplyToAddress()
Gets the message's replyTo address.

Returns:
the message's replyTo address

getDateSentMs

public long getDateSentMs()

getDateReceivedMs

public long getDateReceivedMs()

getListInfo

public String getListInfo()

getPersonalLevel

public Gmail.PersonalLevel getPersonalLevel()

getExpanded

public boolean getExpanded()
Deprecated. 


getBody

public String getBody()
Gets the message's body.

Returns:
the message's body

getBodyEmbedsExternalResources

public boolean getBodyEmbedsExternalResources()
Returns:
whether the message's body contains embedded references to external resources. In that case the resources should only be displayed if the user explicitly asks for them to be

getLabelIds

public Set<Long> getLabelIds()
Returns:
a copy of the set of label ids

getRawLabelIds

public String getRawLabelIds()
Returns:
a joined string of labels separated by spaces.

addOrRemoveLabel

public void addOrRemoveLabel(String label,
                             boolean add)
                      throws Gmail.NonexistentLabelException
Adds a label to a message (if add is true) or removes it (if add is false).

Parameters:
label - the label to add or remove
add - whether to add or remove the label
Throws:
Gmail.NonexistentLabelException - thrown if the named label does not exist

getAttachmentInfos

public ArrayList<Gmail.Attachment> getAttachmentInfos()

getErrorText

public String getErrorText()
Returns:
the error text for the message. Error text gets set if the server rejects a message that we try to save or send. If there is error text then the message is no longer scheduled to be saved or sent. Calling save() or send() will clear any error as well as scheduling another atempt to save or send the message.

Build 1.1_r1 (from source)

Please submit a feedback, bug or feature