core cleanup: move out is_oof_note flag
[siplcs.git] / src / core / sipe-core-private.h
blob413664b3b34349c2af312a6a006b6364a84397fe
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_service_data;
25 struct sip_transport;
26 struct sipe_certificate;
27 struct sipe_media_call_private;
28 struct sipe_groupchat;
29 struct sipe_svc;
31 /**
32 * Private part of the Sipe data structure
34 * This part contains the information only needed by the core
36 struct sipe_account_data; /* to be removed... */
37 struct sipe_core_private {
38 /**
39 * The public part is the first item, i.e. a pointer to the
40 * public part can also be used as a pointer to the private part.
42 struct sipe_core_public public;
44 /* sip-transport.c private data */
45 struct sip_transport *transport;
46 const struct sip_service_data *service_data;
47 guint transport_type;
49 /* SIPE protocol information */
50 gchar *username;
51 gchar *contact;
52 gchar *epid;
53 gchar *focus_factory_uri;
54 GSList *sessions;
55 GSList *sessions_to_accept;
57 /* [MS-SIP] deltaNum counters */
58 guint deltanum_contacts;
59 guint deltanum_acl; /* setACE (OCS2005 only) */
61 /* Buddies */
62 GSList *groups;
63 GHashTable *buddies;
65 /* Scheduling system */
66 GSList *timeouts;
68 /* Active subscriptions */
69 GHashTable *subscriptions;
71 /* Voice call */
72 struct sipe_media_call_private *media_call;
73 /**
74 * Provides the necessary information on where we can obtain
75 * credentials for the A/V Edge server service.
77 gchar *mras_uri;
78 gchar *media_relay_username;
79 gchar *media_relay_password;
80 GSList *media_relays;
82 /* Group chat */
83 struct sipe_groupchat *groupchat;
85 /* @TODO: move to purple backend when menu code moves */
86 GSList *blist_menu_containers;
88 struct sipe_dns_query *dns_query;
90 /* TLS-DSK: Certificates & Web services */
91 struct sipe_certificate *certificate;
92 struct sipe_svc *svc;
94 /* the original data structure*/
95 struct sipe_account_data *temporary;
98 /**
99 * Flags - stored in sipe_core_public.flags but names not exported
101 /* server is OCS2007+ */
102 #define SIPE_CORE_PRIVATE_FLAG_OCS2007 0x80000000
103 /* we are connected from outside the enterprise network boundary
104 * via Edge Server */
105 #define SIPE_CORE_PRIVATE_FLAG_REMOTE_USER 0x40000000
106 /* multiple points of presence detected */
107 #define SIPE_CORE_PRIVATE_FLAG_MPOP 0x20000000
108 /* if there is support for batched subscription*/
109 #define SIPE_CORE_PRIVATE_FLAG_BATCHED_SUPPORT 0x10000000
110 /* if note is out-of-office note */
111 #define SIPE_CORE_PRIVATE_FLAG_OOF_NOTE 0x08000000
113 #define SIPE_CORE_PUBLIC_FLAG_IS(flag) \
114 ((sipe_private->public.flags & SIPE_CORE_FLAG_ ## flag) == SIPE_CORE_FLAG_ ## flag)
115 #define SIPE_CORE_PUBLIC_FLAG_SET(flag) \
116 (sipe_private->public.flags |= SIPE_CORE_FLAG_ ## flag)
117 #define SIPE_CORE_PUBLIC_FLAG_UNSET(flag) \
118 (sipe_private->public.flags &= ~SIPE_CORE_FLAG_ ## flag)
119 #define SIPE_CORE_PRIVATE_FLAG_IS(flag) \
120 ((sipe_private->public.flags & SIPE_CORE_PRIVATE_FLAG_ ## flag) == SIPE_CORE_PRIVATE_FLAG_ ## flag)
121 #define SIPE_CORE_PRIVATE_FLAG_SET(flag) \
122 (sipe_private->public.flags |= SIPE_CORE_PRIVATE_FLAG_ ## flag)
123 #define SIPE_CORE_PRIVATE_FLAG_UNSET(flag) \
124 (sipe_private->public.flags &= ~SIPE_CORE_PRIVATE_FLAG_ ## flag)
126 /* Convenience macros */
127 #define SIPE_CORE_PRIVATE ((struct sipe_core_private *)sipe_public)
128 #define SIPE_CORE_PUBLIC ((struct sipe_core_public *)sipe_private)
130 /* Transition macros */
131 #define SIPE_ACCOUNT_DATA SIPE_CORE_PRIVATE->temporary
132 #define SIPE_ACCOUNT_DATA_PRIVATE sipe_private->temporary
135 * sipe-core internal functions
137 void sipe_core_connection_cleanup(struct sipe_core_private *sipe_private);
140 Local Variables:
141 mode: c
142 c-file-style: "bsd"
143 indent-tabs-mode: t
144 tab-width: 8
145 End: