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

📄 contactmanager.java

📁 The Funambol J2ME Mail Client aims to be a light, easy to use, free email client for J2ME devices.
💻 JAVA
字号:
/**
 * Copyright (C) 2006-2007 Funambol
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

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;
import javax.microedition.rms.RecordEnumeration;


/**
 * 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;
    
    /**
     * Searches for items that match the fields contained within the
     * specified string
     * @param substr which the contact's name has to match with
     * @return Enumeration of Contact objects
     * @throws ContactManagerException
     */
    public Enumeration searchContacts(String substr)
                                                 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();
     
    /**
     * Synchronize Contacts
     */
    public void sync() throws ConfigException, 
                                         SyncException, ContactManagerException;

    /**
     * Synchronize Contacts
     * @param mode is the sync mode 
     */
    public void sync(int mode) throws ConfigException,
                                         ContactManagerException, SyncException;
    
    /**
     * 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(); 
    
    
}

⌨️ 快捷键说明

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