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

📄 pim_list.c

📁 java 1.1 gemini 08_16
💻 C
📖 第 1 页 / 共 5 页
字号:
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
}


/*****************************************************************************
 * FUNCTION
 *  Java_com_ibm_oti_pim_PIMListImpl_nextRecordWithMatchStrN
 * DESCRIPTION
 *  private native int nextRecordWithMatchStrN(int listType, int handle, int rechandle, String matching) throws PIMException;
 * PARAMETERS
 *  void
 * RETURNS
 *****************************************************************************/
KNIEXPORT KNI_RETURNTYPE_INT
Java_com_ibm_oti_pim_PIMListImpl_nextRecordWithMatchStrN(void)
{
    #if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
    #endif
    KNI_ReturnInt(-1);
}


/*****************************************************************************
 * FUNCTION
 *  Java_com_ibm_oti_pim_PIMListImpl_removeItemN
 * DESCRIPTION
 *  private native void removeItemN(int listType, int handle, int rechandle) throws PIMException;
 * PARAMETERS
 *  void
 * RETURNS
 *****************************************************************************/
KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_ibm_oti_pim_PIMListImpl_removeItemN(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    kal_int32 listtype = KNI_GetParameterAsInt(1);
    kal_int32 dbhandle = KNI_GetParameterAsInt(2);
    kal_int32 rechandle = KNI_GetParameterAsInt(3);

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    JPIM_DEBUG(TRACE_FUNC, FUNC_J2ME_PIMLISTIMPL_REMOVEITEMN);

    switch (listtype)
    {
        case CONTACT_LIST:
            THROW_FAILED_WITH_EXEC(
                deleteContact(dbhandle, rechandle),
                CONTACT_LIST,
                { /* */ } );
            break;

        case EVENT_LIST:
            THROW_FAILED_WITH_EXEC(
                deleteEvent(dbhandle, rechandle),
                EVENT_LIST,
                { /* */ } );
            break;

        case TODO_LIST:
            PIM_THROW(PIM, "", FEATURE_NOT_SUPPORTED);
            break;
        default:
            PIM_THROW(ILLARG, "", GENERAL_ERROR);
    }
}


/*****************************************************************************
 * FUNCTION
 *  Java_com_ibm_oti_pim_PIMListImpl_renameCategoryN
 * DESCRIPTION
 *  private native void renameCategoryN(int listType, int handle, String name, String newName) throws PIMException;
 * PARAMETERS
 *  void
 * RETURNS
 *****************************************************************************/
KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_ibm_oti_pim_PIMListImpl_renameCategoryN(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    kal_int32 listtype = KNI_GetParameterAsInt(1);
    kal_int32 dbhandle = KNI_GetParameterAsInt(2);
//    kal_int32 rechandle = KNI_GetParameterAsInt(3);
    kal_char *oldname = NULL;
    kal_char *newname = NULL;
//    kal_uint8 category;
    kal_int32 len;
    kal_int32 result;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    JPIM_DEBUG(TRACE_FUNC, FUNC_J2ME_PIMLISTIMPL_RENAMECATEGORYN);

    if (listtype != CONTACT_LIST)
    {
        KNI_ReturnVoid();
    }

    /* Get old category name */
    KNI_StartHandles(1);
    KNI_DeclareHandle(str);
    KNI_GetParameterAsObject(3, str);

    len = KNI_GetStringLength(str);
    if (len < 0)
    {
        PIM_THROW(NULLP, "", GENERAL_ERROR);
    }
    else
    {
        oldname = midpMalloc(((len + 1) << 1));
        KNI_GetStringRegion(str, 0, len, (jchar*) oldname);
        oldname[len*2] = oldname[len*2+1] = 0;
    }
    KNI_EndHandles();

    /* Get new category name */

    KNI_StartHandles(1);
    KNI_DeclareHandle(str);
    KNI_GetParameterAsObject(4, str);

    len = KNI_GetStringLength(str);
    if (len < 0)
    {
        PIM_THROW(NULLP, "", GENERAL_ERROR);
    }
    else
    {
        newname = midpMalloc(((len + 1) << 1));
        KNI_GetStringRegion(str, 0, len, (jchar*) newname);
        newname[len*2] = newname[len*2+1] = 0;
    }
    KNI_EndHandles();

    if (oldname != NULL && newname != NULL)
    {
        result = pim_renameCategory(dbhandle, oldname, newname);
        if (result != SUCCESS)
        {
            PIM_THROW(result, NULL, pim_getDetailError());
        }
    }
    else
    {
        PIM_THROW(NULLP, NULL, GENERAL_ERROR);
    }
    if (oldname)
        midpFree(oldname);
    if (newname)
        midpFree(newname);
}


/*****************************************************************************
 * FUNCTION
 *  Java_com_ibm_oti_pim_EventListImpl_getSupportedRepeatRuleFieldsN2
 * DESCRIPTION
 *  static native int getSupportedRepeatRuleFieldsN2(int frequency, int[] ret);
 * PARAMETERS
 *  void
 * RETURNS
 *****************************************************************************/
KNIEXPORT KNI_RETURNTYPE_INT
Java_com_ibm_oti_pim_EventListImpl_getSupportedRepeatRuleFieldsN2(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    kal_int32 frequency = KNI_GetParameterAsInt(1);

    kal_int32 getsize, numCombinations;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    /* TODO */

    KNI_StartHandles(1);
    KNI_DeclareHandle(int_array);
    KNI_GetParameterAsObject(2, int_array);
    getsize = KNI_IsNullHandle(int_array);
    KNI_EndHandles();

    JPIM_DEBUG_1(TRACE_FUNC, FUNC_J2ME_GETSUPPORTEDREPEATRULEFIELDSN2, getsize);

    if (getsize)
    {
        switch (frequency)
        {
            case R_DAILY:
                numCombinations = 0;
                break;
            case R_WEEKLY:
                numCombinations = 1;
                break;
            case R_MONTHLY:
                numCombinations = 1;
                break;
            case R_YEARLY:
                numCombinations = 1;
                break;
            default:
                numCombinations = 0;
        }

        JPIM_DEBUG_1(TRACE_FUNC, JPIM_LOG_INTEGER, numCombinations);

        KNI_ReturnInt(numCombinations);
    }

    switch (frequency)
    {
        case R_DAILY:
            break;
        case R_WEEKLY:
        {
            KNI_StartHandles(1);
            KNI_DeclareHandle(int_array);
            KNI_GetParameterAsObject(2, int_array);
            KNI_SetIntArrayElement(int_array, 0, R_DAY_IN_WEEK_ID);
            KNI_EndHandles();
        }
            break;
        case R_MONTHLY:
        {
            KNI_StartHandles(1);
            KNI_DeclareHandle(int_array);
            KNI_GetParameterAsObject(2, int_array);
            KNI_SetIntArrayElement(int_array, 0, R_DAY_IN_MONTH_ID);
            KNI_EndHandles();
        }
            break;
        case R_YEARLY:
        {
            KNI_StartHandles(1);
            KNI_DeclareHandle(int_array);
            KNI_GetParameterAsObject(2, int_array);
            KNI_SetIntArrayElement(int_array, 0, R_DAY_IN_MONTH_ID | R_MONTH_IN_YEAR_ID);
            KNI_EndHandles();
        }
            break;
    }

    KNI_ReturnInt(0);
}


/*****************************************************************************
 * FUNCTION
 *  Java_com_ibm_oti_pim_EventListImpl_getSupportedRepeatRuleFrequenciesN2
 * DESCRIPTION
 *  static native int getSupportedRepeatRuleFrequenciesN2(int[] ret);
 * PARAMETERS
 *  void
 * RETURNS
 *****************************************************************************/
KNIEXPORT KNI_RETURNTYPE_INT
Java_com_ibm_oti_pim_EventListImpl_getSupportedRepeatRuleFrequenciesN2(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    kal_int32 getsize;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    KNI_StartHandles(1);
    KNI_DeclareHandle(int_array);
    KNI_GetParameterAsObject(1, int_array);
    getsize = KNI_IsNullHandle(int_array);
    KNI_EndHandles();

    JPIM_DEBUG_1(TRACE_FUNC, FUNC_J2ME_GETSUPPORTEDREPEATRULEFREQUENCIESN2, getsize);

    /* TODO */

    if (getsize)
    {
        JPIM_DEBUG_1(TRACE_FUNC, JPIM_LOG_INTEGER, 4);
        KNI_ReturnInt(4);
    }

    KNI_StartHandles(1);
    KNI_DeclareHandle(int_array);
    KNI_GetParameterAsObject(1, int_array);
    KNI_SetIntArrayElement(int_array, 0, R_DAILY);
    KNI_SetIntArrayElement(int_array, 1, R_WEEKLY);
    KNI_SetIntArrayElement(int_array, 2, R_MONTHLY);
    KNI_SetIntArrayElement(int_array, 3, R_YEARLY);
    KNI_EndHandles();

    KNI_ReturnInt(0);
}


/*****************************************************************************
 * FUNCTION
 *  Java_com_ibm_oti_pim_EventListImpl_nextSortedEventN2
 * DESCRIPTION
 *  private native int nextSortedEventN2(int handle, long currentDate2, int[] ret);
 * PARAMETERS
 *  void
 * RETURNS
 *****************************************************************************/
KNIEXPORT KNI_RETURNTYPE_INT
Java_com_ibm_oti_pim_EventListImpl_nextSortedEventN2(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* implement in java level */
    ASSERT(0);
    KNI_ReturnInt(0);
}


/*****************************************************************************
 * FUNCTION
 *  Java_com_ibm_oti_pim_ToDoListImpl_nextSortedToDoN2
 * DESCRIPTION
 *  private native int nextSortedToDoN2(int handle, int field, long currentDate, int[] ret);
 * PARAMETERS
 *  void
 * RETURNS
 *****************************************************************************/
KNIEXPORT KNI_RETURNTYPE_INT
Java_com_ibm_oti_pim_ToDoListImpl_nextSortedToDoN2(void)
{
    /*----------------------------------------------------------------

⌨️ 快捷键说明

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