aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/addrbook/macosx
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2011-01-07 21:55:12 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2011-01-07 21:55:12 +0000
commit08f364ab3ae581888e6b88d9dd6d1fe6e51bf256 (patch)
treebff850e4e0b99dda333edb1bb031c335cb31b3ab /src/native/addrbook/macosx
parent09d688c00a58854d5f0eb066f752feea061e135e (diff)
downloadjitsi-08f364ab3ae581888e6b88d9dd6d1fe6e51bf256.zip
jitsi-08f364ab3ae581888e6b88d9dd6d1fe6e51bf256.tar.gz
jitsi-08f364ab3ae581888e6b88d9dd6d1fe6e51bf256.tar.bz2
Displays images for the contacts fetched from the Address Book of Mac OS X.
Diffstat (limited to 'src/native/addrbook/macosx')
-rw-r--r--src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h322
-rw-r--r--src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m31
2 files changed, 196 insertions, 157 deletions
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 <jni.h>
-/* 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 <jni.h>
+/* 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 <AddressBook/AddressBook.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSAutoreleasePool.h>
+#import <Foundation/NSData.h>
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)