OBS: updates for Ubuntu 16.04
[siplcs.git] / src / purple / purple-private.h
blobaeaef89ef89772868d7097242c000c29d0e9df45
1 /**
2 * @file purple-private.h
4 * pidgin-sipe
6 * Copyright (C) 2010-2015 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 #include "version.h"
25 #define SIPE_PURPLE_PLUGIN_ID "prpl-sipe"
26 #define SIPE_PURPLE_PLUGIN_NAME "Office Communicator"
28 #define SIPE_PURPLE_PLUGIN_SUMMARY \
29 "Microsoft Office Communicator Protocol Plugin"
31 #define SIPE_PURPLE_PLUGIN_DESCRIPTION \
32 "A plugin for the extended SIP/SIMPLE protocol used by " \
33 "Microsoft Live/Office Communications/Lync Server (LCS2005/OCS2007+)"
35 #define SIPE_PURPLE_PLUGIN_AUTHORS \
36 "Stefan Becker <chemobejk@gmail.com>, " \
37 "Jakub Adam <jakub.adam@ktknet.cz>, " \
38 "Anibal Avelar <avelar@gmail.com> (retired), " \
39 "pier11 <pier11@operamail.com> (retired), " \
40 "Gabriel Burt <gburt@novell.com> (retired)"
42 #define SIPE_PURPLE_PROTOCOL_OPTIONS OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL
44 #if !PURPLE_VERSION_CHECK(3,0,0)
45 #define PurpleIMTypingState PurpleTypingState
46 #define _PurpleProtocolAction _PurplePluginAction
47 #endif
49 /* Forward declarations */
50 struct sipe_chat_session;
51 struct sipe_core_public;
52 struct _PurpleAccount;
53 struct _PurpleBlistNode;
54 struct _PurpleBuddy;
55 struct _PurpleChat;
56 struct _PurpleConnection;
57 struct _PurpleConversation;
58 struct _PurpleGroup;
59 struct _PurpleMessage;
60 struct _PurplePluginAction;
61 struct _PurpleRoomlist;
62 struct _PurpleStatus;
63 struct _PurpleXfer;
65 #ifndef _PurpleMessageFlags
66 #define _PurpleMessageFlags int
67 #endif
69 struct sipe_backend_private {
70 struct sipe_core_public *public;
71 struct _PurpleConnection *gc;
72 struct _PurpleAccount *account;
73 struct _PurpleRoomlist *roomlist;
74 /* see sipe_backend_chat_create() */
75 struct sipe_chat_session *adium_chat_session;
76 GHashTable *roomlist_map; /* name -> uri */
77 GList *rejoin_chats;
78 GSList *transports;
79 GSList *dns_queries;
81 /* work around broken libpurple idle notification */
82 gchar *deferred_status_note;
83 guint deferred_status_activity;
84 guint deferred_status_timeout;
86 /* flags */
87 gboolean status_changed_by_core; /* status changed by core */
88 gboolean user_is_not_idle; /* user came back online */
91 struct sipe_backend_fd {
92 int fd;
95 /* Status attributes */
96 #define SIPE_PURPLE_STATUS_ATTR_ID_MESSAGE "message"
98 const gchar *sipe_purple_activity_to_token(guint type);
99 guint sipe_purple_token_to_activity(const gchar *token);
101 /* DNS queries */
102 void sipe_purple_dns_query_cancel_all(struct sipe_backend_private *purple_private);
105 * Initiates outgoing file transfer, sending @c file to remote peer identified
106 * by @c who.
108 * @param gc a PurpleConnection
109 * @param who string identifying receiver of the file
110 * @param file local file system path of the file to send
112 void sipe_purple_ft_send_file(struct _PurpleConnection *gc,
113 const char *who,
114 const char *file);
116 /* libpurple chat callbacks */
117 #define SIPE_PURPLE_COMPONENT_KEY_CONVERSATION "_conv"
119 struct sipe_chat_session *sipe_purple_chat_get_session(struct _PurpleConversation *conv);
120 void sipe_purple_chat_setup_rejoin(struct sipe_backend_private *purple_private);
121 void sipe_purple_chat_destroy_rejoin(struct sipe_backend_private *purple_private);
122 void sipe_purple_chat_invite(struct _PurpleConnection *gc,
123 int id,
124 const char *message,
125 const char *name);
126 void sipe_purple_chat_leave(struct _PurpleConnection *gc, int id);
127 int sipe_purple_chat_send(struct _PurpleConnection *gc,
128 int id,
129 #if PURPLE_VERSION_CHECK(3,0,0)
130 struct _PurpleMessage *msg);
131 #else
132 const char *what,
133 _PurpleMessageFlags flags);
134 #endif
135 GList *sipe_purple_chat_menu(struct _PurpleChat *chat);
137 /* libpurple chat room callbacks */
138 GList *sipe_purple_chat_info(struct _PurpleConnection *gc);
139 GHashTable *sipe_purple_chat_info_defaults(struct _PurpleConnection *gc,
140 const char *chat_name);
141 void sipe_purple_chat_join(struct _PurpleConnection *gc, GHashTable *data);
142 struct _PurpleRoomlist *sipe_purple_roomlist_get_list(struct _PurpleConnection *gc);
143 void sipe_purple_roomlist_cancel(struct _PurpleRoomlist *list);
145 /* libpurple buddy callbacks */
146 #ifdef PURPLE_VERSION_CHECK
147 void sipe_purple_add_buddy(struct _PurpleConnection *gc,
148 struct _PurpleBuddy *buddy,
149 struct _PurpleGroup *group
150 #if PURPLE_VERSION_CHECK(3,0,0)
151 , const gchar *message
152 #endif
154 #endif
155 void sipe_purple_remove_buddy(struct _PurpleConnection *gc,
156 struct _PurpleBuddy *buddy,
157 struct _PurpleGroup *group);
158 void sipe_purple_group_buddy(struct _PurpleConnection *gc,
159 const char *who,
160 const char *old_group_name,
161 const char *new_group_name);
162 GList *sipe_purple_buddy_menu(struct _PurpleBuddy *buddy);
164 /* libpurple search callbacks */
165 void sipe_purple_show_find_contact(struct _PurpleProtocolAction *action);
167 /* libpurple status callbacks */
168 void sipe_purple_set_status(struct _PurpleAccount *account,
169 struct _PurpleStatus *status);
170 void sipe_purple_set_idle(struct _PurpleConnection *gc,
171 int interval);
173 /* media */
174 void capture_pipeline(const gchar *label);
176 /* transport */
177 void sipe_purple_transport_close_all(struct sipe_backend_private *purple_private);
179 /* Convenience macros */
180 #if PURPLE_VERSION_CHECK(2,6,0) || PURPLE_VERSION_CHECK(3,0,0)
181 #define PURPLE_ACCOUNT_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) purple_connection_get_protocol_data(purple_account_get_connection(account)))
182 #define PURPLE_BUDDY_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) purple_connection_get_protocol_data(purple_account_get_connection(purple_buddy_get_account(buddy))))
183 #define PURPLE_GC_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) purple_connection_get_protocol_data(gc))
184 #else
185 #define PURPLE_ACCOUNT_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) purple_account_get_connection(account)->proto_data)
186 #define PURPLE_BUDDY_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) purple_account_get_connection(purple_buddy_get_account(buddy))->proto_data)
187 #define PURPLE_GC_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) gc->proto_data)
188 #endif
190 /* Protocol common functions */
192 gboolean sipe_purple_plugin_load(PurplePlugin *plugin);
193 gboolean sipe_purple_plugin_unload(PurplePlugin *plugin);
195 gpointer sipe_purple_user_split(void);
196 GList *sipe_purple_account_options(void);
198 GList *sipe_purple_actions(void);
199 gchar *sipe_purple_status_text(struct _PurpleBuddy *buddy);
200 void sipe_purple_tooltip_text(struct _PurpleBuddy *buddy,
201 struct _PurpleNotifyUserInfo *user_info,
202 gboolean full);
203 GList *sipe_purple_blist_node_menu(struct _PurpleBlistNode *node);
204 void sipe_purple_convo_closed(struct _PurpleConnection *gc, const char *who);
205 GHashTable *sipe_purple_get_account_text_table(struct _PurpleAccount *account);
207 void sipe_purple_login(struct _PurpleAccount *account);
208 void sipe_purple_close(struct _PurpleConnection *gc);
209 GList *sipe_purple_status_types(struct _PurpleAccount *account);
210 const char *sipe_purple_list_icon(struct _PurpleAccount *account,
211 struct _PurpleBuddy *buddy);
213 void sipe_purple_get_info(struct _PurpleConnection *gc, const char *who);
214 void sipe_purple_alias_buddy(struct _PurpleConnection *gc, const char *name,
215 const char *alias);
216 void sipe_purple_group_rename(struct _PurpleConnection *gc, const char *old_name,
217 struct _PurpleGroup *group, GList *moved_buddies);
218 void sipe_purple_group_remove(struct _PurpleConnection *gc,
219 struct _PurpleGroup *group);
221 unsigned int sipe_purple_send_typing(struct _PurpleConnection *gc,
222 const char *who, PurpleIMTypingState state);
224 void sipe_purple_add_permit(struct _PurpleConnection *gc, const char *name);
225 void sipe_purple_add_deny(struct _PurpleConnection *gc, const char *name);
227 #if PURPLE_VERSION_CHECK(2,6,0) || PURPLE_VERSION_CHECK(3,0,0)
228 gboolean sipe_purple_initiate_media(struct _PurpleAccount *account,
229 const char *who,
230 PurpleMediaSessionType type);
231 PurpleMediaCaps sipe_purple_get_media_caps(struct _PurpleAccount *account,
232 const char *who);
233 #endif
236 Local Variables:
237 mode: c
238 c-file-style: "bsd"
239 indent-tabs-mode: t
240 tab-width: 8
241 End: