1 /**
2  * @file enum-types.h Enum types for Media API
3  * @ingroup core
4  */
5 
6 /* purple
7  *
8  * Purple is the legal property of its developers, whose names are too numerous
9  * to list here.  Please refer to the COPYRIGHT file distributed with this
10  * source distribution.
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
25  */
26 
27 #ifndef _PURPLE_MEDIA_ENUM_TYPES_H_
28 #define _PURPLE_MEDIA_ENUM_TYPES_H_
29 
30 #include <glib-object.h>
31 
32 G_BEGIN_DECLS
33 
34 #define PURPLE_TYPE_MEDIA_CANDIDATE_TYPE   (purple_media_candidate_type_get_type())
35 #define PURPLE_MEDIA_TYPE_CAPS	           (purple_media_caps_get_type())
36 #define PURPLE_MEDIA_TYPE_INFO_TYPE	   (purple_media_info_type_get_type())
37 #define PURPLE_TYPE_MEDIA_NETWORK_PROTOCOL (purple_media_network_protocol_get_type())
38 #define PURPLE_TYPE_MEDIA_SESSION_TYPE     (purple_media_session_type_get_type())
39 #define PURPLE_MEDIA_TYPE_STATE            (purple_media_state_changed_get_type())
40 
41 /** Media candidate types */
42 typedef enum {
43 	PURPLE_MEDIA_CANDIDATE_TYPE_HOST,
44 	PURPLE_MEDIA_CANDIDATE_TYPE_SRFLX,
45 	PURPLE_MEDIA_CANDIDATE_TYPE_PRFLX,
46 	PURPLE_MEDIA_CANDIDATE_TYPE_RELAY,
47 	PURPLE_MEDIA_CANDIDATE_TYPE_MULTICAST
48 } PurpleMediaCandidateType;
49 
50 /** Media caps */
51 typedef enum {
52 	PURPLE_MEDIA_CAPS_NONE = 0,
53 	PURPLE_MEDIA_CAPS_AUDIO = 1,
54 	PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION = 1 << 1,
55 	PURPLE_MEDIA_CAPS_VIDEO = 1 << 2,
56 	PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION = 1 << 3,
57 	PURPLE_MEDIA_CAPS_AUDIO_VIDEO = 1 << 4,
58 	PURPLE_MEDIA_CAPS_MODIFY_SESSION = 1 << 5,
59 	PURPLE_MEDIA_CAPS_CHANGE_DIRECTION = 1 << 6
60 } PurpleMediaCaps;
61 
62 /** Media component types */
63 typedef enum {
64 	PURPLE_MEDIA_COMPONENT_NONE = 0,
65 	PURPLE_MEDIA_COMPONENT_RTP = 1,
66 	PURPLE_MEDIA_COMPONENT_RTCP = 2
67 } PurpleMediaComponentType;
68 
69 /** Media info types */
70 typedef enum {
71 	PURPLE_MEDIA_INFO_HANGUP = 0,
72 	PURPLE_MEDIA_INFO_ACCEPT,
73 	PURPLE_MEDIA_INFO_REJECT,
74 	PURPLE_MEDIA_INFO_MUTE,
75 	PURPLE_MEDIA_INFO_UNMUTE,
76 	PURPLE_MEDIA_INFO_PAUSE,
77 	PURPLE_MEDIA_INFO_UNPAUSE,
78 	PURPLE_MEDIA_INFO_HOLD,
79 	PURPLE_MEDIA_INFO_UNHOLD
80 } PurpleMediaInfoType;
81 
82 /** Media network protocols */
83 typedef enum {
84 	PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
85 	PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_PASSIVE,
86 	PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_ACTIVE,
87 	PURPLE_MEDIA_NETWORK_PROTOCOL_TCP_SO,
88 } PurpleMediaNetworkProtocol;
89 
90 /** Media session types */
91 typedef enum {
92 	PURPLE_MEDIA_NONE	= 0,
93 	PURPLE_MEDIA_RECV_AUDIO = 1 << 0,
94 	PURPLE_MEDIA_SEND_AUDIO = 1 << 1,
95 	PURPLE_MEDIA_RECV_VIDEO = 1 << 2,
96 	PURPLE_MEDIA_SEND_VIDEO = 1 << 3,
97 	PURPLE_MEDIA_RECV_APPLICATION = 1 << 4,
98 	PURPLE_MEDIA_SEND_APPLICATION = 1 << 5,
99 	PURPLE_MEDIA_AUDIO = PURPLE_MEDIA_RECV_AUDIO | PURPLE_MEDIA_SEND_AUDIO,
100 	PURPLE_MEDIA_VIDEO = PURPLE_MEDIA_RECV_VIDEO | PURPLE_MEDIA_SEND_VIDEO,
101 	PURPLE_MEDIA_APPLICATION = PURPLE_MEDIA_RECV_APPLICATION |
102                                    PURPLE_MEDIA_SEND_APPLICATION,
103 	PURPLE_MEDIA_SEND = PURPLE_MEDIA_SEND_AUDIO | PURPLE_MEDIA_SEND_VIDEO |
104 			    PURPLE_MEDIA_SEND_APPLICATION,
105 	PURPLE_MEDIA_RECV = PURPLE_MEDIA_RECV_AUDIO | PURPLE_MEDIA_RECV_VIDEO |
106 			    PURPLE_MEDIA_RECV_APPLICATION
107 } PurpleMediaSessionType;
108 
109 /** Media state-changed types */
110 typedef enum {
111 	PURPLE_MEDIA_STATE_NEW = 0,
112 	PURPLE_MEDIA_STATE_CONNECTED,
113 	PURPLE_MEDIA_STATE_END
114 } PurpleMediaState;
115 
116 /**
117  * Gets the media candidate type's GType
118  *
119  * @return The media candidate type's GType.
120  *
121  * @since 2.6.0
122  */
123 GType purple_media_candidate_type_get_type(void);
124 
125 /**
126  * Gets the type of the media caps flags
127  *
128  * @return The media caps flags' GType
129  *
130  * @since 2.7.0
131  */
132 GType purple_media_caps_get_type(void);
133 
134 /**
135  * Gets the type of the info type enum
136  *
137  * @return The info type enum's GType
138  *
139  * @since 2.6.0
140  */
141 GType purple_media_info_type_get_type(void);
142 
143 /**
144  * Gets the media network protocol's GType
145  *
146  * @return The media network protocol's GType.
147  *
148  * @since 2.6.0
149  */
150 GType purple_media_network_protocol_get_type(void);
151 
152 /**
153  * Gets the media session type's GType
154  *
155  * @return The media session type's GType.
156  *
157  * @since 2.6.0
158  */
159 GType purple_media_session_type_get_type(void);
160 
161 /**
162  * Gets the type of the state-changed enum
163  *
164  * @return The state-changed enum's GType
165  *
166  * @since 2.6.0
167  */
168 GType purple_media_state_changed_get_type(void);
169 
170 G_END_DECLS
171 
172 #endif  /* _PURPLE_MEDIA_ENUM_TYPES_ */
173