javaextensions/pim/framework/inc/pimbaseitem.h
changeset 21 2a9601315dfc
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     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:  PIM item base implementation.*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef PIMBASEITEM_H
       
    19 #define PIMBASEITEM_H
       
    20 
       
    21 #include <jni.h>
       
    22 #include "pimcommon.h"
       
    23 
       
    24 class pimbasemanager;
       
    25 
       
    26 class pimbaseitem
       
    27 {
       
    28 public:
       
    29 
       
    30     virtual pimbaseitem::~pimbaseitem()
       
    31     {
       
    32     };
       
    33 
       
    34     virtual TPIMFieldDataType fieldDataType(const TPIMField& aField) const = 0;
       
    35 
       
    36     virtual void commit() = 0;
       
    37 
       
    38     virtual bool isModified() const = 0;
       
    39 
       
    40     virtual jbyteArray callGetBinary(TPIMField aField, int aIndex,
       
    41                                      JNIEnv* aJniEnv, jintArray aError) = 0;
       
    42 
       
    43     virtual void callAddBinary(TPIMField aField, TPIMAttribute aAttributes,
       
    44                                unsigned char* aValue, int aOffset, int aLength) = 0;
       
    45 
       
    46     virtual jintArray callGetFields(JNIEnv* aJniEnv) = 0;
       
    47 
       
    48     virtual void callSetBinary(TPIMField aField, int aIndex,
       
    49                                TPIMAttribute aAttributes, unsigned char* aValue, int aOffset,
       
    50                                int aLength) = 0;
       
    51 
       
    52     virtual jlong callGetDate(TPIMField aField, int aIndex) = 0;
       
    53 
       
    54     virtual void callAddDate(TPIMField aField, TPIMAttribute aAttributes,
       
    55                              jlong aValue) = 0;
       
    56 
       
    57     virtual void callSetDate(TPIMField aField, int aIndex,
       
    58                              TPIMAttribute aAttributes, jlong aValue) = 0;
       
    59 
       
    60     virtual int getInt(TPIMField aField, int aIndex) const = 0;
       
    61 
       
    62     virtual void addInt(TPIMField aField, TPIMAttribute aAttributes,
       
    63                         int aValue) = 0;
       
    64 
       
    65     virtual void setInt(TPIMField aField, int aIndex,
       
    66                         TPIMAttribute aAttributes, int aValue) = 0;
       
    67 
       
    68     virtual jstring callGetString(TPIMField aField, int aIndex,
       
    69                                   JNIEnv* aJniEnv, jintArray aError) = 0;
       
    70 
       
    71     virtual void callAddString(TPIMField aField, TPIMAttribute aAttributes,
       
    72                                jstring aValue, JNIEnv* aJniEnv) = 0;
       
    73 
       
    74     virtual void callSetString(TPIMField aField, int aIndex,
       
    75                                TPIMAttribute aAttributes, jstring aValue, JNIEnv* aJniEnv) = 0;
       
    76 
       
    77     virtual bool callGetBoolean(TPIMField aField, int aIndex) = 0;
       
    78 
       
    79     virtual void callAddBoolean(TPIMField aField, TPIMAttribute aAttributes,
       
    80                                 jboolean aValue) = 0;
       
    81 
       
    82     virtual void callSetBoolean(TPIMField aField, int aIndex,
       
    83                                 TPIMAttribute aAttributes, jboolean aValue) = 0;
       
    84 
       
    85     virtual jobjectArray callGetStringArray(TPIMField aField, int aIndex,
       
    86                                             JNIEnv* aJniEnv, jintArray aError) = 0;
       
    87 
       
    88     virtual void callAddStringArray(JNIEnv* aJniEnv, jint aField,
       
    89                                     jint aAttributes, jobjectArray aValue) = 0;
       
    90 
       
    91     virtual void callSetStringArray(JNIEnv* aJniEnv, jint aField, jint aIndex,
       
    92                                     jint aAttributes, jobjectArray aValue) = 0;
       
    93 
       
    94     virtual int callCountValues(TPIMField aField) const = 0;
       
    95 
       
    96     virtual void removeValue(TPIMField aField, int aIndex) = 0;
       
    97 
       
    98     virtual TPIMAttribute getAttributes(TPIMField aField, int aIndex) const = 0;
       
    99 
       
   100     virtual void callAddToCategory(jstring aCategory, JNIEnv* aJniEnv) = 0;
       
   101 
       
   102     virtual void callRemoveFromCategory(jstring aCategory, JNIEnv* aJniEnv) = 0;
       
   103 
       
   104     virtual jobjectArray callGetCategories(JNIEnv* aJniEnv) = 0;
       
   105 
       
   106     virtual int maxCategories() = 0;
       
   107 
       
   108     // CPIMContactItem functions
       
   109 
       
   110     static pimbaseitem* getContactItemInstance(pimbasemanager* aPimManager);
       
   111 
       
   112     virtual int getPreferredIndex(TPIMField aField) const = 0;
       
   113 
       
   114     // CPIMEventItem functions
       
   115 
       
   116     static pimbaseitem* getEventItemInstance(pimbasemanager* aPimManager);
       
   117 
       
   118     virtual int getRepeatHandle() = 0;
       
   119 
       
   120     virtual bool isItemRepeating() const = 0;
       
   121 
       
   122     virtual void setItemRepeating(jboolean aSetRepeating) = 0;
       
   123 
       
   124     // CPIMEventItem functions
       
   125 
       
   126     static pimbaseitem* getToDoItemInstance(pimbasemanager* aPimManager);
       
   127 
       
   128 };
       
   129 
       
   130 #endif // PIMBASEITEM_H