⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contactmanager.java

📁 moblie syncml mail javame
💻 JAVA
字号:
/**
 * Funambol is a mobile platform developed by Funambol, Inc. 
 * Copyright (C) 2003 - 2007 Funambol, Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by
 * the Free Software Foundation with the addition of the following permission 
 * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
 * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
 * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
 * 
 * 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 Affero General Public License 
 * along with this program; if not, see http://www.gnu.org/licenses or write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301 USA.
 * 
 * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
 * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License
 * version 3, these Appropriate Legal Notices must retain the display of the
 * "Powered by Funambol" logo. If the display of the logo is not reasonably 
 * feasible for technical reasons, the Appropriate Legal Notices must display
 * the words "Powered by Funambol".
 */

package com.funambol.mailclient.cm;

import com.funambol.mailclient.syncml.PimItem;
import com.funambol.mailclient.config.ConfigException;
import com.funambol.syncml.spds.SyncException;
import java.util.Enumeration;


/**
 * A simple interface for building a ContactManager
 */
public interface ContactManager {
    /** RMS Contact Store index*/
    public static int RMS_TYPE = 0;

    /** JSR75 Contact Store index*/
    public static int JSR75_TYPE = 1;
    
    /** Max Size of the Contact List*/
    public static int CONTACT_LIST_MAX_SIZE = 100;
    
    /**
     * Add a Contact Object to the ContactList.
     * @param contact the Contact object to be added
     * @param checkContactExistence if true checks if this contact exists
     * @return the id of the contact added to the ContactList
     * @throws ContactManagerException
     */
    public int addContact(Contact contact, boolean checkContactExistence) 
                                                 throws ContactManagerException;
    
    /**
     * Add a Contact Object to the ContactList.
     * @param contact the Contact object to be added
     * @return the id of the contact added to the ContactList
     * @throws ContactManagerException
     */
    public int addContact(Contact contact) throws ContactManagerException;
    
      
    /**
     * 
     * 
     * @param id used to retrieve a contact stored in the contact list
     * @return Contact object with the matching id
     * @throws ContactManagerException
     */
    public Contact getContact(int id) throws ContactManagerException;
    
    /**
     * This method removes a contact by id.
     * @param id used for removing a contact from the ContactList
     * @throws ContactManagerException
     */
    public void removeContact(int id) throws ContactManagerException;
    
    /**
     * This method a contact given contact's id.
     * @param id used for accessing the contact
     * @throws ContactManagerException
     */
    public void updateContact(Contact contact) throws ContactManagerException;
    
    /**
     * Returns full address list
     * @return Enumeration sorted by last and first name of the contact list 
     */
    public Enumeration getContactList() throws ContactManagerException;
    
    /**
     * get all new/updated/deleted sync items info 
     * @param state is the state of the searched items
     * @return Enumeration with all sync item showing the required state 
     */
    public Enumeration getSyncItems(char state);
    
    /**
     * remove a sync item info from the sync item queue
     * @param key is the key of the item to be removed
     */
    public void removeSyncItem(String key);
    
    /**
     * get a sync item info from the sync item queue
     * @param key is the key of access of the syn item
     */
    public PimItem getSyncItemInfo(String key);
    
    /**
     * Add a sync item to the sync item queue
     * @param key is the key of the item to be added
     * @param status is the status of the item to be added
     */
    public void addSyncItem(String key, char status);

    /**
     * reset contact list and syncItemList
     */
    public void resetContactList();
     
    
    /**
     * Set default max number of contact
     * @param defaultContactNumber is the new value to be stored
     */
    public void setDefaultContactNumber(int defaultContactNumber); 
    
    /**
     * Get default max number of contact
     * @return int value of default max message number 
     */
    public int getDefaultContactNumber(); 
    
    /**
     * Get current number of contact managed by Contact Manager
     * @return int value of default contact number 
     */
    public int getContactCount(); 
    
    
    /**
     * set the contactmanaegr listener
     * @param listener the new listener, or null to suspend notifications
     */
    public void setListener(ContactManagerListener listener);
    
    /**
     * Search for the existence of a contact
     * @param email is the mail of the contact
     * @return Contact if the contact exists, null otherwise
     */
    public Contact exists(String email) throws ContactManagerException;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -