~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/iscomposing.h

  • Committer: Package Import Robot
  • Author(s): Francois Marier
  • Date: 2011-11-25 13:24:12 UTC
  • mfrom: (4.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20111125132412-dc4qvhyosk74cd42
Tags: 1.0.1-4
Don't assume that arch:all packages will get built (closes: #649726)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: iscomposing.h 2394 2008-12-23 17:27:53Z bennylp $ */
2
 
/* 
3
 
 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4
 
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5
 
 *
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.
10
 
 *
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.
15
 
 *
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 
19
 
 *
20
 
 *  Additional permission under GNU GPL version 3 section 7:
21
 
 *
22
 
 *  If you modify this program, or any covered work, by linking or
23
 
 *  combining it with the OpenSSL project's OpenSSL library (or a
24
 
 *  modified version of that library), containing parts covered by the
25
 
 *  terms of the OpenSSL or SSLeay licenses, Teluu Inc. (http://www.teluu.com)
26
 
 *  grants you additional permission to convey the resulting work.
27
 
 *  Corresponding Source for a non-source form of such a combination
28
 
 *  shall include the source code for the parts of OpenSSL used as well
29
 
 *  as that of the covered work.
30
 
 */
31
 
#ifndef __PJSIP_SIMPLE_ISCOMPOSING_H__
32
 
#define __PJSIP_SIMPLE_ISCOMPOSING_H__
33
 
 
34
 
/**
35
 
 * @file iscomposing.h
36
 
 * @brief Support for Indication of Message Composition (RFC 3994)
37
 
 */
38
 
#include <pjsip-simple/types.h>
39
 
#include <pjlib-util/xml.h>
40
 
 
41
 
/**
42
 
 * @defgroup PJSIP_ISCOMPOSING Message Composition Indication (RFC 3994)
43
 
 * @ingroup PJSIP_SIMPLE
44
 
 * @brief Support for Indication of Message Composition (RFC 3994)
45
 
 * @{
46
 
 *
47
 
 * This implements message composition indication, as described in
48
 
 * RFC 3994.
49
 
 */
50
 
 
51
 
PJ_BEGIN_DECL
52
 
 
53
 
 
54
 
/**
55
 
 * Create XML message with MIME type "application/im-iscomposing+xml"
56
 
 * to indicate the message composition status.
57
 
 *
58
 
 * @param pool              Pool to allocate memory.
59
 
 * @param is_composing      Message composition indication status. Set to
60
 
 *                          PJ_TRUE (or non-zero) to indicate that application
61
 
 *                          is currently composing an instant message.
62
 
 * @param lst_actv          Optional attribute to indicate time of last
63
 
 *                          activity. If none is to be specified, the value
64
 
 *                          MUST be set to NULL.
65
 
 * @param content_tp        Optional attribute to indicate the content type of
66
 
 *                          message being composed. If none is to be specified, 
67
 
 *                          the value MUST be set to NULL.
68
 
 * @param refresh           Optional attribute to indicate the interval when
69
 
 *                          next indication will be sent, only when 
70
 
 *                          is_composing is non-zero. If none is to be 
71
 
 *                          specified, the value MUST be set to -1.
72
 
 *
73
 
 * @return                  An XML message containing the message indication.
74
 
 *                          NULL will be returned when there's not enough
75
 
 *                          memory to allocate the message.
76
 
 */
77
 
PJ_DECL(pj_xml_node*) pjsip_iscomposing_create_xml(pj_pool_t *pool,
78
 
                                                   pj_bool_t is_composing,
79
 
                                                   const pj_time_val *lst_actv,
80
 
                                                   const pj_str_t *content_tp,
81
 
                                                   int refresh);
82
 
 
83
 
 
84
 
/**
85
 
 * Create message body with Content-Type "application/im-iscomposing+xml"
86
 
 * to indicate the message composition status.
87
 
 *
88
 
 * @param pool              Pool to allocate memory.
89
 
 * @param is_composing      Message composition indication status. Set to
90
 
 *                          PJ_TRUE (or non-zero) to indicate that application
91
 
 *                          is currently composing an instant message.
92
 
 * @param lst_actv          Optional attribute to indicate time of last
93
 
 *                          activity. If none is to be specified, the value
94
 
 *                          MUST be set to NULL.
95
 
 * @param content_tp        Optional attribute to indicate the content type of
96
 
 *                          message being composed. If none is to be specified, 
97
 
 *                          the value MUST be set to NULL.
98
 
 * @param refresh           Optional attribute to indicate the interval when
99
 
 *                          next indication will be sent, only when 
100
 
 *                          is_composing is non-zero. If none is to be 
101
 
 *                          specified, the value MUST be set to -1.
102
 
 *
103
 
 * @return                  The SIP message body containing XML message 
104
 
 *                          indication. NULL will be returned when there's not
105
 
 *                          enough memory to allocate the message.
106
 
 */
107
 
PJ_DECL(pjsip_msg_body*) pjsip_iscomposing_create_body( pj_pool_t *pool,
108
 
                                                   pj_bool_t is_composing,
109
 
                                                   const pj_time_val *lst_actv,
110
 
                                                   const pj_str_t *content_tp,
111
 
                                                   int refresh);
112
 
 
113
 
 
114
 
/**
115
 
 * Parse the buffer and return message composition indication in the 
116
 
 * message.
117
 
 *
118
 
 * @param pool              Pool to allocate memory for the parsing process.
119
 
 * @param msg               The message to be parsed.
120
 
 * @param len               Length of the message.
121
 
 * @param p_is_composing    Optional pointer to receive iscomposing status.
122
 
 * @param p_last_active     Optional pointer to receive last active attribute.
123
 
 * @param p_content_type    Optional pointer to receive content type attribute.
124
 
 * @param p_refresh         Optional pointer to receive refresh time.
125
 
 *
126
 
 * @return                  PJ_SUCCESS if message can be successfully parsed.
127
 
 */
128
 
PJ_DECL(pj_status_t) pjsip_iscomposing_parse( pj_pool_t *pool,
129
 
                                              char *msg,
130
 
                                              pj_size_t len,
131
 
                                              pj_bool_t *p_is_composing,
132
 
                                              pj_str_t **p_last_active,
133
 
                                              pj_str_t **p_content_type,
134
 
                                              int *p_refresh );
135
 
 
136
 
 
137
 
/**
138
 
 * @}
139
 
 */
140
 
 
141
 
 
142
 
PJ_END_DECL
143
 
 
144
 
 
145
 
#endif  /* __PJSIP_SIMPLE_ISCOMPOSING_H__ */
146