aboutsummaryrefslogtreecommitdiffstats
path: root/src/native
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2010-12-21 19:25:48 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2010-12-21 19:25:48 +0000
commit18398ab4300f96202239823dc39137cb1aa77537 (patch)
tree4b6a23fce19f3f0c9fc10358120e5e6218179345 /src/native
parent2ec63aeaf2c8c8d7e70a5765a121bbad3a59ed29 (diff)
downloadjitsi-18398ab4300f96202239823dc39137cb1aa77537.zip
jitsi-18398ab4300f96202239823dc39137cb1aa77537.tar.gz
jitsi-18398ab4300f96202239823dc39137cb1aa77537.tar.bz2
Commits work in progress on adding support for the Address Book of Microsoft Outlook.
Diffstat (limited to 'src/native')
-rw-r--r--src/native/windows/msoutlook/Makefile7
-rw-r--r--src/native/windows/msoutlook/MsOutlookMAPIHResultException.cpp36
-rw-r--r--src/native/windows/msoutlook/MsOutlookMAPIHResultException.h17
-rw-r--r--src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.cpp8
-rw-r--r--src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.h21
-rw-r--r--src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.c6
6 files changed, 90 insertions, 5 deletions
diff --git a/src/native/windows/msoutlook/Makefile b/src/native/windows/msoutlook/Makefile
index 565e3ca..c5d9fb4 100644
--- a/src/native/windows/msoutlook/Makefile
+++ b/src/native/windows/msoutlook/Makefile
@@ -1,4 +1,4 @@
-CXX = g++ -O2
+CXX = c++ -O2
OUTLOOK_MAPI_HEADERS ?= /c/Users/lyubomir/Downloads/Outlook2010MAPIHeaders
TARGET_BASENAME = jmsoutlook.dll
@@ -14,6 +14,9 @@ LDFLAGS = -shared -Wl,--kill-at
LIBS = -lmapi32
TARGET = ../../../../lib/native/windows$(ARCH)/jmsoutlook.dll
-$(TARGET): net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.c
+$(TARGET): \
+ MsOutlookMAPIHResultException.cpp \
+ net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.cpp \
+ net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.c
$(CXX) $(CPPFLAGS) $^ $(LDFLAGS) -o $@ $(LIBS)
-strip $(TARGET)
diff --git a/src/native/windows/msoutlook/MsOutlookMAPIHResultException.cpp b/src/native/windows/msoutlook/MsOutlookMAPIHResultException.cpp
new file mode 100644
index 0000000..3f62cf6
--- /dev/null
+++ b/src/native/windows/msoutlook/MsOutlookMAPIHResultException.cpp
@@ -0,0 +1,36 @@
+#include "MsOutlookMAPIHResultException.h"
+
+#include <tchar.h>
+
+void
+MsOutlookMAPIHResultException_throwNew(JNIEnv *jniEnv, HRESULT hResult)
+{
+ jclass clazz;
+
+ clazz
+ = jniEnv->FindClass(
+ "net/java/sip/communicator/plugin/msoutlook/MsOutlookMAPIHResultException");
+ if (clazz)
+ {
+ LPCTSTR message;
+
+ switch (hResult)
+ {
+ case MAPI_E_NOT_INITIALIZED:
+ message = _T("MAPI_E_NOT_INITIALIZED");
+ break;
+ case S_OK:
+ message = _T("S_OK");
+ break;
+ default:
+ message = NULL;
+ break;
+ }
+
+ /*
+ * TODO Use MsOutlookMAPIHResultException(long, String) in order to
+ * communicate hResult as a HRESULT value.
+ */
+ jniEnv->ThrowNew(clazz, message);
+ }
+}
diff --git a/src/native/windows/msoutlook/MsOutlookMAPIHResultException.h b/src/native/windows/msoutlook/MsOutlookMAPIHResultException.h
new file mode 100644
index 0000000..a6b1ecb
--- /dev/null
+++ b/src/native/windows/msoutlook/MsOutlookMAPIHResultException.h
@@ -0,0 +1,17 @@
+#ifndef _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_H_
+#define _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_H_
+
+#include <jni.h>
+#include "MsOutlookMAPI.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* #ifdef __cplusplus */
+
+void MsOutlookMAPIHResultException_throwNew(JNIEnv *jniEnv, HRESULT hResult);
+
+#ifdef __cplusplus
+}
+#endif /* #ifdef __cplusplus */
+
+#endif /* _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_ */ \ No newline at end of file
diff --git a/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.cpp b/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.cpp
new file mode 100644
index 0000000..640ba6b
--- /dev/null
+++ b/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.cpp
@@ -0,0 +1,8 @@
+#include "net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.h"
+
+JNIEXPORT void JNICALL
+Java_net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery_foreachMailUser
+ (JNIEnv *jniEnv, jclass clazz, jstring query, jobject callback)
+{
+ // TODO Auto-generated method stub
+}
diff --git a/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.h b/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.h
new file mode 100644
index 0000000..a881f30
--- /dev/null
+++ b/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery.h
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery */
+
+#ifndef _Included_net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery
+#define _Included_net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery
+ * Method: foreachMailUser
+ * Signature: (Ljava/lang/String;Lnet/java/sip/communicator/plugin/msoutlook/MsOutlookAddressBookCallback;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactQuery_foreachMailUser
+ (JNIEnv *, jclass, jstring, jobject);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.c b/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.c
index 996d96f..6e8f74d 100644
--- a/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.c
+++ b/src/native/windows/msoutlook/net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.c
@@ -1,5 +1,7 @@
#include "net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService.h"
+
#include "MsOutlookMAPI.h"
+#include "MsOutlookMAPIHResultException.h"
JNIEXPORT void JNICALL
Java_net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourceService_MAPIInitialize
@@ -11,9 +13,7 @@ Java_net_java_sip_communicator_plugin_msoutlook_MsOutlookAddressBookContactSourc
hResult = MAPIInitialize(&mapiInit);
if (HR_FAILED(hResult))
- {
- /* TODO Auto-generated method stub */
- }
+ MsOutlookMAPIHResultException_throwNew(jniEnv, hResult);
}
JNIEXPORT void JNICALL