javaextensions/pim/javasrc/javax/microedition/pim/PIM.java
branchRCL_3
changeset 19 04becd199f91
child 67 63b81d807542
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Abstract PIM manager class.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // PACKAGE
       
    20 package javax.microedition.pim;
       
    21 
       
    22 // IMPORTS
       
    23 import java.io.UnsupportedEncodingException;
       
    24 import com.nokia.mj.impl.rt.support.Jvm;
       
    25 
       
    26 // CLASS DEFINITION
       
    27 /**
       
    28  * PIM API 1.0 compliant PIM class. Minor parts of the PIM class implementation
       
    29  * are included in this class (mandatory initializations).
       
    30  * com.nokia.microedition.pim.PIMManager contains the most of the class
       
    31  * implementation.
       
    32  */
       
    33 public abstract class PIM
       
    34 {
       
    35     public static final int CONTACT_LIST = 1;
       
    36 
       
    37     public static final int EVENT_LIST = 2;
       
    38 
       
    39     public static final int TODO_LIST = 3;
       
    40 
       
    41     public static final int READ_ONLY = 1;
       
    42 
       
    43     public static final int WRITE_ONLY = 2;
       
    44 
       
    45     public static final int READ_WRITE = 3;
       
    46 
       
    47     /**
       
    48      * @par Implementation notes:
       
    49      * @li The repeat rule invoker must be initialized before anything else is
       
    50      *     done, for which the PIM class static initialization block suits just
       
    51      *     fine.
       
    52      */
       
    53     static
       
    54     {
       
    55         try
       
    56         {
       
    57             Jvm.loadSystemLibrary("javapim");
       
    58         }
       
    59         catch (Exception e)
       
    60         {
       
    61         }
       
    62         RepeatRuleInvokerImpl.initialize();
       
    63     }
       
    64 
       
    65     /**
       
    66      * @par Implementation notes:
       
    67      * @li An singleton instance of com.nokia.microedition.pim.PIMManager is
       
    68      *     returned.
       
    69      */
       
    70     public static PIM getInstance()
       
    71     {
       
    72         return com.nokia.mj.impl.pim.PIMManager.getInstance();
       
    73     }
       
    74 
       
    75     /**
       
    76      * @par Implementation notes:
       
    77      * @li The constructor must not be publicly accessible.
       
    78      */
       
    79     protected PIM()
       
    80     {
       
    81     }
       
    82 
       
    83     public abstract PIMList openPIMList(int aPimListType, int aMode)
       
    84     throws PIMException;
       
    85 
       
    86     public abstract PIMList openPIMList(int aPimListType, int aMode,
       
    87                                         String aName) throws PIMException;
       
    88 
       
    89     public abstract String[] listPIMLists(int aPimListType);
       
    90 
       
    91     public abstract PIMItem[] fromSerialFormat(java.io.InputStream aIs,
       
    92             String aEnc) throws PIMException, UnsupportedEncodingException;
       
    93 
       
    94     public abstract void toSerialFormat(PIMItem aItem,
       
    95                                         java.io.OutputStream aOs, String aEnc, String aDataFormat)
       
    96     throws PIMException, UnsupportedEncodingException;
       
    97 
       
    98     public abstract String[] supportedSerialFormats(int aPimListType);
       
    99 }