FileDocCategorySizeDatePackage
ConversationHeader.javaAPI DocAndroid 1.5 API5069Wed May 06 22:42:46 BST 2009com.android.mms.ui

ConversationHeader

public class ConversationHeader extends Object
A holder class for a conversation header.

Fields Summary
private long
mThreadId
private String
mSubject
private String
mDate
private boolean
mHasAttachment
private boolean
mIsRead
private boolean
mHasError
private boolean
mHasDraft
private int
mMessageCount
private final Object
mFromLock
private String
mFrom
private int
mPresenceResId
private ConversationHeaderView
mViewWaitingForFromChange
Constructors Summary
public ConversationHeader()


    // Needed because it's Parcelable
      
    
public ConversationHeader(long threadId, String from, String subject, String date, boolean isRead, boolean hasError, boolean hasDraft, int messageCount, boolean hasAttachment)

        mThreadId = threadId;
        mFrom = from;  // may be null
        mPresenceResId = 0;
        mSubject = subject != null ? subject : "";
        mDate = date != null ? date : "";
        mIsRead = isRead;
        mHasError = hasError;
        mHasDraft = hasDraft;
        mMessageCount = messageCount;
        mHasAttachment = hasAttachment;
    
Methods Summary
private voidconditionallyRunFromChangedCallback()

        synchronized (mFromLock) {
            if (mViewWaitingForFromChange != null && mFrom != null) {
                mViewWaitingForFromChange.onHeaderLoaded(this);
                mViewWaitingForFromChange = null;
            }
        }
    
public java.lang.StringgetDate()

return
Returns the date.

        return mDate;
    
public java.lang.StringgetFrom()

return
Returns the from. (formatted for display)

        synchronized (mFromLock) {
            return mFrom;
        }
    
public intgetMessageCount()

return
message count of the thread.

        return mMessageCount;
    
public intgetPresenceResourceId()

        synchronized (mFromLock) {
            return mPresenceResId;
        }
    
public java.lang.StringgetSubject()

return
Returns the subject.

        return mSubject;
    
public longgetThreadId()

return
Returns the ID of the thread.

        return mThreadId;
    
public booleanhasAttachment()

return
Returns the hasAttachment.

        return mHasAttachment;
    
public booleanhasDraft()

return
Whether the thread has a draft.

        return mHasDraft;
    
public booleanhasError()

return
Whether the thread has a transmission error.

        return mHasError;
    
public booleanisRead()

return
Returns the isRead.

        return mIsRead;
    
public voidsetFrom(java.lang.String from)

        synchronized (mFromLock) {
            mFrom = from;
            conditionallyRunFromChangedCallback();
        }
    
public voidsetFromAndPresence(java.lang.String from, int presenceResId)

        synchronized (mFromLock) {
            mFrom = from;
            mPresenceResId = presenceResId;
            conditionallyRunFromChangedCallback();
        }
    
public voidsetWaitingView(ConversationHeaderView headerView)
Called by the {@link ConversationHeaderView} when it wants to register for updates to the model (only the from name of which is mutable.

        synchronized (mFromLock) {
            mViewWaitingForFromChange = headerView;
            conditionallyRunFromChangedCallback();
        }
    
public java.lang.StringtoString()

        return "[ConversationHeader from:" + getFrom() + " subject:" + getSubject()
        + "]";