aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/addrbook/msoutlook
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2011-01-07 19:01:32 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2011-01-07 19:01:32 +0000
commit72bc56dbb32f2e311a9250ad561c9e3feef2e066 (patch)
treee10b816ef1a405e16caaba09ccc141cb073376e2 /src/native/addrbook/msoutlook
parent8b919ddfb1de75c72c256aa671203183c5bfc232 (diff)
downloadjitsi-72bc56dbb32f2e311a9250ad561c9e3feef2e066.zip
jitsi-72bc56dbb32f2e311a9250ad561c9e3feef2e066.tar.gz
jitsi-72bc56dbb32f2e311a9250ad561c9e3feef2e066.tar.bz2
Activates an initial implementation of the support for the Address Book of Mac OS X. Neither it, nor the support for the Address Book of Microsoft Outlook implement the SourceContact image property.
Diffstat (limited to 'src/native/addrbook/msoutlook')
-rw-r--r--src/native/addrbook/msoutlook/Makefile7
-rw-r--r--src/native/addrbook/msoutlook/net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery.cpp37
2 files changed, 8 insertions, 36 deletions
diff --git a/src/native/addrbook/msoutlook/Makefile b/src/native/addrbook/msoutlook/Makefile
index 32d05f7..53e108c 100644
--- a/src/native/addrbook/msoutlook/Makefile
+++ b/src/native/addrbook/msoutlook/Makefile
@@ -1,6 +1,6 @@
CXX = c++ -O2
OUTLOOK_MAPI_HEADERS ?= /c/Users/lyubomir/Downloads/Outlook2010MAPIHeaders
-TARGET_BASENAME = jmsoutlook.dll
+TARGET_BASENAME = jmsoutlookaddrbook
ARCH = $(shell $(CXX) -dumpmachine | sed -e s/x86_64-.*/-64/ -e s/i.86-.*//)
ifeq "$(ARCH)" "-64"
@@ -9,12 +9,13 @@ else
JAVA_HOME ?= C:/PROGRA~2/jdk
endif
-CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32 -I$(OUTLOOK_MAPI_HEADERS)
+CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32 -I$(OUTLOOK_MAPI_HEADERS) -I..
LDFLAGS = -shared -Wl,--kill-at
LIBS = -lmapi32
-TARGET = ../../../../lib/native/windows$(ARCH)/jmsoutlookaddrbook.dll
+TARGET = ../../../../lib/native/windows$(ARCH)/$(TARGET_BASENAME).dll
$(TARGET): \
+ ../AddrBookContactQuery.c
MsOutlookMAPIHResultException.cpp \
net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery.cpp \
net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService.c
diff --git a/src/native/addrbook/msoutlook/net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery.cpp b/src/native/addrbook/msoutlook/net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery.cpp
index 033d297..f238e19 100644
--- a/src/native/addrbook/msoutlook/net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery.cpp
+++ b/src/native/addrbook/msoutlook/net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery.cpp
@@ -7,6 +7,7 @@
#include "net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery.h"
+#include "AddrBookContactQuery.h"
#include "MsOutlookMAPI.h"
#include "MsOutlookMAPIHResultException.h"
@@ -15,9 +16,6 @@
#define WIND32_MEAN_AND_LEAK
#include <windows.h>
-static void Exception_throwNew
- (JNIEnv *jniEnv, const char *className, const char *message);
-
static jboolean MsOutlookAddrBookContactQuery_foreachMailUser
(ULONG objType, LPUNKNOWN iUnknown,
JNIEnv *jniEnv,
@@ -32,46 +30,19 @@ static void MsOutlookAddrBookContactQuery_freeSRowSet(LPSRowSet rows);
static jboolean MsOutlookAddrBookContactQuery_mailUserMatches
(LPMAPIPROP mailUser, JNIEnv *jniEnv, jstring query);
-static void
-Exception_throwNew(JNIEnv *jniEnv, const char *className, const char *message)
-{
- jclass clazz;
-
- clazz = jniEnv->FindClass(className);
- if (clazz)
- jniEnv->ThrowNew(clazz, message);
-}
-
JNIEXPORT void JNICALL
Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactQuery_foreachMailUser
(JNIEnv *jniEnv, jclass clazz, jstring query, jobject callback)
{
- jclass callbackClass;
jmethodID callbackMethodID;
HRESULT hResult;
LPMAPISESSION mapiSession;
- /*
- * Make sure that the specified arguments are valid. For example, check
- * whether callback exists and has the necessary signature.
- */
- if (!callback)
- {
- Exception_throwNew(
- jniEnv, "java/lang/NullPointerException", "callback");
- return;
- }
- callbackClass = jniEnv->GetObjectClass(callback);
- if (!callbackClass)
+ callbackMethodID
+ = AddrBookContactQuery_getPtrCallbackMethodID(jniEnv, callback);
+ if (!callbackMethodID || (JNI_TRUE == jniEnv->ExceptionCheck()))
return;
- callbackMethodID = jniEnv->GetMethodID(callbackClass, "callback", "(J)Z");
- if (!callbackMethodID)
- {
- Exception_throwNew(
- jniEnv, "java/lang/IllegalArgumentException", "callback");
- return;
- }
hResult
= MAPILogonEx(