core cleanup: move out containers field
[siplcs.git] / src / core / sipe-core-private.h
blob894b4d94c1826fbdb0c01d7e5eed08d34add6945
1 /**
2 * @file sipe-core-private.h
4 * pidgin-sipe
6 * Copyright (C) 2010-11 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct sip_csta;
25 struct sip_service_data;
26 struct sip_transport;
27 struct sipe_calendar;
28 struct sipe_certificate;
29 struct sipe_media_call_private;
30 struct sipe_groupchat;
31 struct sipe_svc;
33 /**
34 * Private part of the Sipe data structure
36 * This part contains the information only needed by the core
38 struct sipe_account_data; /* to be removed... */
39 struct sipe_core_private {
40 /**
41 * The public part is the first item, i.e. a pointer to the
42 * public part can also be used as a pointer to the private part.
44 struct sipe_core_public public;
46 /* sip-transport.c private data */
47 struct sip_transport *transport;
48 const struct sip_service_data *service_data;
49 guint transport_type;
51 /* Account information */
52 gchar *username;
53 gchar *email;
55 /* SIPE protocol information */
56 gchar *contact;
57 gchar *register_callid;
58 gchar *epid;
59 gchar *focus_factory_uri;
60 GSList *sessions;
61 GSList *sessions_to_accept;
63 /* [MS-SIP] deltaNum counters */
64 guint deltanum_contacts;
65 guint deltanum_acl; /* setACE (OCS2005 only) */
67 /* [MS-PRES] */
68 GSList *containers;
70 /* Buddies */
71 GSList *groups;
72 GHashTable *buddies;
74 /* Calendar and related stuff */
75 struct sipe_calendar *calendar;
78 * 2005 Custom XML piece
80 * Possibly set by other point of presence or just other client at
81 * earlier time. It should be preserved/modified, not overwritten.
82 * This implies subscription to self-contact. Information kept:
84 * - User note
85 * - OOF flag
86 * - User status
88 gchar *ocs2005_user_states;
90 /* Scheduling system */
91 GSList *timeouts;
93 /* Active subscriptions */
94 GHashTable *subscriptions;
96 /* Voice call */
97 struct sipe_media_call_private *media_call;
98 /**
99 * Provides the necessary information on where we can obtain
100 * credentials for the A/V Edge server service.
102 gchar *mras_uri;
103 gchar *media_relay_username;
104 gchar *media_relay_password;
105 GSList *media_relays;
107 /* Group chat */
108 struct sipe_groupchat *groupchat;
110 /* @TODO: move to purple backend when menu code moves */
111 GSList *blist_menu_containers;
113 /* For RCC - Remote Call Control */
114 struct sip_csta *csta;
116 struct sipe_dns_query *dns_query;
118 /* TLS-DSK: Certificates & Web services */
119 struct sipe_certificate *certificate;
120 struct sipe_svc *svc;
122 /* the original data structure*/
123 struct sipe_account_data *temporary;
127 * Flags - stored in sipe_core_public.flags but names not exported
129 /* server is OCS2007+ */
130 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
131 /* we are connected from outside the enterprise network boundary
132 * via Edge Server */
133 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
134 /* multiple points of presence detected */
135 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
136 /* if there is support for batched subscription*/
137 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
138 /* if note is out-of-office note */
139 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
140 /* whether we published our initial state or not */
141 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
142 /* whether basic access level is set or not */
143 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
144 /* whether subscribed to buddies presence or not */
145 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
147 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
148 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
149 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
150 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
151 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
152 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
153 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
154 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
155 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
156 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
157 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
158 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
160 /* Convenience macros */
161 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
162 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
164 /* Transition macros */
165 #define SIPE_ACCOUNT_DATA SIPE_CORE_PRIVATE->temporary
166 #define SIPE_ACCOUNT_DATA_PRIVATE sipe_private->temporary
169 * sipe-core internal functions
171 void sipe_core_connection_cleanup(struct sipe_core_private *sipe_private);
174 Local Variables:
175 mode: c
176 c-file-style: "bsd"
177 indent-tabs-mode: t
178 tab-width: 8
179 End: