From cf6543e01ab31b1316c37881bd46a99fbf7ca156 Mon Sep 17 00:00:00 2001 From: Vincent Lucas Date: Mon, 8 Apr 2013 23:21:41 +0000 Subject: Corrects IMAPIProp_GetProps problem with outlook. Adds contact addition and deletion functionality for outlook and MacOsX contacts. Improves and corrects getting and setting contact details for outlook and MacOsX contacts. --- src/native/addrbook/AddrBookContactQuery.c | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/native/addrbook/AddrBookContactQuery.c') diff --git a/src/native/addrbook/AddrBookContactQuery.c b/src/native/addrbook/AddrBookContactQuery.c index 1045214..415ce67 100644 --- a/src/native/addrbook/AddrBookContactQuery.c +++ b/src/native/addrbook/AddrBookContactQuery.c @@ -44,6 +44,41 @@ AddrBookContactQuery_getPtrCallbackMethodID(JNIEnv *jniEnv, jobject callback) return callbackMethodID; } +jmethodID +AddrBookContactQuery_getStringCallbackMethodID( + JNIEnv *jniEnv, jobject callback) +{ + jclass callbackClass; + jmethodID callbackMethodID = 0; + + /* + * Make sure that the specified arguments are valid. For example, check + * whether callback exists and has the necessary signature. + */ + if (callback) + { + callbackClass = (*jniEnv)->GetObjectClass(jniEnv, callback); + if (callbackClass) + { + callbackMethodID + = (*jniEnv)->GetMethodID( + jniEnv, + callbackClass, "callback", "(Ljava/lang/String;)Z"); + if (!callbackMethodID) + { + Exception_throwNew( + jniEnv, "java/lang/IllegalArgumentException", "callback"); + } + } + } + else + { + Exception_throwNew( + jniEnv, "java/lang/NullPointerException", "callback"); + } + return callbackMethodID; +} + static void Exception_throwNew(JNIEnv *jniEnv, const char *className, const char *message) { -- cgit v1.1