2008-11-01 17:32:06 -04:00
|
|
|
|
2008-12-16 18:34:01 -05:00
|
|
|
package com.android.email.mail;
|
2008-11-01 17:32:06 -04:00
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public abstract class Multipart implements Body
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
protected Part mParent;
|
|
|
|
|
|
|
|
protected ArrayList<BodyPart> mParts = new ArrayList<BodyPart>();
|
|
|
|
|
|
|
|
protected String mContentType;
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public void addBodyPart(BodyPart part) throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
mParts.add(part);
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public void addBodyPart(BodyPart part, int index) throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
mParts.add(index, part);
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public BodyPart getBodyPart(int index) throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
return mParts.get(index);
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public String getContentType() throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
return mContentType;
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public int getCount() throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
return mParts.size();
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public boolean removeBodyPart(BodyPart part) throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
return mParts.remove(part);
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public void removeBodyPart(int index) throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
mParts.remove(index);
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public Part getParent() throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
return mParent;
|
|
|
|
}
|
|
|
|
|
2009-11-24 19:40:29 -05:00
|
|
|
public void setParent(Part parent) throws MessagingException
|
|
|
|
{
|
2008-11-01 17:32:06 -04:00
|
|
|
this.mParent = parent;
|
|
|
|
}
|
|
|
|
}
|