From 08f364ab3ae581888e6b88d9dd6d1fe6e51bf256 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Fri, 7 Jan 2011 21:55:12 +0000 Subject: Displays images for the contacts fetched from the Address Book of Mac OS X. --- ...in_addrbook_macosx_MacOSXAddrBookContactQuery.h | 322 +++++++++++---------- ...in_addrbook_macosx_MacOSXAddrBookContactQuery.m | 31 ++ 2 files changed, 196 insertions(+), 157 deletions(-) (limited to 'src/native/addrbook/macosx') diff --git a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h index 695b64d..d1ea08c 100644 --- a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h +++ b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h @@ -1,157 +1,165 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery */ - -#ifndef _Included_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery -#define _Included_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: ABRecord_valuesForProperties - * Signature: (J[J)[Ljava/lang/Object; - */ -JNIEXPORT jobjectArray JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_ABRecord_1valuesForProperties - (JNIEnv *, jclass, jlong, jlongArray); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: foreachPerson - * Signature: (Ljava/lang/String;Lnet/java/sip/communicator/plugin/addrbook/PtrCallback;)V - */ -JNIEXPORT void JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_foreachPerson - (JNIEnv *, jclass, jstring, jobject); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABAIMInstantProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABAIMInstantProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABEmailProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABEmailProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABFirstNameProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABFirstNameProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABFirstNamePhoneticProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABFirstNamePhoneticProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABICQInstantProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABICQInstantProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABJabberInstantProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABJabberInstantProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABLastNameProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABLastNameProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABLastNamePhoneticProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABLastNamePhoneticProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABMiddleNameProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABMiddleNameProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABMiddleNamePhoneticProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABMiddleNamePhoneticProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABMSNInstantProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABMSNInstantProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABNicknameProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABNicknameProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABOrganizationProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABOrganizationProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABPersonFlags - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABPersonFlags - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABPhoneProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABPhoneProperty - (JNIEnv *, jclass); - -/* - * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery - * Method: kABYahooInstantProperty - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABYahooInstantProperty - (JNIEnv *, jclass); - -#ifdef __cplusplus -} -#endif -#endif +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery */ + +#ifndef _Included_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery +#define _Included_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: ABPerson_imageData + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_ABPerson_1imageData + (JNIEnv *, jclass, jlong); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: ABRecord_valuesForProperties + * Signature: (J[J)[Ljava/lang/Object; + */ +JNIEXPORT jobjectArray JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_ABRecord_1valuesForProperties + (JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: foreachPerson + * Signature: (Ljava/lang/String;Lnet/java/sip/communicator/plugin/addrbook/PtrCallback;)V + */ +JNIEXPORT void JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_foreachPerson + (JNIEnv *, jclass, jstring, jobject); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABAIMInstantProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABAIMInstantProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABEmailProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABEmailProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABFirstNameProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABFirstNameProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABFirstNamePhoneticProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABFirstNamePhoneticProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABICQInstantProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABICQInstantProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABJabberInstantProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABJabberInstantProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABLastNameProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABLastNameProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABLastNamePhoneticProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABLastNamePhoneticProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABMiddleNameProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABMiddleNameProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABMiddleNamePhoneticProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABMiddleNamePhoneticProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABMSNInstantProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABMSNInstantProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABNicknameProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABNicknameProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABOrganizationProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABOrganizationProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABPersonFlags + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABPersonFlags + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABPhoneProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABPhoneProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABYahooInstantProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABYahooInstantProperty + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m index f21aabe..1a70260 100644 --- a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m +++ b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m @@ -12,10 +12,41 @@ #import #import #import +#import static void MacOSXAddrBookContactQuery_idToJObject (JNIEnv *jniEnv, id o, jobjectArray jos, jint i, jclass objectClass); +JNIEXPORT jbyteArray JNICALL +Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_ABPerson_1imageData + (JNIEnv *jniEnv, jclass clazz, jlong person) +{ + NSData *imageData = [((ABPerson *) person) imageData]; + jbyteArray jImageData; + + if (imageData) + { + NSUInteger length = [imageData length]; + + if (length) + { + jImageData = (*jniEnv)->NewByteArray(jniEnv, length); + if (jImageData) + { + (*jniEnv)->SetByteArrayRegion( + jniEnv, + jImageData, 0, length, + [imageData bytes]); + } + } + else + jImageData = NULL; + } + else + jImageData = NULL; + return jImageData; +} + JNIEXPORT jobjectArray JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_ABRecord_1valuesForProperties (JNIEnv *jniEnv, jclass clazz, jlong record, jlongArray properties) -- cgit v1.1