1
/* $Id: xpidf.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJSIP_SIMPLE_XPIDF_H__
21
#define __PJSIP_SIMPLE_XPIDF_H__
25
* @brief XPIDF/Presence Information Data Format
27
#include <pjsip-simple/types.h>
28
#include <pjlib-util/xml.h>
33
* @defgroup PJSIP_SIMPLE_XPIDF XPIDF/Presence Information Data Format
34
* @ingroup PJSIP_SIMPLE
35
* @brief Support for XPIDF/Presence Information Data Format
38
* This is an old presence data format as described in:
39
* draft-rosenberg-impp-pidf-00.txt.
41
* We won't support this format extensively here, as it seems there's not
42
* too many implementations support this anymore, as it shouldn't.
45
/** Type definitions for XPIDF root document. */
46
typedef pj_xml_node pjxpidf_pres;
50
* Create a new XPIDF document.
53
* @param uri URI to set in the XPIDF document.
55
* @return XPIDF document.
57
PJ_DECL(pjxpidf_pres*) pjxpidf_create(pj_pool_t *pool, const pj_str_t *uri);
61
* Parse XPIDF document.
64
* @param text Input text.
65
* @param len Length of input text.
67
* @return XPIDF document.
69
PJ_DECL(pjxpidf_pres*) pjxpidf_parse(pj_pool_t *pool, char *text, pj_size_t len);
73
* Print XPIDF document.
75
* @param pres The XPIDF document to print.
76
* @param text Buffer to place the output.
77
* @param len Length of the buffer.
79
* @return The length printed.
81
PJ_DECL(int) pjxpidf_print( pjxpidf_pres *pres, char *text, pj_size_t len);
85
* Get URI in the XPIDF document
87
* @param pres XPIDF document
89
* @return The URI, or an empty string.
91
PJ_DECL(pj_str_t*) pjxpidf_get_uri(pjxpidf_pres *pres);
95
* Set the URI of the XPIDF document.
98
* @param pres The XPIDF document.
99
* @param uri URI to set in the XPIDF document.
101
* @return Zero on success.
103
PJ_DECL(pj_status_t) pjxpidf_set_uri(pj_pool_t *pool, pjxpidf_pres *pres,
104
const pj_str_t *uri);
108
* Get presence status in the XPIDF document.
110
* @param pres XPIDF document.
112
* @return True to indicate the contact is online.
114
PJ_DECL(pj_bool_t) pjxpidf_get_status(pjxpidf_pres *pres);
118
* Set presence status in the XPIDF document.
120
* @param pres XPIDF document.
121
* @param status Status to set, True for online, False for offline.
123
* @return Zero on success.
125
PJ_DECL(pj_status_t) pjxpidf_set_status(pjxpidf_pres *pres, pj_bool_t status);
135
#endif /* __PJSIP_SIMPLE_XPIDF_H__ */