亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? messageheader.java

?? 手機郵箱撒的方式方式方式的
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
package mujmail;

/*
MujMail - Simple mail client for J2ME
Copyright (C) 2006 Nguyen Son Tung <n.sontung@gmail.com>
Copyright (C) 2006 Martin Stefan <martin.stefan@centrum.cz>
Copyright (C) 2008 David Hauzar <david.hauzar.mujmail@gmail.com>
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

import java.util.Date;
import java.util.Vector;

import javax.microedition.lcdui.AlertType;

import mujmail.account.MailAccount;
import mujmail.util.Functions;
//#ifdef MUJMAIL_SEARCH
import mujmail.search.MessageSearchResult;
//#endif

/**
 * Represents the header of the mail. 
 * It contains list of BodyParts (body of the mail + attachments) of given 
 * mail.
 * It stores information from which account it was downloaded (accountID).
 * The header is stored in rms database (recordID)
 */
public class MessageHeader {

      /* ****************
       *    CONSTANTS   *
       ******************/

	private static final boolean DEBUG = false;
    private static final String EMPTY_STRING = "";


    // formats of message
    public static final byte FRT_PLAIN = 0;
    public static final byte FRT_MULTI = 1;
    
    //body-fetch status
    public static final byte NOT_READ = 0; //if was read by user, is set by mailForm
    public static final byte READ = 1;
    //if a header was stored on the device
    public static final byte NOT_STORED = 0;
    public static final byte STORED = 1; //if the header(not bodyparts) was stored once, no need to saved it once more in MailDb.saveHeaders()
    //the size of bodyparts vector indicates whether each bodypart was stored
    //because when a bodypart is stored to DB, bodyparts vector's size is increased
    //body-sent status
    public static final byte FAILED_TO_SEND = 0;
    public static final byte TO_SEND = 1;
    public static final byte SENT = 2;
    public static final byte REPLIED = 4;
    
    /** Message ID separator beetween Folder name and messageID obtained from server
     *  See RFC3501 5.1.  // character This should not contain mailbox mane
     */
    public static final char MSG_ID_SEPARATOR = '&';
    /** String representation of {@link #MSG_ID_SEPARATOR} char */
    public static final String MSG_ID_SEPARATOR_STR = new String( String.valueOf( MSG_ID_SEPARATOR ) );
      /* *************************
       *    INSTANCE VARIABLES   *
       ***************************/

    //#ifdef MUJMAIL_SEARCH
    /** Search result of the message. This item makes sense only when the message
     has been searched and it was returned as the result of searching. */
    private MessageSearchResult searchResult = MessageSearchResult.NO_MATCH;
    //#endif
    /** The record ID of the header in rms database */
    private int recordID;
    /** Original box where the message was before being deleted */
    private char orgLocation;
    //we must initiate from and recipients otherwise sort wont always work
    private String from;
    //we must initiate from and recipients otherwise sort wont always work
    private String recipients;
    private String subject;

    /**
     * Contains value of the boundary parameter of the Content-Type field.
     * <p>
     * Example:<br>
     * if header contains line
     * <pre>Content-Type: multipart/related; boundary=0016e659f8c86d2f8b0463bf768e</pre>
     * than the <code>boundary</code> value is 0016e659f8c86d2f8b0463bf768e
     * </p>
     */
    private String boundary;
    /** Unique primary key, that is by the way used to test existence of a mail in the mobile device; */
    private String messageID;
    /** Folder name where on server mail is stored */
    private String imapFolder;
    /**
     * This field represents content of Message-ID field in e-mail message
     * header. It used in threading algorithm to reference to parent message.
     * 
     * While "Message-ID" field is optional in e-mail header (see
     * <a href="http://tools.ietf.org/html/rfc5322#section-3.6.4">RFC 5322,
     * section 3.6.4</a>), when not found in message header value from
     * {@link #messageID} is used.
     */
    private String threadingMessageID;
    /** Account from which the mail was downloaded - must be given for every mail */
    private String accountID;
    byte messageFormat;
      // TODO (Betlista): why aren't these statuses commented ?
    byte readStatus;
    byte DBStatus;
    byte sendStatus;

    /**
     * Represents size of the email. The size is in bytes and could be little
     * bit different from real received message size.
     */
    private int size; //in Bytes
    private long time;
    boolean deleted = false;
    boolean flagged = false;
    // bodyParts vector is here to cache reading and displaying mail parts	
    private Vector bodyParts = new Vector();
    // attachFileParts vector stores attachment file name, path and size
    //Vector attachFileParts = new Vector();

      // fields used in threading
    /** flag that indicates whether the message is empty (have no body) */
    // TODO: that is not true: the message has no body if message.getBodyPartCount() == 0
    // this is some threading field!!
    private boolean isEmpty = true;
    /**
     * Represents thread parent - all messages in thread have same parent 
     * parent message can be empty (see {@link #isEmpty})
     * parent ID can be empty, but it's not null, it's ""
     * 
     * Parent ID is stored also in {@link #parentIDs parentIDs vector}.
     * Parent ID could be changed when threading of messages is performed.
     */
    private String parentID = null;
    /**
     * Represents value of <code>In-Reply-To</code> header from e-mail header.
     * There is (just small) probability that there is no messageID in this header.
     */
    private String replyTo = null;
    /**
     * Represents path to root message.
     * It can be empty (Vector with 0 size).
     * It is never null, to prevent comparing with null again and again.
     */
    private Vector/*<String>*/ parentIDs = null;

    /** The box to which this message belongs */
    private final PersistentBox box;

      /* *******************
       *    CONSTRUCTORS   *
       *********************/

    public MessageHeader(PersistentBox box) {
        this.box = box;
        orgLocation = 'X';
        from = "+sender@server.com+";
        recipients = "+recipient@server.com+";
        subject = EMPTY_STRING;
        accountID = "mujmail@cia.gov";
        messageFormat = FRT_PLAIN;
        readStatus = NOT_READ;
        DBStatus = NOT_STORED;
        sendStatus = TO_SEND;
        parentIDs = new Vector();
        parentID = EMPTY_STRING;
        threadingMessageID = Long.toString( System.currentTimeMillis(), 35 ) + "@mujmail.org";
        isEmpty = false;
        imapFolder = EMPTY_STRING;
    }    

    /**
     * Makes a copy of given message header. Does not copy bodyparts.
     * @param box
     * @param copy
     */
    public MessageHeader(PersistentBox box, MessageHeader copy) {
        this(box);
        orgLocation = copy.orgLocation;
        recordID = copy.recordID;
        from = copy.from;
        recipients = copy.recipients;
        subject = copy.subject;
        boundary = copy.boundary;
        messageID = copy.messageID;
        imapFolder = copy.imapFolder;
        accountID = copy.accountID;
        messageFormat = copy.messageFormat;
        readStatus = copy.readStatus;
        DBStatus = copy.DBStatus;
        sendStatus = copy.sendStatus;
        size = copy.size;
        time = copy.time;
        deleted = copy.deleted;

        threadingMessageID = copy.threadingMessageID;
        parentID = copy.parentID;
        Vector copyParentIDs = copy.parentIDs;
        if ( copyParentIDs != null ) {
            final int size = copyParentIDs.size();
            parentIDs = new Vector( size );
            for ( int i = 0; i < size; ++i) {
                parentIDs.addElement( copyParentIDs.elementAt( i ) );
            }
        }
    }

    /*
     * call this when sending a new mail
     * practically we don't need to create an instance of MessageHeader to send a simple mail, just use strings
     * but this constructor will be needed when forwarding or send a multipart mail.
     * ID must be generated randomly for each header.
     * So we create one extra MessageHeader instance...
     */
    public MessageHeader(PersistentBox box, String frm, String rcps, String sbj, String ID, long tm) {
        this(box);
        from = frm;
        recipients = rcps;
        subject = sbj;
        messageID = ID;
        time = tm;
    }

      /* **************************
       *    GETTERS AND SETTERS   *
       ****************************/

    /**
     * Gets the box to which this message belongs.
     * @return
     */
    public PersistentBox getBox() {
        return box; 
    }
    
    public MailDB getMailDB() {
        return box.getMailDB();
    }
    
    /**
     * Returns true if this message is special threading message.
     * @return
     */
    public boolean isEmpty() {
        return isEmpty;
    }

    /**
     *
     * @param isEmpty true if this message is special threading message
     */
    public void setEmpty(boolean isEmpty) {
        this.isEmpty = isEmpty;
    }

    public String getParentID() {
        return parentID;
    }

    public void setParentID(String parentID) {
        if (parentID == null) {
            this.parentID = EMPTY_STRING;
        } else {
        	if ( parentID.equals( this.threadingMessageID ) ) {
        		System.out.println( "ERROR MessageHeader.setParentID(String) - trying to set parentID same as the threadingMessageID" );
        		if (DEBUG) {
        			System.out.println( "DEBUG MessageHeader.setParentID(String) - header: " + this.toString() );
        			throw new IllegalArgumentException();
        		}
        	} else {
        		this.parentID = parentID;
        	}
        }
    }

    public String getReplyTo() {
        return replyTo;
    }

    public void setReplyTo(String replyTo) {
        this.replyTo = replyTo;
    }

    public Vector/*<String>*/ getParentIDs() {
        return parentIDs;
    }

    public void setParentIDs(Vector parentIDs) {
        if ( parentIDs == null ) {
            this.parentIDs = new Vector(0);
        } else {
            this.parentIDs = parentIDs;
        }
    }

    public int getRecordID() {
        return recordID;
    }

    public void setRecordID(int recordID) {
        this.recordID = recordID;
    }

    public void setRecipients(String recipients) {
        this.recipients = recipients;
    }

    public void setOrgLocation(char orgLocation) {
        this.orgLocation = orgLocation;
    }

    public char getOrgLocation() {
        return orgLocation;
    }

    /**
     * Call if this message failed to send.
     */
    public void setFailedToSend() {
        sendStatus = FAILED_TO_SEND;
    }
    
    /**
     * Call if this message was successfully sent.
     */
    public void setSent() {
        sendStatus = SENT;
    }
    
    /**
     * Returns true if this message was already read.
     * @return true if this message was already read.
     */
    public boolean wasRead() {
        return readStatus == READ;
    }
    
    /**
     * Marks this message as plain message.
     */
    public void markAsPlain() {
        messageFormat = FRT_PLAIN;
    }
    
    /**
     * Marks this message as multipart message.
     */
    public void markAsMultipart() {
        messageFormat = FRT_MULTI;
    }
    
    /**
     * Marks this message as read.
     */
    public void markAsRead() {
        readStatus = READ;
    }
    
    /**
     * Adds recipient to the message.
     * @param recipient the recipient to be added.
     */
    public void addRecipient(String recipient) {
        if (recipients.startsWith("+")) //has default value
        {
            recipients = recipient + " *";
        } else {
            recipients += recipient + " *";
        }
    }
    
    public String toString() {
        return super.toString() + "/n Number of bodyparts = " + getBodyPartCount();
    }
    
    /**
     * Ensures whether there is a recipient specified. If not, adds default 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本乱人伦aⅴ精品| 久久久亚洲高清| 欧美成人激情免费网| 亚洲人成人一区二区在线观看 | 国产一区二区三区高清播放| 99久久精品国产观看| 欧美精品一区二区久久婷婷 | 欧美亚日韩国产aⅴ精品中极品| 日韩精品一区二区三区中文不卡| 一区二区在线观看视频| 国产精品一级黄| 日韩视频免费观看高清完整版 | 欧美亚洲高清一区| **性色生活片久久毛片| 狠狠色丁香九九婷婷综合五月| 色噜噜狠狠色综合中国| 国产精品网站在线观看| 韩国精品一区二区| 精品国产99国产精品| 日本大胆欧美人术艺术动态| 在线影视一区二区三区| 亚洲欧洲av在线| 成人免费毛片aaaaa**| 久久久久久久综合狠狠综合| 九九**精品视频免费播放| 欧美一区二区三区在线观看| 天堂蜜桃91精品| 337p亚洲精品色噜噜噜| 日韩精品免费专区| 91精品国产综合久久精品图片 | 日韩欧美国产一区二区三区| 午夜精品国产更新| 欧美日本在线播放| 五月天国产精品| 91精品国产欧美日韩| 日本不卡视频在线| 日韩欧美成人一区| 国产精品一卡二| 国产精品剧情在线亚洲| 91丨porny丨首页| 亚洲男人的天堂在线观看| 日本国产一区二区| 亚洲va国产va欧美va观看| 欧美老女人在线| 久久99久久久久| 国产精品网站在线观看| 91搞黄在线观看| 日韩成人dvd| 久久亚洲影视婷婷| 99国产精品久久久久| 亚洲精品高清视频在线观看| 欧美日韩视频在线观看一区二区三区| 日韩av一区二| 久久久久高清精品| 色婷婷国产精品| 午夜国产精品影院在线观看| 精品国产乱码久久久久久夜甘婷婷 | 国产女同互慰高潮91漫画| 波多野结衣精品在线| 亚洲动漫第一页| 久久综合精品国产一区二区三区| 成人免费av资源| 亚洲成人午夜影院| 国产日韩欧美a| 欧美日韩中文一区| 国内精品免费**视频| 亚洲日穴在线视频| 日韩手机在线导航| 91性感美女视频| 久久成人av少妇免费| 亚洲视频免费在线观看| 日韩欧美一级二级三级| 99国内精品久久| 精品一区二区三区在线观看| 日韩理论片在线| 欧美大黄免费观看| 91极品美女在线| 国产精品99久久久久久久vr| 亚洲永久免费视频| 国产精品色噜噜| 日韩午夜精品视频| 欧美亚洲国产怡红院影院| 大胆亚洲人体视频| 麻豆成人91精品二区三区| 亚洲精品菠萝久久久久久久| 久久精品在线观看| 日韩视频永久免费| 欧美三级午夜理伦三级中视频| 国产精品77777| 日本v片在线高清不卡在线观看| 亚洲精品日日夜夜| 欧美国产日本视频| 久久久久青草大香线综合精品| 欧美日韩中字一区| 在线免费av一区| 91啪在线观看| 成人高清av在线| 国产99久久久精品| 国产一区免费电影| 久久99久久久久| 久久精品国产精品亚洲综合| 亚洲动漫第一页| 亚洲午夜视频在线观看| 亚洲欧美日韩在线| 亚洲三级久久久| 亚洲精品va在线观看| 亚洲欧美另类小说| 日韩美女视频一区| 亚洲人成伊人成综合网小说| 亚洲欧美视频在线观看| 亚洲欧美日韩人成在线播放| 国产精品久99| 成人免费视频在线观看| 国产精品久久久久久久久免费樱桃| 久久精品一区蜜桃臀影院| 国产亚洲午夜高清国产拍精品| 亚洲精品在线观看网站| 精品精品国产高清a毛片牛牛| 日韩精品一区二区三区四区| 国产精品视频免费| 国产精品久久久久久一区二区三区 | 成人午夜av电影| 亚洲超碰97人人做人人爱| 亚洲欧美日韩在线播放| 国产精品无人区| 日韩欧美专区在线| 精品久久国产老人久久综合| 激情丁香综合五月| 成人午夜在线播放| 99久久精品国产导航| 91蜜桃在线观看| 色88888久久久久久影院按摩| 精品1区2区3区| 日韩欧美国产1| 国产欧美va欧美不卡在线| 亚洲视频资源在线| 日韩电影免费一区| 国产suv一区二区三区88区| 99精品黄色片免费大全| 亚洲大型综合色站| 亚洲综合丝袜美腿| 日韩制服丝袜先锋影音| 精品一区二区三区在线播放| 成人一级片网址| 在线一区二区三区| 日韩美女在线视频 | 精品一区二区三区不卡| 高清不卡在线观看| 在线区一区二视频| 欧美xxxx在线观看| 亚洲人成7777| 久久精品国产一区二区| 成人午夜视频网站| 欧美丰满一区二区免费视频| 久久精品在线免费观看| 亚洲丰满少妇videoshd| 成人晚上爱看视频| 欧美精品国产精品| 亚洲婷婷在线视频| 狠狠色狠狠色综合系列| 色欧美乱欧美15图片| 2024国产精品| 亚洲成人动漫在线免费观看| 国产成人精品亚洲777人妖 | 日韩av一区二| 91色.com| 国产午夜精品理论片a级大结局| 亚洲超碰97人人做人人爱| 不卡av免费在线观看| 久久综合精品国产一区二区三区| 亚洲国产欧美日韩另类综合 | 久久99国产精品成人| 色丁香久综合在线久综合在线观看| 欧美激情在线一区二区| 懂色av中文字幕一区二区三区| 91精品国产福利| 亚洲成av人片www| 日韩欧美一区在线观看| 蜜臀精品久久久久久蜜臀| 欧美吻胸吃奶大尺度电影| 亚洲国产精品久久艾草纯爱| 91麻豆视频网站| 五月激情丁香一区二区三区| 色综合天天综合色综合av| 青青草成人在线观看| 久久人人爽人人爽| 日本视频中文字幕一区二区三区| 色狠狠综合天天综合综合| 中文字幕字幕中文在线中不卡视频| 国产乱人伦精品一区二区在线观看 | 奇米影视一区二区三区| 欧美三级中文字幕| 亚洲精品成人精品456| 色哟哟精品一区| 一区二区三区在线观看视频| 91日韩在线专区| 一区二区三区四区在线| 在线精品视频免费播放| 一区二区三区在线免费| 欧美日韩国产中文|