core cleanup: move out cal field
[siplcs.git] / src / core / sipe-core-private.h
bloba133c18e905217b619058e279025651f889d2b30
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 /* SIPE protocol information */
52 gchar *username;
53 gchar *contact;
54 gchar *epid;
55 gchar *focus_factory_uri;
56 GSList *sessions;
57 GSList *sessions_to_accept;
59 /* [MS-SIP] deltaNum counters */
60 guint deltanum_contacts;
61 guint deltanum_acl; /* setACE (OCS2005 only) */
63 /* Buddies */
64 GSList *groups;
65 GHashTable *buddies;
67 /* Calendar and related stuff */
68 struct sipe_calendar *calendar;
70 /* Scheduling system */
71 GSList *timeouts;
73 /* Active subscriptions */
74 GHashTable *subscriptions;
76 /* Voice call */
77 struct sipe_media_call_private *media_call;
78 /**
79 * Provides the necessary information on where we can obtain
80 * credentials for the A/V Edge server service.
82 gchar *mras_uri;
83 gchar *media_relay_username;
84 gchar *media_relay_password;
85 GSList *media_relays;
87 /* Group chat */
88 struct sipe_groupchat *groupchat;
90 /* @TODO: move to purple backend when menu code moves */
91 GSList *blist_menu_containers;
93 /* For RCC - Remote Call Control */
94 struct sip_csta *csta;
96 struct sipe_dns_query *dns_query;
98 /* TLS-DSK: Certificates & Web services */
99 struct sipe_certificate *certificate;
100 struct sipe_svc *svc;
102 /* the original data structure*/
103 struct sipe_account_data *temporary;
107 * Flags - stored in sipe_core_public.flags but names not exported
109 /* server is OCS2007+ */
110 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
111 /* we are connected from outside the enterprise network boundary
112 * via Edge Server */
113 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
114 /* multiple points of presence detected */
115 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
116 /* if there is support for batched subscription*/
117 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
118 /* if note is out-of-office note */
119 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
120 /* whether we published our initial state or not */
121 #define SIPE_CORE_PRIVATE_FLAG_INITIAL_PUBLISH 0x04000000
122 /* whether basic access level is set or not */
123 #define SIPE_CORE_PRIVATE_FLAG_ACCESS_LEVEL_SET 0x02000000
124 /* whether subscribed to buddies presence or not */
125 #define SIPE_CORE_PRIVATE_FLAG_SUBSCRIBED_BUDDIES 0x01000000
127 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
128 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
129 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
130 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
131 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
132 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
133 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
134 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
135 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
136 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
137 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
138 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
140 /* Convenience macros */
141 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
142 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
144 /* Transition macros */
145 #define SIPE_ACCOUNT_DATA SIPE_CORE_PRIVATE->temporary
146 #define SIPE_ACCOUNT_DATA_PRIVATE sipe_private->temporary
149 * sipe-core internal functions
151 void sipe_core_connection_cleanup(struct sipe_core_private *sipe_private);
154 Local Variables:
155 mode: c
156 c-file-style: "bsd"
157 indent-tabs-mode: t
158 tab-width: 8
159 End: