mirror of https://github.com/sipwise/jitsi.git
Adds management of Outlook contact with multiple identifier. Corrects null pointer segmentation fault when comparing entry identifiers. Uses MAPI service provider to retrieve a tag corresponding to a property identifier.
parent
6939b99d6a
commit
cd56bd88b2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,62 +1,62 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
#ifndef _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKADDRBOOKCONTACTSOURCESERVICE_H_
|
||||
#define _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKADDRBOOKCONTACTSOURCESERVICE_H_
|
||||
|
||||
#include <jni.h>
|
||||
#include <mapix.h>
|
||||
|
||||
BOOL MsOutlookAddrBook_fBinFromHex(LPSTR lpsz, LPBYTE lpb);
|
||||
#define FBinFromHex MsOutlookAddrBook_fBinFromHex
|
||||
|
||||
void MsOutlookAddrBook_freeProws(LPSRowSet lpRows);
|
||||
#define FreeProws MsOutlookAddrBook_freeProws
|
||||
|
||||
void MsOutlookAddrBook_hexFromBin(LPBYTE pb, int cb, LPSTR sz);
|
||||
#define HexFromBin MsOutlookAddrBook_hexFromBin
|
||||
|
||||
void MsOutlookAddrBook_hrAllocAdviseSink
|
||||
(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext,
|
||||
LPMAPIADVISESINK* lppAdviseSink);
|
||||
#define HrAllocAdviseSink MsOutlookAddrBook_hrAllocAdviseSink
|
||||
|
||||
HRESULT MsOutlookAddrBook_hrQueryAllRows
|
||||
(LPMAPITABLE lpTable, LPSPropTagArray lpPropTags,
|
||||
LPSRestriction lpRestriction, LPSSortOrderSet lpSortOrderSet,
|
||||
LONG crowsMax, LPSRowSet* lppRows);
|
||||
#define HrQueryAllRows MsOutlookAddrBook_hrQueryAllRows
|
||||
|
||||
SCODE MsOutlookAddrBook_mapiAllocateBuffer(ULONG size, LPVOID FAR *buffer);
|
||||
#define MAPIAllocateBuffer MsOutlookAddrBook_mapiAllocateBuffer
|
||||
|
||||
ULONG MsOutlookAddrBook_mapiFreeBuffer(LPVOID buffer);
|
||||
#define MAPIFreeBuffer MsOutlookAddrBook_mapiFreeBuffer
|
||||
|
||||
HRESULT MsOutlookAddrBook_mapiLogonEx
|
||||
(ULONG_PTR uiParam,
|
||||
LPTSTR profileName, LPTSTR password,
|
||||
FLAGS flags,
|
||||
LPMAPISESSION FAR *mapiSession);
|
||||
#define MAPILogonEx MsOutlookAddrBook_mapiLogonEx
|
||||
|
||||
|
||||
HRESULT MsOutlookAddrBookContactSourceService_MAPIInitialize
|
||||
(jlong version, jlong flags);
|
||||
|
||||
HRESULT MsOutlookAddrBookContactSourceService_MAPIInitializeCOMServer(void);
|
||||
|
||||
void MsOutlookAddrBookContactSourceService_MAPIUninitialize(void);
|
||||
|
||||
void MsOutlookAddrBookContactSourceService_MAPIUninitializeCOMServer(void);
|
||||
|
||||
HRESULT MsOutlookAddrBookContactSourceService_NativeMAPIInitialize
|
||||
(jlong version, jlong flags,
|
||||
void * deletedMethod, void * insertedMethod, void * updatedMethod);
|
||||
|
||||
void MsOutlookAddrBookContactSourceService_NativeMAPIUninitialize(void);
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
#ifndef _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKADDRBOOKCONTACTSOURCESERVICE_H_
|
||||
#define _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKADDRBOOKCONTACTSOURCESERVICE_H_
|
||||
|
||||
#include <jni.h>
|
||||
#include <mapix.h>
|
||||
|
||||
BOOL MsOutlookAddrBook_fBinFromHex(LPSTR lpsz, LPBYTE lpb);
|
||||
#define FBinFromHex MsOutlookAddrBook_fBinFromHex
|
||||
|
||||
void MsOutlookAddrBook_freeProws(LPSRowSet lpRows);
|
||||
#define FreeProws MsOutlookAddrBook_freeProws
|
||||
|
||||
void MsOutlookAddrBook_hexFromBin(LPBYTE pb, int cb, LPSTR sz);
|
||||
#define HexFromBin MsOutlookAddrBook_hexFromBin
|
||||
|
||||
void MsOutlookAddrBook_hrAllocAdviseSink
|
||||
(LPNOTIFCALLBACK lpfnCallback, LPVOID lpvContext,
|
||||
LPMAPIADVISESINK* lppAdviseSink);
|
||||
#define HrAllocAdviseSink MsOutlookAddrBook_hrAllocAdviseSink
|
||||
|
||||
HRESULT MsOutlookAddrBook_hrQueryAllRows
|
||||
(LPMAPITABLE lpTable, LPSPropTagArray lpPropTags,
|
||||
LPSRestriction lpRestriction, LPSSortOrderSet lpSortOrderSet,
|
||||
LONG crowsMax, LPSRowSet* lppRows);
|
||||
#define HrQueryAllRows MsOutlookAddrBook_hrQueryAllRows
|
||||
|
||||
SCODE MsOutlookAddrBook_mapiAllocateBuffer(ULONG size, LPVOID FAR *buffer);
|
||||
#define MAPIAllocateBuffer MsOutlookAddrBook_mapiAllocateBuffer
|
||||
|
||||
ULONG MsOutlookAddrBook_mapiFreeBuffer(LPVOID buffer);
|
||||
#define MAPIFreeBuffer MsOutlookAddrBook_mapiFreeBuffer
|
||||
|
||||
HRESULT MsOutlookAddrBook_mapiLogonEx
|
||||
(ULONG_PTR uiParam,
|
||||
LPTSTR profileName, LPTSTR password,
|
||||
FLAGS flags,
|
||||
LPMAPISESSION FAR *mapiSession);
|
||||
#define MAPILogonEx MsOutlookAddrBook_mapiLogonEx
|
||||
|
||||
|
||||
HRESULT MsOutlookAddrBookContactSourceService_MAPIInitialize
|
||||
(jlong version, jlong flags);
|
||||
|
||||
HRESULT MsOutlookAddrBookContactSourceService_MAPIInitializeCOMServer(void);
|
||||
|
||||
void MsOutlookAddrBookContactSourceService_MAPIUninitialize(void);
|
||||
|
||||
void MsOutlookAddrBookContactSourceService_MAPIUninitializeCOMServer(void);
|
||||
|
||||
HRESULT MsOutlookAddrBookContactSourceService_NativeMAPIInitialize
|
||||
(jlong version, jlong flags,
|
||||
void * deletedMethod, void * insertedMethod, void * updatedMethod);
|
||||
|
||||
void MsOutlookAddrBookContactSourceService_NativeMAPIUninitialize(void);
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#ifndef _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_H_
|
||||
#define _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_H_
|
||||
|
||||
#include <jni.h>
|
||||
#include <Mapix.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* #ifdef __cplusplus */
|
||||
|
||||
void MsOutlookMAPIHResultException_throwNew
|
||||
(JNIEnv *jniEnv, HRESULT hResult, LPCSTR file, ULONG line);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* #ifdef __cplusplus */
|
||||
|
||||
#endif /* _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_ */
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#ifndef _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_H_
|
||||
#define _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_H_
|
||||
|
||||
#include <jni.h>
|
||||
#include <Mapix.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* #ifdef __cplusplus */
|
||||
|
||||
void MsOutlookMAPIHResultException_throwNew
|
||||
(JNIEnv *jniEnv, HRESULT hResult, LPCSTR file, ULONG line);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* #ifdef __cplusplus */
|
||||
|
||||
#endif /* _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_MSOUTLOOK_MSOUTLOOKMAPIHRESULTEXCEPTION_ */
|
||||
|
||||
@ -1,208 +1,208 @@
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.00.0595 */
|
||||
/* at Tue May 07 03:41:40 2013
|
||||
*/
|
||||
/* Compiler settings for IMsOutlookAddrBookClient.idl:
|
||||
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
|
||||
protocol : dce , ms_ext, c_ext, robust
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
VC __declspec() decoration level:
|
||||
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
|
||||
DECLSPEC_UUID(), MIDL_INTERFACE()
|
||||
*/
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
//#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_h__
|
||||
#define __IMsOutlookAddrBookClient_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookClient IMsOutlookAddrBookClient;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookClient_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookClient IMsOutlookAddrBookClient;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookClient_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "Unknwn.h"
|
||||
#include "oaidl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_INTERFACE_DEFINED__
|
||||
#define __IMsOutlookAddrBookClient_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IMsOutlookAddrBookClient */
|
||||
/* [oleautomation][dual][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IMsOutlookAddrBookClient;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("D579E840-B1A6-11E2-9E96-0800200C9A66")
|
||||
IMsOutlookAddrBookClient : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE foreachMailUserCallback(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE deleted(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE inserted(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE updated(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IMsOutlookAddrBookClientVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
IMsOutlookAddrBookClient * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
IMsOutlookAddrBookClient * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *foreachMailUserCallback )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *deleted )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *inserted )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *updated )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
END_INTERFACE
|
||||
} IMsOutlookAddrBookClientVtbl;
|
||||
|
||||
interface IMsOutlookAddrBookClient
|
||||
{
|
||||
CONST_VTBL struct IMsOutlookAddrBookClientVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookClient_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookClient_foreachMailUserCallback(This,id) \
|
||||
( (This)->lpVtbl -> foreachMailUserCallback(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_deleted(This,id) \
|
||||
( (This)->lpVtbl -> deleted(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_inserted(This,id) \
|
||||
( (This)->lpVtbl -> inserted(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_updated(This,id) \
|
||||
( (This)->lpVtbl -> updated(This,id) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IMsOutlookAddrBookClient_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClientTypeLib_LIBRARY_DEFINED__
|
||||
#define __IMsOutlookAddrBookClientTypeLib_LIBRARY_DEFINED__
|
||||
|
||||
/* library IMsOutlookAddrBookClientTypeLib */
|
||||
/* [helpstring][version][uuid] */
|
||||
|
||||
|
||||
|
||||
EXTERN_C const IID LIBID_IMsOutlookAddrBookClientTypeLib;
|
||||
#endif /* __IMsOutlookAddrBookClientTypeLib_LIBRARY_DEFINED__ */
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
|
||||
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.00.0595 */
|
||||
/* at Tue May 07 03:41:40 2013
|
||||
*/
|
||||
/* Compiler settings for IMsOutlookAddrBookClient.idl:
|
||||
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
|
||||
protocol : dce , ms_ext, c_ext, robust
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
VC __declspec() decoration level:
|
||||
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
|
||||
DECLSPEC_UUID(), MIDL_INTERFACE()
|
||||
*/
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
//#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_h__
|
||||
#define __IMsOutlookAddrBookClient_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookClient IMsOutlookAddrBookClient;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookClient_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookClient_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookClient IMsOutlookAddrBookClient;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookClient_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "Unknwn.h"
|
||||
#include "oaidl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClient_INTERFACE_DEFINED__
|
||||
#define __IMsOutlookAddrBookClient_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IMsOutlookAddrBookClient */
|
||||
/* [oleautomation][dual][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IMsOutlookAddrBookClient;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("D579E840-B1A6-11E2-9E96-0800200C9A66")
|
||||
IMsOutlookAddrBookClient : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE foreachMailUserCallback(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE deleted(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE inserted(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE updated(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IMsOutlookAddrBookClientVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
IMsOutlookAddrBookClient * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
IMsOutlookAddrBookClient * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *foreachMailUserCallback )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *deleted )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *inserted )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *updated )(
|
||||
IMsOutlookAddrBookClient * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
END_INTERFACE
|
||||
} IMsOutlookAddrBookClientVtbl;
|
||||
|
||||
interface IMsOutlookAddrBookClient
|
||||
{
|
||||
CONST_VTBL struct IMsOutlookAddrBookClientVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookClient_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookClient_foreachMailUserCallback(This,id) \
|
||||
( (This)->lpVtbl -> foreachMailUserCallback(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_deleted(This,id) \
|
||||
( (This)->lpVtbl -> deleted(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_inserted(This,id) \
|
||||
( (This)->lpVtbl -> inserted(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookClient_updated(This,id) \
|
||||
( (This)->lpVtbl -> updated(This,id) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IMsOutlookAddrBookClient_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookClientTypeLib_LIBRARY_DEFINED__
|
||||
#define __IMsOutlookAddrBookClientTypeLib_LIBRARY_DEFINED__
|
||||
|
||||
/* library IMsOutlookAddrBookClientTypeLib */
|
||||
/* [helpstring][version][uuid] */
|
||||
|
||||
|
||||
|
||||
EXTERN_C const IID LIBID_IMsOutlookAddrBookClientTypeLib;
|
||||
#endif /* __IMsOutlookAddrBookClientTypeLib_LIBRARY_DEFINED__ */
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
|
||||
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -1,251 +1,265 @@
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.00.0595 */
|
||||
/* at Tue May 07 03:41:42 2013
|
||||
*/
|
||||
/* Compiler settings for IMsOutlookAddrBookServer.idl:
|
||||
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
|
||||
protocol : dce , ms_ext, c_ext, robust
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
VC __declspec() decoration level:
|
||||
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
|
||||
DECLSPEC_UUID(), MIDL_INTERFACE()
|
||||
*/
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
//#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_h__
|
||||
#define __IMsOutlookAddrBookServer_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookServer IMsOutlookAddrBookServer;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookServer_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookServer IMsOutlookAddrBookServer;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookServer_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "Unknwn.h"
|
||||
#include "oaidl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_INTERFACE_DEFINED__
|
||||
#define __IMsOutlookAddrBookServer_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IMsOutlookAddrBookServer */
|
||||
/* [oleautomation][dual][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IMsOutlookAddrBookServer;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("5DDE9FF0-AC48-11E2-9E96-0800200C9A66")
|
||||
IMsOutlookAddrBookServer : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE foreachMailUser(
|
||||
/* [in] */ BSTR query) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE IMAPIProp_GetProps(
|
||||
/* [in] */ BSTR entryId,
|
||||
/* [in] */ int nbPropIds,
|
||||
/* [in] */ SAFEARRAY * propIds,
|
||||
/* [in] */ long flags,
|
||||
/* [out] */ SAFEARRAY * *props,
|
||||
/* [out] */ SAFEARRAY * *propsLength,
|
||||
/* [out] */ SAFEARRAY * *propsType) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE createContact(
|
||||
/* [out] */ BSTR *id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE deleteContact(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE IMAPIProp_DeleteProp(
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR entryId) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE IMAPIProp_SetPropString(
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR value,
|
||||
/* [in] */ BSTR entryId) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IMsOutlookAddrBookServerVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
IMsOutlookAddrBookServer * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
IMsOutlookAddrBookServer * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *foreachMailUser )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ BSTR query);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *IMAPIProp_GetProps )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ BSTR entryId,
|
||||
/* [in] */ int nbPropIds,
|
||||
/* [in] */ SAFEARRAY * propIds,
|
||||
/* [in] */ long flags,
|
||||
/* [out] */ SAFEARRAY * *props,
|
||||
/* [out] */ SAFEARRAY * *propsLength,
|
||||
/* [out] */ SAFEARRAY * *propsType);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *createContact )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [out] */ BSTR *id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *deleteContact )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *IMAPIProp_DeleteProp )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR entryId);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *IMAPIProp_SetPropString )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR value,
|
||||
/* [in] */ BSTR entryId);
|
||||
|
||||
END_INTERFACE
|
||||
} IMsOutlookAddrBookServerVtbl;
|
||||
|
||||
interface IMsOutlookAddrBookServer
|
||||
{
|
||||
CONST_VTBL struct IMsOutlookAddrBookServerVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookServer_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookServer_foreachMailUser(This,query) \
|
||||
( (This)->lpVtbl -> foreachMailUser(This,query) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_IMAPIProp_GetProps(This,entryId,nbPropIds,propIds,flags,props,propsLength,propsType) \
|
||||
( (This)->lpVtbl -> IMAPIProp_GetProps(This,entryId,nbPropIds,propIds,flags,props,propsLength,propsType) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_createContact(This,id) \
|
||||
( (This)->lpVtbl -> createContact(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_deleteContact(This,id) \
|
||||
( (This)->lpVtbl -> deleteContact(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_IMAPIProp_DeleteProp(This,propId,entryId) \
|
||||
( (This)->lpVtbl -> IMAPIProp_DeleteProp(This,propId,entryId) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_IMAPIProp_SetPropString(This,propId,value,entryId) \
|
||||
( (This)->lpVtbl -> IMAPIProp_SetPropString(This,propId,value,entryId) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IMsOutlookAddrBookServer_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServerTypeLib_LIBRARY_DEFINED__
|
||||
#define __IMsOutlookAddrBookServerTypeLib_LIBRARY_DEFINED__
|
||||
|
||||
/* library IMsOutlookAddrBookServerTypeLib */
|
||||
/* [helpstring][version][uuid] */
|
||||
|
||||
|
||||
|
||||
EXTERN_C const IID LIBID_IMsOutlookAddrBookServerTypeLib;
|
||||
#endif /* __IMsOutlookAddrBookServerTypeLib_LIBRARY_DEFINED__ */
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
|
||||
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
|
||||
|
||||
unsigned long __RPC_USER LPSAFEARRAY_UserSize( unsigned long *, unsigned long , LPSAFEARRAY * );
|
||||
unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal( unsigned long *, unsigned char *, LPSAFEARRAY * );
|
||||
unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal(unsigned long *, unsigned char *, LPSAFEARRAY * );
|
||||
void __RPC_USER LPSAFEARRAY_UserFree( unsigned long *, LPSAFEARRAY * );
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.00.0595 */
|
||||
/* at Wed Jun 19 15:47:56 2013
|
||||
*/
|
||||
/* Compiler settings for IMsOutlookAddrBookServer.idl:
|
||||
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0595
|
||||
protocol : dce , ms_ext, c_ext, robust
|
||||
error checks: allocation ref bounds_check enum stub_data
|
||||
VC __declspec() decoration level:
|
||||
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
|
||||
DECLSPEC_UUID(), MIDL_INTERFACE()
|
||||
*/
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
//#pragma warning( disable: 4049 ) /* more than 64k source lines */
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif // __RPCNDR_H_VERSION__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_h__
|
||||
#define __IMsOutlookAddrBookServer_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookServer IMsOutlookAddrBookServer;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookServer_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
#define __IMsOutlookAddrBookServer_FWD_DEFINED__
|
||||
typedef interface IMsOutlookAddrBookServer IMsOutlookAddrBookServer;
|
||||
|
||||
#endif /* __IMsOutlookAddrBookServer_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "Unknwn.h"
|
||||
#include "oaidl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServer_INTERFACE_DEFINED__
|
||||
#define __IMsOutlookAddrBookServer_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IMsOutlookAddrBookServer */
|
||||
/* [oleautomation][dual][uuid][object] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_IMsOutlookAddrBookServer;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("5DDE9FF0-AC48-11E2-9E96-0800200C9A66")
|
||||
IMsOutlookAddrBookServer : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE foreachMailUser(
|
||||
/* [in] */ BSTR query) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE IMAPIProp_GetProps(
|
||||
/* [in] */ BSTR entryId,
|
||||
/* [in] */ int nbPropIds,
|
||||
/* [in] */ SAFEARRAY * propIds,
|
||||
/* [in] */ long flags,
|
||||
/* [out] */ SAFEARRAY * *props,
|
||||
/* [out] */ SAFEARRAY * *propsLength,
|
||||
/* [out] */ SAFEARRAY * *propsType) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE createContact(
|
||||
/* [out] */ BSTR *id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE deleteContact(
|
||||
/* [in] */ BSTR id) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE IMAPIProp_DeleteProp(
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR entryId) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE IMAPIProp_SetPropString(
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR value,
|
||||
/* [in] */ BSTR entryId) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE compareEntryIds(
|
||||
/* [in] */ BSTR id1,
|
||||
/* [in] */ BSTR id2,
|
||||
/* [out] */ int *result) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct IMsOutlookAddrBookServerVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
IMsOutlookAddrBookServer * This);
|
||||
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
IMsOutlookAddrBookServer * This);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *foreachMailUser )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ BSTR query);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *IMAPIProp_GetProps )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ BSTR entryId,
|
||||
/* [in] */ int nbPropIds,
|
||||
/* [in] */ SAFEARRAY * propIds,
|
||||
/* [in] */ long flags,
|
||||
/* [out] */ SAFEARRAY * *props,
|
||||
/* [out] */ SAFEARRAY * *propsLength,
|
||||
/* [out] */ SAFEARRAY * *propsType);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *createContact )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [out] */ BSTR *id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *deleteContact )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ BSTR id);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *IMAPIProp_DeleteProp )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR entryId);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *IMAPIProp_SetPropString )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ long propId,
|
||||
/* [in] */ BSTR value,
|
||||
/* [in] */ BSTR entryId);
|
||||
|
||||
HRESULT ( STDMETHODCALLTYPE *compareEntryIds )(
|
||||
IMsOutlookAddrBookServer * This,
|
||||
/* [in] */ BSTR id1,
|
||||
/* [in] */ BSTR id2,
|
||||
/* [out] */ int *result);
|
||||
|
||||
END_INTERFACE
|
||||
} IMsOutlookAddrBookServerVtbl;
|
||||
|
||||
interface IMsOutlookAddrBookServer
|
||||
{
|
||||
CONST_VTBL struct IMsOutlookAddrBookServerVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookServer_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define IMsOutlookAddrBookServer_foreachMailUser(This,query) \
|
||||
( (This)->lpVtbl -> foreachMailUser(This,query) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_IMAPIProp_GetProps(This,entryId,nbPropIds,propIds,flags,props,propsLength,propsType) \
|
||||
( (This)->lpVtbl -> IMAPIProp_GetProps(This,entryId,nbPropIds,propIds,flags,props,propsLength,propsType) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_createContact(This,id) \
|
||||
( (This)->lpVtbl -> createContact(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_deleteContact(This,id) \
|
||||
( (This)->lpVtbl -> deleteContact(This,id) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_IMAPIProp_DeleteProp(This,propId,entryId) \
|
||||
( (This)->lpVtbl -> IMAPIProp_DeleteProp(This,propId,entryId) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_IMAPIProp_SetPropString(This,propId,value,entryId) \
|
||||
( (This)->lpVtbl -> IMAPIProp_SetPropString(This,propId,value,entryId) )
|
||||
|
||||
#define IMsOutlookAddrBookServer_compareEntryIds(This,id1,id2,result) \
|
||||
( (This)->lpVtbl -> compareEntryIds(This,id1,id2,result) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __IMsOutlookAddrBookServer_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
|
||||
#ifndef __IMsOutlookAddrBookServerTypeLib_LIBRARY_DEFINED__
|
||||
#define __IMsOutlookAddrBookServerTypeLib_LIBRARY_DEFINED__
|
||||
|
||||
/* library IMsOutlookAddrBookServerTypeLib */
|
||||
/* [helpstring][version][uuid] */
|
||||
|
||||
|
||||
|
||||
EXTERN_C const IID LIBID_IMsOutlookAddrBookServerTypeLib;
|
||||
#endif /* __IMsOutlookAddrBookServerTypeLib_LIBRARY_DEFINED__ */
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
|
||||
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
|
||||
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
|
||||
|
||||
unsigned long __RPC_USER LPSAFEARRAY_UserSize( unsigned long *, unsigned long , LPSAFEARRAY * );
|
||||
unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal( unsigned long *, unsigned char *, LPSAFEARRAY * );
|
||||
unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal(unsigned long *, unsigned char *, LPSAFEARRAY * );
|
||||
void __RPC_USER LPSAFEARRAY_UserFree( unsigned long *, LPSAFEARRAY * );
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@ -1,47 +1,46 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#include "net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService.h"
|
||||
|
||||
#include "MsOutlookAddrBookContactSourceService.h"
|
||||
|
||||
#include "MsOutlookMAPIHResultException.h"
|
||||
#include "MAPINotification.h"
|
||||
#include "MAPIBitness.h"
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService_MAPIInitialize
|
||||
(JNIEnv *jniEnv, jclass clazz, jlong version, jlong flags,
|
||||
jobject notificationsDelegate)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
MAPINotification_registerJniNotificationsDelegate(
|
||||
jniEnv,
|
||||
notificationsDelegate);
|
||||
|
||||
hr = MsOutlookAddrBookContactSourceService_MAPIInitializeCOMServer();
|
||||
|
||||
if (HR_FAILED(hr))
|
||||
{
|
||||
// Report any possible error regardless of where it has come from.
|
||||
MsOutlookMAPIHResultException_throwNew(
|
||||
jniEnv,
|
||||
hr,
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService_MAPIUninitialize
|
||||
(JNIEnv *jniEnv, jclass clazz)
|
||||
{
|
||||
MAPINotification_unregisterJniNotificationsDelegate(jniEnv);
|
||||
|
||||
MsOutlookAddrBookContactSourceService_MAPIUninitializeCOMServer();
|
||||
}
|
||||
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#include "net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService.h"
|
||||
|
||||
#include "MsOutlookAddrBookContactSourceService.h"
|
||||
|
||||
#include "MsOutlookMAPIHResultException.h"
|
||||
#include "MAPINotification.h"
|
||||
#include "MAPIBitness.h"
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService_MAPIInitialize
|
||||
(JNIEnv *jniEnv, jclass clazz, jlong version, jlong flags,
|
||||
jobject notificationsDelegate)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
MAPINotification_registerJniNotificationsDelegate(
|
||||
jniEnv,
|
||||
notificationsDelegate);
|
||||
|
||||
hr = MsOutlookAddrBookContactSourceService_MAPIInitializeCOMServer();
|
||||
|
||||
if (HR_FAILED(hr))
|
||||
{
|
||||
// Report any possible error regardless of where it has come from.
|
||||
MsOutlookMAPIHResultException_throwNew(
|
||||
jniEnv,
|
||||
hr,
|
||||
__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService_MAPIUninitialize
|
||||
(JNIEnv *jniEnv, jclass clazz)
|
||||
{
|
||||
MAPINotification_unregisterJniNotificationsDelegate(jniEnv);
|
||||
|
||||
MsOutlookAddrBookContactSourceService_MAPIUninitializeCOMServer();
|
||||
}
|
||||
|
||||
@ -1,31 +1,31 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService */
|
||||
|
||||
#ifndef _Included_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
#define _Included_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
* Method: MAPIInitialize
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService */
|
||||
|
||||
#ifndef _Included_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
#define _Included_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
* Method: MAPIInitialize
|
||||
* Signature: (JJ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService_MAPIInitialize
|
||||
(JNIEnv *, jclass, jlong, jlong, jobject);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
* Method: MAPIUninitialize
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService_MAPIUninitialize
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
(JNIEnv *, jclass, jlong, jlong, jobject);
|
||||
|
||||
/*
|
||||
* Class: net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService
|
||||
* Method: MAPIUninitialize
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_java_sip_communicator_plugin_addrbook_msoutlook_MsOutlookAddrBookContactSourceService_MAPIUninitialize
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1,273 +1,273 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.plugin.addrbook;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.java.sip.communicator.service.contactsource.*;
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
import net.java.sip.communicator.util.Logger;
|
||||
|
||||
import org.jitsi.service.configuration.*;
|
||||
import org.jitsi.service.resources.*;
|
||||
import org.jitsi.util.*;
|
||||
import org.osgi.framework.*;
|
||||
|
||||
/**
|
||||
* Implements <tt>BundleActivator</tt> for the addrbook plug-in which provides
|
||||
* support for OS-specific Address Book.
|
||||
*
|
||||
* @author Lyubomir Marinov
|
||||
*/
|
||||
public class AddrBookActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
/**
|
||||
* Boolean property that defines whether the integration of the Outlook
|
||||
* address book is enabled.
|
||||
*/
|
||||
public static final String PNAME_ENABLE_MICROSOFT_OUTLOOK_SEARCH =
|
||||
"plugin.addrbook.ENABLE_MICROSOFT_OUTLOOK_SEARCH";
|
||||
/**
|
||||
* Boolean property that defines whether the integration of the OS X
|
||||
* address book is enabled.
|
||||
*/
|
||||
public static final String PNAME_ENABLE_MACOSX_ADDRESS_BOOK_SEARCH =
|
||||
"plugin.addrbook.ENABLE_MACOSX_ADDRESS_BOOK_SEARCH";
|
||||
|
||||
/**
|
||||
* The <tt>Logger</tt> used by the <tt>AddrBookActivator</tt> class and its
|
||||
* instances for logging output.
|
||||
*/
|
||||
private static final Logger logger
|
||||
= Logger.getLogger(AddrBookActivator.class);
|
||||
|
||||
/**
|
||||
* The <tt>BundleContext</tt> in which the addrbook plug-in is started.
|
||||
*/
|
||||
private static BundleContext bundleContext;
|
||||
|
||||
/**
|
||||
* The <tt>ContactSourceService</tt> implementation for the OS-specific
|
||||
* Address Book.
|
||||
*/
|
||||
private static ContactSourceService css;
|
||||
|
||||
/**
|
||||
* The <tt>ServiceRegistration</tt> of {@link #css} in the
|
||||
* <tt>BundleContext</tt> in which this <tt>AddrBookActivator</tt> has been
|
||||
* started.
|
||||
*/
|
||||
private static ServiceRegistration cssServiceRegistration;
|
||||
|
||||
/**
|
||||
* The <tt>ResourceManagementService</tt> through which we access resources.
|
||||
*/
|
||||
private static ResourceManagementService resourceService;
|
||||
|
||||
/**
|
||||
* The <tt>ConfigurationService</tt> through which we access configuration
|
||||
* properties.
|
||||
*/
|
||||
private static ConfigurationService configService;
|
||||
|
||||
/**
|
||||
* Gets the <tt>ResourceManagementService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in.
|
||||
*
|
||||
* @return the <tt>ResourceManagementService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in
|
||||
*/
|
||||
public static ResourceManagementService getResources()
|
||||
{
|
||||
if (resourceService == null)
|
||||
{
|
||||
resourceService
|
||||
= ServiceUtils.getService(
|
||||
bundleContext,
|
||||
ResourceManagementService.class);
|
||||
}
|
||||
return resourceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the <tt>ConfigurationService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in.
|
||||
*
|
||||
* @return the <tt>ConfigurationService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in
|
||||
*/
|
||||
public static ConfigurationService getConfigService()
|
||||
{
|
||||
if (configService == null)
|
||||
{
|
||||
configService
|
||||
= ServiceUtils.getService(
|
||||
bundleContext,
|
||||
ConfigurationService.class);
|
||||
}
|
||||
return configService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the addrbook plug-in.
|
||||
*
|
||||
* @param bundleContext the <tt>BundleContext</tt> in which the addrbook
|
||||
* plug-in is to be started
|
||||
* @throws Exception if anything goes wrong while starting the addrbook
|
||||
* plug-in
|
||||
* @see BundleActivator#start(BundleContext)
|
||||
*/
|
||||
public void start(BundleContext bundleContext)
|
||||
throws Exception
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ "plugin.addrbook.ADDRESS_BOOKS"
|
||||
+ "\" ... [STARTED]");
|
||||
|
||||
AddrBookActivator.bundleContext = bundleContext;
|
||||
|
||||
Dictionary<String, String> properties = new Hashtable<String, String>();
|
||||
|
||||
// Registers the sip config panel as advanced configuration form.
|
||||
properties.put( ConfigurationForm.FORM_TYPE,
|
||||
ConfigurationForm.CONTACT_SOURCE_TYPE);
|
||||
|
||||
bundleContext.registerService(
|
||||
ConfigurationForm.class.getName(),
|
||||
new LazyConfigurationForm(
|
||||
AdvancedConfigForm.class.getName(),
|
||||
getClass().getClassLoader(),
|
||||
null,
|
||||
"plugin.addrbook.ADDRESS_BOOKS",
|
||||
101, false),
|
||||
properties);
|
||||
|
||||
startService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the addrbook plug-in.
|
||||
*
|
||||
* @param bundleContext the <tt>BundleContext</tt> in which the addrbook
|
||||
* plug-in is to be stopped
|
||||
* @throws Exception if anything goes wrong while stopping the addrbook
|
||||
* plug-in
|
||||
* @see BundleActivator#stop(BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext bundleContext)
|
||||
throws Exception
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ "plugin.addrbook.ADDRESS_BOOKS"
|
||||
+ "\" ... [STOPPED]");
|
||||
|
||||
stopService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the address book service.
|
||||
*/
|
||||
static void startService()
|
||||
{
|
||||
/* Register the ContactSourceService implementation (if any). */
|
||||
String cssClassName;
|
||||
|
||||
if (OSUtils.IS_WINDOWS
|
||||
&& getConfigService().getBoolean(
|
||||
PNAME_ENABLE_MICROSOFT_OUTLOOK_SEARCH, true))
|
||||
|
||||
{
|
||||
cssClassName
|
||||
= "net.java.sip.communicator.plugin.addrbook"
|
||||
+ ".msoutlook.MsOutlookAddrBookContactSourceService";
|
||||
}
|
||||
else if (OSUtils.IS_MAC
|
||||
&& getConfigService().getBoolean(
|
||||
PNAME_ENABLE_MACOSX_ADDRESS_BOOK_SEARCH, true))
|
||||
{
|
||||
cssClassName
|
||||
= "net.java.sip.communicator.plugin.addrbook"
|
||||
+ ".macosx.MacOSXAddrBookContactSourceService";
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
css
|
||||
= (ContactSourceService)
|
||||
Class.forName(cssClassName).newInstance();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.error("Failed to instantiate " + cssClassName + " reason:"
|
||||
+ ex.getMessage());
|
||||
|
||||
if(logger.isDebugEnabled())
|
||||
logger.debug("Failed to instantiate " + cssClassName, ex);
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
cssServiceRegistration
|
||||
= bundleContext.registerService(
|
||||
ContactSourceService.class.getName(),
|
||||
css,
|
||||
null);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (cssServiceRegistration == null)
|
||||
{
|
||||
if (css instanceof AsyncContactSourceService)
|
||||
((AsyncContactSourceService) css).stop();
|
||||
css = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ css.getDisplayName()
|
||||
+ "\" ... [REGISTERED]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the previously registered service.
|
||||
*/
|
||||
static void stopService()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cssServiceRegistration != null)
|
||||
{
|
||||
cssServiceRegistration.unregister();
|
||||
cssServiceRegistration = null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (css != null)
|
||||
{
|
||||
if (css instanceof AsyncContactSourceService)
|
||||
((AsyncContactSourceService) css).stop();
|
||||
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ css.getDisplayName()
|
||||
+ "\" ... [UNREGISTERED]");
|
||||
|
||||
css = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.plugin.addrbook;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.java.sip.communicator.service.contactsource.*;
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
import net.java.sip.communicator.util.Logger;
|
||||
|
||||
import org.jitsi.service.configuration.*;
|
||||
import org.jitsi.service.resources.*;
|
||||
import org.jitsi.util.*;
|
||||
import org.osgi.framework.*;
|
||||
|
||||
/**
|
||||
* Implements <tt>BundleActivator</tt> for the addrbook plug-in which provides
|
||||
* support for OS-specific Address Book.
|
||||
*
|
||||
* @author Lyubomir Marinov
|
||||
*/
|
||||
public class AddrBookActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
/**
|
||||
* Boolean property that defines whether the integration of the Outlook
|
||||
* address book is enabled.
|
||||
*/
|
||||
public static final String PNAME_ENABLE_MICROSOFT_OUTLOOK_SEARCH =
|
||||
"plugin.addrbook.ENABLE_MICROSOFT_OUTLOOK_SEARCH";
|
||||
/**
|
||||
* Boolean property that defines whether the integration of the OS X
|
||||
* address book is enabled.
|
||||
*/
|
||||
public static final String PNAME_ENABLE_MACOSX_ADDRESS_BOOK_SEARCH =
|
||||
"plugin.addrbook.ENABLE_MACOSX_ADDRESS_BOOK_SEARCH";
|
||||
|
||||
/**
|
||||
* The <tt>Logger</tt> used by the <tt>AddrBookActivator</tt> class and its
|
||||
* instances for logging output.
|
||||
*/
|
||||
private static final Logger logger
|
||||
= Logger.getLogger(AddrBookActivator.class);
|
||||
|
||||
/**
|
||||
* The <tt>BundleContext</tt> in which the addrbook plug-in is started.
|
||||
*/
|
||||
private static BundleContext bundleContext;
|
||||
|
||||
/**
|
||||
* The <tt>ContactSourceService</tt> implementation for the OS-specific
|
||||
* Address Book.
|
||||
*/
|
||||
private static ContactSourceService css;
|
||||
|
||||
/**
|
||||
* The <tt>ServiceRegistration</tt> of {@link #css} in the
|
||||
* <tt>BundleContext</tt> in which this <tt>AddrBookActivator</tt> has been
|
||||
* started.
|
||||
*/
|
||||
private static ServiceRegistration cssServiceRegistration;
|
||||
|
||||
/**
|
||||
* The <tt>ResourceManagementService</tt> through which we access resources.
|
||||
*/
|
||||
private static ResourceManagementService resourceService;
|
||||
|
||||
/**
|
||||
* The <tt>ConfigurationService</tt> through which we access configuration
|
||||
* properties.
|
||||
*/
|
||||
private static ConfigurationService configService;
|
||||
|
||||
/**
|
||||
* Gets the <tt>ResourceManagementService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in.
|
||||
*
|
||||
* @return the <tt>ResourceManagementService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in
|
||||
*/
|
||||
public static ResourceManagementService getResources()
|
||||
{
|
||||
if (resourceService == null)
|
||||
{
|
||||
resourceService
|
||||
= ServiceUtils.getService(
|
||||
bundleContext,
|
||||
ResourceManagementService.class);
|
||||
}
|
||||
return resourceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the <tt>ConfigurationService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in.
|
||||
*
|
||||
* @return the <tt>ConfigurationService</tt> to be used by the
|
||||
* functionality of the addrbook plug-in
|
||||
*/
|
||||
public static ConfigurationService getConfigService()
|
||||
{
|
||||
if (configService == null)
|
||||
{
|
||||
configService
|
||||
= ServiceUtils.getService(
|
||||
bundleContext,
|
||||
ConfigurationService.class);
|
||||
}
|
||||
return configService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the addrbook plug-in.
|
||||
*
|
||||
* @param bundleContext the <tt>BundleContext</tt> in which the addrbook
|
||||
* plug-in is to be started
|
||||
* @throws Exception if anything goes wrong while starting the addrbook
|
||||
* plug-in
|
||||
* @see BundleActivator#start(BundleContext)
|
||||
*/
|
||||
public void start(BundleContext bundleContext)
|
||||
throws Exception
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ "plugin.addrbook.ADDRESS_BOOKS"
|
||||
+ "\" ... [STARTED]");
|
||||
|
||||
AddrBookActivator.bundleContext = bundleContext;
|
||||
|
||||
Dictionary<String, String> properties = new Hashtable<String, String>();
|
||||
|
||||
// Registers the sip config panel as advanced configuration form.
|
||||
properties.put( ConfigurationForm.FORM_TYPE,
|
||||
ConfigurationForm.CONTACT_SOURCE_TYPE);
|
||||
|
||||
bundleContext.registerService(
|
||||
ConfigurationForm.class.getName(),
|
||||
new LazyConfigurationForm(
|
||||
AdvancedConfigForm.class.getName(),
|
||||
getClass().getClassLoader(),
|
||||
null,
|
||||
"plugin.addrbook.ADDRESS_BOOKS",
|
||||
101, false),
|
||||
properties);
|
||||
|
||||
startService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the addrbook plug-in.
|
||||
*
|
||||
* @param bundleContext the <tt>BundleContext</tt> in which the addrbook
|
||||
* plug-in is to be stopped
|
||||
* @throws Exception if anything goes wrong while stopping the addrbook
|
||||
* plug-in
|
||||
* @see BundleActivator#stop(BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext bundleContext)
|
||||
throws Exception
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ "plugin.addrbook.ADDRESS_BOOKS"
|
||||
+ "\" ... [STOPPED]");
|
||||
|
||||
stopService();
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the address book service.
|
||||
*/
|
||||
static void startService()
|
||||
{
|
||||
/* Register the ContactSourceService implementation (if any). */
|
||||
String cssClassName;
|
||||
|
||||
if (OSUtils.IS_WINDOWS
|
||||
&& getConfigService().getBoolean(
|
||||
PNAME_ENABLE_MICROSOFT_OUTLOOK_SEARCH, true))
|
||||
|
||||
{
|
||||
cssClassName
|
||||
= "net.java.sip.communicator.plugin.addrbook"
|
||||
+ ".msoutlook.MsOutlookAddrBookContactSourceService";
|
||||
}
|
||||
else if (OSUtils.IS_MAC
|
||||
&& getConfigService().getBoolean(
|
||||
PNAME_ENABLE_MACOSX_ADDRESS_BOOK_SEARCH, true))
|
||||
{
|
||||
cssClassName
|
||||
= "net.java.sip.communicator.plugin.addrbook"
|
||||
+ ".macosx.MacOSXAddrBookContactSourceService";
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
css
|
||||
= (ContactSourceService)
|
||||
Class.forName(cssClassName).newInstance();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.error("Failed to instantiate " + cssClassName + " reason:"
|
||||
+ ex.getMessage());
|
||||
|
||||
if(logger.isDebugEnabled())
|
||||
logger.debug("Failed to instantiate " + cssClassName, ex);
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
cssServiceRegistration
|
||||
= bundleContext.registerService(
|
||||
ContactSourceService.class.getName(),
|
||||
css,
|
||||
null);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (cssServiceRegistration == null)
|
||||
{
|
||||
if (css instanceof AsyncContactSourceService)
|
||||
((AsyncContactSourceService) css).stop();
|
||||
css = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ css.getDisplayName()
|
||||
+ "\" ... [REGISTERED]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the previously registered service.
|
||||
*/
|
||||
static void stopService()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cssServiceRegistration != null)
|
||||
{
|
||||
cssServiceRegistration.unregister();
|
||||
cssServiceRegistration = null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (css != null)
|
||||
{
|
||||
if (css instanceof AsyncContactSourceService)
|
||||
((AsyncContactSourceService) css).stop();
|
||||
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Address book \""
|
||||
+ css.getDisplayName()
|
||||
+ "\" ... [UNREGISTERED]");
|
||||
|
||||
css = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue