~ubuntu-branches/ubuntu/quantal/linphone/quantal

« back to all changes in this revision

Viewing changes to osipua/src/bodycontext.h

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2006-11-15 10:34:50 UTC
  • mfrom: (1.2.1 upstream) (2.1.8 feisty)
  • Revision ID: james.westby@ubuntu.com-20061115103450-qgafwcks2lkhctlj
* New upstream release.
* Enable video support.
* Fix mismatched #endif in mscommon.h, closes: #398307.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 /*
2
 
  The osipua library is a library based on oSIP that implements CallLeg and User Agent
3
 
  level.
4
 
  Copyright (C) 2001  Simon MORLAT simon.morlat@free.fr
5
 
                                                                                        Aymeric MOIZARD jack@atosc.org
6
 
  This library is free software; you can redistribute it and/or
7
 
  modify it under the terms of the GNU Lesser General Public
8
 
  License as published by the Free Software Foundation; either
9
 
  version 2.1 of the License, or (at your option) any later version.
10
 
 
11
 
  This library 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 GNU
14
 
  Lesser General Public License for more details.
15
 
 
16
 
  You should have received a copy of the GNU Lesser General Public
17
 
  License along with this library; if not, write to the Free Software
18
 
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 
*/
20
 
 
21
 
#ifndef OSIPUA_H
22
 
#error "Do not include this file directly. Use osipua.h instead."
23
 
#endif
24
 
 
25
 
#ifndef BODYCONTEXT_H
26
 
#define BODYCONTEXT_H
27
 
 
28
 
//#include "osipua.h"
29
 
 
30
 
struct _BodyContext
31
 
{
32
 
        struct _BodyContextClass *klass;
33
 
        struct _BodyHandler *handler;   /* the handler of the context  */
34
 
        struct _OsipDialog *dialog;                     /* the dialog the handler must deal with */
35
 
        void *data;
36
 
};
37
 
 
38
 
typedef struct _BodyContext BodyContext;
39
 
 
40
 
 
41
 
typedef void (*BodyContextDestroyFunc)(BodyContext*);
42
 
typedef int (*BodyContextNotifyMessageFunc)(BodyContext*,sip_t *,char *body);
43
 
typedef int (*BodyContextAddBodyFunc)(BodyContext*,sip_t *);
44
 
 
45
 
struct _BodyContextClass
46
 
{
47
 
        BodyContextDestroyFunc _destroy;
48
 
        BodyContextNotifyMessageFunc _notify_inc_request;
49
 
        BodyContextNotifyMessageFunc _notify_inc_response;
50
 
        BodyContextAddBodyFunc _gen_out_request;
51
 
        BodyContextAddBodyFunc _gen_out_response;
52
 
};
53
 
 
54
 
typedef struct _BodyContextClass BodyContextClass;
55
 
 
56
 
#define BODY_CONTEXT(b)  ((BodyContext*)(b))
57
 
#define BODY_CONTEXT_CLASS(klass)       ((BodyContextClass*)(klass))
58
 
 
59
 
void body_context_init(BodyContext *obj, BodyHandler *info);
60
 
 
61
 
#define body_context_class_init(k)
62
 
 
63
 
#define body_context_get_mime(context)  ((context)->handler->klass->mime_type)
64
 
 
65
 
#define body_context_notify_inc_request(context, msg, body) \
66
 
                        (context)->klass->_notify_inc_request((context),(msg), (body))
67
 
 
68
 
#define body_context_notify_inc_response(context, msg, body) \
69
 
                        (context)->klass->_notify_inc_response((context),(msg),(body))
70
 
 
71
 
#define body_context_gen_out_request(context, msg) \
72
 
                        (context)->klass->_gen_out_request((context),(msg))
73
 
 
74
 
#define body_context_gen_out_response(context, msg) \
75
 
                        (context)->klass->_gen_out_response((context),(msg))
76
 
 
77
 
 
78
 
#define body_context_get_dialog(context)        ((context)->call)
79
 
 
80
 
#define body_context_get_handler(context)       ((context)->handler)
81
 
 
82
 
 
83
 
#endif
84
 
 
85
 
 
86
 
 
87