| |
1 /** |
| |
2 * @file group.h Group functions |
| |
3 * |
| |
4 * gaim |
| |
5 * |
| |
6 * Gaim is the legal property of its developers, whose names are too numerous |
| |
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
| |
8 * source distribution. |
| |
9 * |
| |
10 * This program is free software; you can redistribute it and/or modify |
| |
11 * it under the terms of the GNU General Public License as published by |
| |
12 * the Free Software Foundation; either version 2 of the License, or |
| |
13 * (at your option) any later version. |
| |
14 * |
| |
15 * This program is distributed in the hope that it will be useful, |
| |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
18 * GNU General Public License for more details. |
| |
19 * |
| |
20 * You should have received a copy of the GNU General Public License |
| |
21 * along with this program; if not, write to the Free Software |
| |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| |
23 */ |
| |
24 #ifndef _MSN_GROUP_H_ |
| |
25 #define _MSN_GROUP_H_ |
| |
26 |
| |
27 typedef struct _MsnGroup MsnGroup; |
| |
28 |
| |
29 #include <stdio.h> |
| |
30 |
| |
31 #include "session.h" |
| |
32 #include "user.h" |
| |
33 #include "soap.h" |
| |
34 #include "userlist.h" |
| |
35 |
| |
36 #define MSN_ADD_GROUPS "<GroupInfo><name>test111</name><groupType>C8529CE2-6EAD-434d-881F-341E17DB3FF8</groupType><fMessenger>false</fMessenger><annotations><Annotation><Name>MSN.IM.Display</Name><Value>1</Value></Annotation></annotations></GroupInfo>" |
| |
37 |
| |
38 #define MSN_ADD_GROUP_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>GroupSave</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupAdd xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupAddOptions><fRenameOnMsgrConflict>false</fRenameOnMsgrConflict></groupAddOptions><groupInfo>%s</groupInfo></ABGroupAdd></soap:Body></soap:Envelope>" |
| |
39 |
| |
40 #define MSN_GROUP_IDS "<guid>9e57e654-59f0-44d1-aedc-0a7500b7e51f</guid>" |
| |
41 #define MSN_DELETE_GROUP_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>Timer</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupDelete xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupFilter><groupIds>%s</groupIds></groupFilter></ABGroupDelete></soap:Body></soap:Envelope>" |
| |
42 |
| |
43 #define MSN_INDIVIDUALS_GROUP_ID "1983" |
| |
44 #define MSN_INDIVIDUALS_GROUP_NAME "Other Contacts" |
| |
45 |
| |
46 #define MSN_NON_IM_GROUP_ID "email" |
| |
47 #define MSN_NON_IM_GROUP_NAME "Non-IM Contacts" |
| |
48 |
| |
49 /** |
| |
50 * A group. |
| |
51 */ |
| |
52 struct _MsnGroup |
| |
53 { |
| |
54 MsnSession *session; /**< The MSN session. */ |
| |
55 MsnSoapConn *soapconn; |
| |
56 |
| |
57 char *id; /**< The group ID. */ |
| |
58 char *name; /**< The name of the group. */ |
| |
59 }; |
| |
60 |
| |
61 /**************************************************************************/ |
| |
62 /** @name Group API */ |
| |
63 /**************************************************************************/ |
| |
64 /*@{*/ |
| |
65 |
| |
66 /** |
| |
67 * Creates a new group structure. |
| |
68 * |
| |
69 * @param session The MSN session. |
| |
70 * @param id The group ID. |
| |
71 * @param name The name of the group. |
| |
72 * |
| |
73 * @return A new group structure. |
| |
74 */ |
| |
75 MsnGroup *msn_group_new(MsnUserList *userlist, const char *id, const char *name); |
| |
76 |
| |
77 /** |
| |
78 * Destroys a group structure. |
| |
79 * |
| |
80 * @param group The group to destroy. |
| |
81 */ |
| |
82 void msn_group_destroy(MsnGroup *group); |
| |
83 |
| |
84 /** |
| |
85 * Sets the ID for a group. |
| |
86 * |
| |
87 * @param group The group. |
| |
88 * @param id The ID. |
| |
89 */ |
| |
90 void msn_group_set_id(MsnGroup *group, const char *id); |
| |
91 |
| |
92 /** |
| |
93 * Sets the name for a group. |
| |
94 * |
| |
95 * @param group The group. |
| |
96 * @param name The name. |
| |
97 */ |
| |
98 void msn_group_set_name(MsnGroup *group, const char *name); |
| |
99 |
| |
100 /** |
| |
101 * Returns the ID for a group. |
| |
102 * |
| |
103 * @param group The group. |
| |
104 * |
| |
105 * @return The ID. |
| |
106 */ |
| |
107 char* msn_group_get_id(const MsnGroup *group); |
| |
108 |
| |
109 /** |
| |
110 * Returns the name for a group. |
| |
111 * |
| |
112 * @param group The group. |
| |
113 * |
| |
114 * @return The name. |
| |
115 */ |
| |
116 const char *msn_group_get_name(const MsnGroup *group); |
| |
117 #endif /* _MSN_GROUP_H_ */ |