contact_providers_priv.h 2.47 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef CONTACT_PROVIDERS_PRIV_H
#define CONTACT_PROVIDERS_PRIV_H

20
#include "linphone/core.h"
21

22 23
#include "c-wrapper/c-wrapper.h"

24 25 26 27
/* Base for contact search and contact provider */

struct _LinphoneContactSearch{
	belle_sip_object_t base;
28
	LinphoneContactSearchID id;
29 30 31 32 33 34
	char* predicate;
	ContactSearchCallback cb;
	void* data;
};

#define LINPHONE_CONTACT_SEARCH(obj) BELLE_SIP_CAST(obj,LinphoneContactSearch)
Ghislain MARY's avatar
Ghislain MARY committed
35
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneContactSearch)
36 37 38 39 40 41 42 43 44 45 46 47


struct _LinphoneContactProvider {
	belle_sip_object_t base;
	LinphoneCore* lc;
};

#define LINPHONE_CONTACT_PROVIDER(obj) BELLE_SIP_CAST(obj,LinphoneContactProvider)

typedef LinphoneContactSearch* (*LinphoneContactProviderStartSearchMethod)( LinphoneContactProvider* thiz, const char* predicate, ContactSearchCallback cb, void* data );
typedef unsigned int           (*LinphoneContactProviderCancelSearchMethod)( LinphoneContactProvider* thiz, LinphoneContactSearch *request );

Ghislain MARY's avatar
Ghislain MARY committed
48
BELLE_SIP_DECLARE_CUSTOM_VPTR_BEGIN_NO_EXPORT(LinphoneContactProvider,belle_sip_object_t)
49 50 51 52 53 54 55 56 57 58 59
	const char* name; /*!< Name of the contact provider (LDAP, Google, ...) */

	/* pure virtual methods: inheriting objects must implement these */
	LinphoneContactProviderStartSearchMethod  begin_search;
	LinphoneContactProviderCancelSearchMethod cancel_search;
BELLE_SIP_DECLARE_CUSTOM_VPTR_END

/* LDAP search and contact providers */


#define LINPHONE_LDAP_CONTACT_SEARCH(obj) BELLE_SIP_CAST(obj,LinphoneLDAPContactSearch)
Ghislain MARY's avatar
Ghislain MARY committed
60
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneLDAPContactSearch)
61 62 63

#define LINPHONE_LDAP_CONTACT_PROVIDER(obj) BELLE_SIP_CAST(obj,LinphoneLDAPContactProvider)

Ghislain MARY's avatar
Ghislain MARY committed
64
BELLE_SIP_DECLARE_CUSTOM_VPTR_BEGIN_NO_EXPORT(LinphoneLDAPContactProvider,LinphoneContactProvider)
65 66 67 68
BELLE_SIP_DECLARE_CUSTOM_VPTR_END


#endif // CONTACT_PROVIDERS_PRIV_H