core cleanup: separate code for sipe_backend_account_status_and_note()
[siplcs.git] / src / purple / purple-private.h
blob77feacf64f32fd635e2891ff1d38e177746854f1
1 /**
2 * @file purple-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 sipe_core_public;
25 struct _PurpleAccount;
26 struct _PurpleBuddy;
27 struct _PurpleChat;
28 struct _PurpleConnection;
29 struct _PurpleGroup;
30 struct _PurpleRoomlist;
31 struct _PurpleXfer;
33 #ifndef _PurpleMessageFlags
34 #define _PurpleMessageFlags int
35 #endif
37 struct sipe_backend_private {
38 struct sipe_core_public *public;
39 struct _PurpleConnection *gc;
40 struct _PurpleAccount *account;
41 struct _PurpleRoomlist *roomlist;
42 GHashTable *roomlist_map; /* name -> uri */
43 GList *rejoin_chats;
44 time_t last_keepalive;
47 struct sipe_backend_fd {
48 int fd;
51 /**
52 * Initiates outgoing file transfer, sending @c file to remote peer identified
53 * by @c who.
55 * @param gc a PurpleConnection
56 * @param who string identifying receiver of the file
57 * @param file local file system path of the file to send
59 void sipe_purple_ft_send_file(struct _PurpleConnection *gc,
60 const char *who,
61 const char *file);
63 /**
64 * Creates new PurpleXfer structure representing a file transfer.
66 * @param gc a PurpleConnection
67 * @param who remote participant in the file transfer session
69 struct _PurpleXfer *sipe_purple_ft_new_xfer(struct _PurpleConnection *gc,
70 const char *who);
72 /* libpurple chat callbacks */
73 #define SIPE_PURPLE_COMPONENT_KEY_CONVERSATION "_conv"
75 void sipe_purple_chat_setup_rejoin(struct sipe_backend_private *purple_private);
76 void sipe_purple_chat_destroy_rejoin(struct sipe_backend_private *purple_private);
77 void sipe_purple_chat_invite(struct _PurpleConnection *gc,
78 int id,
79 const char *message,
80 const char *name);
81 void sipe_purple_chat_leave(struct _PurpleConnection *gc, int id);
82 int sipe_purple_chat_send(struct _PurpleConnection *gc,
83 int id,
84 const char *what,
85 _PurpleMessageFlags flags);
86 GList *sipe_purple_chat_menu(struct _PurpleChat *chat);
88 /* libpurple chat room callbacks */
89 GList *sipe_purple_chat_info(struct _PurpleConnection *gc);
90 GHashTable *sipe_purple_chat_info_defaults(struct _PurpleConnection *gc,
91 const char *chat_name);
92 void sipe_purple_chat_join(struct _PurpleConnection *gc, GHashTable *data);
93 struct _PurpleRoomlist *sipe_purple_roomlist_get_list(struct _PurpleConnection *gc);
94 void sipe_purple_roomlist_cancel(struct _PurpleRoomlist *list);
96 /* libpurple buddy callbacks */
97 void sipe_purple_add_buddy(struct _PurpleConnection *gc,
98 struct _PurpleBuddy *buddy,
99 struct _PurpleGroup *group);
100 void sipe_purple_remove_buddy(struct _PurpleConnection *gc,
101 struct _PurpleBuddy *buddy,
102 struct _PurpleGroup *group);
103 void sipe_purple_group_buddy(struct _PurpleConnection *gc,
104 const char *who,
105 const char *old_group_name,
106 const char *new_group_name);
108 /* Convenience macros */
109 #define PURPLE_ACCOUNT_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) account->gc->proto_data)
110 #define PURPLE_GC_TO_SIPE_CORE_PUBLIC ((struct sipe_core_public *) gc->proto_data)
113 Local Variables:
114 mode: c
115 c-file-style: "bsd"
116 indent-tabs-mode: t
117 tab-width: 8
118 End: