comparison src/protocols/novell/nmevent.h @ 8675:9ee2542d1104

[gaim-migrate @ 9428] A GroupWise plugin from Novell. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 17 Apr 2004 13:55:28 +0000
parents
children 046dd8ef2920
comparison
equal deleted inserted replaced
8674:8c7da2e36136 8675:9ee2542d1104
1 /*
2 * nmevent.h
3 *
4 * Copyright © 2004 Unpublished Work of Novell, Inc. All Rights Reserved.
5 *
6 * THIS WORK IS AN UNPUBLISHED WORK OF NOVELL, INC. NO PART OF THIS WORK MAY BE
7 * USED, PRACTICED, PERFORMED, COPIED, DISTRIBUTED, REVISED, MODIFIED,
8 * TRANSLATED, ABRIDGED, CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED,
9 * RECAST, TRANSFORMED OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL,
10 * INC. ANY USE OR EXPLOITATION OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT
11 * THE PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.
12 *
13 * AS BETWEEN [GAIM] AND NOVELL, NOVELL GRANTS [GAIM] THE RIGHT TO REPUBLISH
14 * THIS WORK UNDER THE GPL (GNU GENERAL PUBLIC LICENSE) WITH ALL RIGHTS AND
15 * LICENSES THEREUNDER. IF YOU HAVE RECEIVED THIS WORK DIRECTLY OR INDIRECTLY
16 * FROM [GAIM] AS PART OF SUCH A REPUBLICATION, YOU HAVE ALL RIGHTS AND LICENSES
17 * GRANTED BY [GAIM] UNDER THE GPL. IN CONNECTION WITH SUCH A REPUBLICATION, IF
18 * ANYTHING IN THIS NOTICE CONFLICTS WITH THE TERMS OF THE GPL, SUCH TERMS
19 * PREVAIL.
20 *
21 */
22
23 #ifndef __NM_EVENT_H__
24 #define __NM_EVENT_H__
25
26 typedef struct _NMEvent NMEvent;
27
28 #include "nmuser.h"
29
30 /**
31 * Defines for the event types
32 */
33 #define NMEVT_INVALID_RECIPIENT 101
34 #define NMEVT_UNDELIVERABLE_STATUS 102
35 #define NMEVT_STATUS_CHANGE 103
36 #define NMEVT_CONTACT_ADD 104
37 #define NMEVT_CONFERENCE_CLOSED 105
38 #define NMEVT_CONFERENCE_JOINED 106
39 #define NMEVT_CONFERENCE_LEFT 107
40 #define NMEVT_RECEIVE_MESSAGE 108
41 #define NMEVT_RECEIVE_FILE 109
42 #define NMEVT_USER_TYPING 112
43 #define NMEVT_USER_NOT_TYPING 113
44 #define NMEVT_USER_DISCONNECT 114
45 #define NMEVT_SERVER_DISCONNECT 115
46 #define NMEVT_CONFERENCE_RENAME 116
47 #define NMEVT_CONFERENCE_INVITE 117
48 #define NMEVT_CONFERENCE_INVITE_NOTIFY 118
49 #define NMEVT_CONFERENCE_REJECT 119
50 #define NMEVT_RECEIVE_AUTOREPLY 121
51 #define NMEVT_START NMEVT_INVALID_RECIPIENT
52 #define NMEVT_STOP NMEVT_RECEIVE_AUTOREPLY
53
54 /**
55 * Process the event. The event will be read, an NMEvent will
56 * be created, and the event callback will be called.
57 *
58 * @param user The main user structure.
59 * @param type The type of the event to read.
60 *
61 * @return NM_OK on success
62 */
63 NMERR_T nm_process_event(NMUser * user, int type);
64
65 /**
66 * Creates an NMEvent
67 *
68 * The NMEvent should be released by calling
69 * nm_release_event.
70 *
71 * @param type The event type, see defines above.
72 * @param source The DN of the event source.
73 * @param gmt The time that the event occurred.
74 *
75 * @return The new NMEvent
76 */
77 NMEvent *nm_create_event(int type, const char *source, guint32 gmt);
78
79 /**
80 * Releases an NMEvent
81 *
82 * @param event The event to release
83 *
84 */
85 void nm_release_event(NMEvent * event);
86
87 /**
88 * Sets the conference object for the given event.
89 *
90 * @param event The event.
91 * @param conference The conference to associate with the event.
92 *
93 */
94 void nm_event_set_conference(NMEvent * event, NMConference * conference);
95
96 /**
97 * Returns the conference object associated with the given event. This should not
98 * be released. If it needs to be kept around call nm_conference_addref().
99 *
100 * @param event The event.
101 *
102 * @return The conference associated with the event, or NULL
103 * if no conference has been set for the event.
104 */
105 NMConference *nm_event_get_conference(NMEvent * event);
106
107 /**
108 * Sets the NMUserRecord object for the given event.
109 * The user record represents the event source.
110 *
111 * @param event The event.
112 * @param user_record The user record to associate with the event.
113 *
114 */
115 void nm_event_set_user_record(NMEvent * event, NMUserRecord * user_record);
116
117 /**
118 * Returns the NMUserRecord object associated with the given event.
119 * The user record represents the event source. This should not
120 * be released. If it needs to be kept around call
121 * nm_user_record_add_ref().
122 *
123 * @param event The event.
124 *
125 * @return The user record associated with the event, or NULL
126 * if no user record has been set for the event.
127 */
128 NMUserRecord *nm_event_get_user_record(NMEvent * event);
129
130 /**
131 * Sets the text to associate with the given event.
132 *
133 * @param event The event.
134 * @param text The text to associate with the event.
135 *
136 */
137 void nm_event_set_text(NMEvent * event, const char *text);
138
139 /**
140 * Returns the text associated with the given event.
141 *
142 * @param event The event.
143 *
144 * @return The text associated with the event, or NULL
145 * if no text has been set for the event.
146 */
147 const char *nm_event_get_text(NMEvent * event);
148
149 /**
150 * Returns the source of the event (this will be the full DN of the
151 * event source).
152 *
153 * @param event The event.
154 *
155 * @return The full DN of the event's source.
156 */
157 const char *nm_event_get_source(NMEvent * event);
158
159 /**
160 * Returns the type of the event. See the defines above for
161 * a list of possible event types.
162 *
163 * @param event The event.
164 *
165 * @return The type of the event.
166 *
167 */
168 int nm_event_get_type(NMEvent * event);
169
170 /**
171 * Returns the time that the event took place.
172 *
173 * @param event The event.
174 *
175 * @return The timestamp for the event. This is the number of
176 * seconds since 1/1/1970 (as returned by the time()
177 * system call).
178 */
179 guint32 nm_event_get_gmt(NMEvent * event);
180
181 #endif