Sat, 04 Feb 2006 20:55:52 +0000
[gaim-migrate @ 15481]
This adds support for displaying log timestamps in their original timezone. If your OS's definition of struct tm sucks, then the log timestamps will show up in your local timezone, but converted, so the time is accurate. Yay! Anyway, this all works, as I've renamed lots of my log files locally, but currently, there's no code to save new logs in this name format. That's held up on a portability issue and backwards compatibility issue.
| 8675 | 1 | /* |
| 2 | * nmevent.h | |
| 3 | * | |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
4 | * Copyright (c) 2004 Novell, Inc. All Rights Reserved. |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
5 | * |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
6 | * This program is free software; you can redistribute it and/or modify |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
7 | * it under the terms of the GNU General Public License as published by |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
8 | * the Free Software Foundation; version 2 of the License. |
| 8675 | 9 | * |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
13 | * GNU General Public License for more details. |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
14 | * |
|
8933
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
16 | * along with this program; if not, write to the Free Software |
|
0f1e8160581d
[gaim-migrate @ 9703]
Mike Stoddard <mistoddard@novell.com>
parents:
8684
diff
changeset
|
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 8675 | 18 | * |
| 19 | */ | |
| 20 | ||
| 21 | #ifndef __NM_EVENT_H__ | |
| 22 | #define __NM_EVENT_H__ | |
| 23 | ||
| 24 | typedef struct _NMEvent NMEvent; | |
| 25 | ||
| 26 | #include "nmuser.h" | |
| 27 | ||
| 28 | /** | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
29 | * Defines for the event types |
| 8675 | 30 | */ |
| 31 | #define NMEVT_INVALID_RECIPIENT 101 | |
| 32 | #define NMEVT_UNDELIVERABLE_STATUS 102 | |
| 33 | #define NMEVT_STATUS_CHANGE 103 | |
| 34 | #define NMEVT_CONTACT_ADD 104 | |
| 35 | #define NMEVT_CONFERENCE_CLOSED 105 | |
| 36 | #define NMEVT_CONFERENCE_JOINED 106 | |
| 37 | #define NMEVT_CONFERENCE_LEFT 107 | |
| 38 | #define NMEVT_RECEIVE_MESSAGE 108 | |
| 39 | #define NMEVT_RECEIVE_FILE 109 | |
| 40 | #define NMEVT_USER_TYPING 112 | |
| 41 | #define NMEVT_USER_NOT_TYPING 113 | |
| 42 | #define NMEVT_USER_DISCONNECT 114 | |
| 43 | #define NMEVT_SERVER_DISCONNECT 115 | |
| 44 | #define NMEVT_CONFERENCE_RENAME 116 | |
| 45 | #define NMEVT_CONFERENCE_INVITE 117 | |
| 46 | #define NMEVT_CONFERENCE_INVITE_NOTIFY 118 | |
| 47 | #define NMEVT_CONFERENCE_REJECT 119 | |
| 48 | #define NMEVT_RECEIVE_AUTOREPLY 121 | |
| 49 | #define NMEVT_START NMEVT_INVALID_RECIPIENT | |
| 50 | #define NMEVT_STOP NMEVT_RECEIVE_AUTOREPLY | |
| 51 | ||
| 52 | /** | |
| 53 | * Process the event. The event will be read, an NMEvent will | |
| 54 | * be created, and the event callback will be called. | |
| 55 | * | |
| 56 | * @param user The main user structure. | |
| 57 | * @param type The type of the event to read. | |
| 58 | * | |
| 59 | * @return NM_OK on success | |
| 60 | */ | |
| 61 | NMERR_T nm_process_event(NMUser * user, int type); | |
| 62 | ||
| 63 | /** | |
| 64 | * Creates an NMEvent | |
| 65 | * | |
| 66 | * The NMEvent should be released by calling | |
| 67 | * nm_release_event. | |
| 68 | * | |
| 69 | * @param type The event type, see defines above. | |
| 70 | * @param source The DN of the event source. | |
| 71 | * @param gmt The time that the event occurred. | |
| 72 | * | |
| 73 | * @return The new NMEvent | |
| 74 | */ | |
| 75 | NMEvent *nm_create_event(int type, const char *source, guint32 gmt); | |
| 76 | ||
| 77 | /** | |
| 78 | * Releases an NMEvent | |
| 79 | * | |
| 80 | * @param event The event to release | |
| 81 | * | |
| 82 | */ | |
| 83 | void nm_release_event(NMEvent * event); | |
| 84 | ||
| 85 | /** | |
| 86 | * Sets the conference object for the given event. | |
| 87 | * | |
| 88 | * @param event The event. | |
| 89 | * @param conference The conference to associate with the event. | |
| 90 | * | |
| 91 | */ | |
| 92 | void nm_event_set_conference(NMEvent * event, NMConference * conference); | |
| 93 | ||
| 94 | /** | |
| 95 | * Returns the conference object associated with the given event. This should not | |
| 96 | * be released. If it needs to be kept around call nm_conference_addref(). | |
| 97 | * | |
| 98 | * @param event The event. | |
| 99 | * | |
| 100 | * @return The conference associated with the event, or NULL | |
| 101 | * if no conference has been set for the event. | |
| 102 | */ | |
| 103 | NMConference *nm_event_get_conference(NMEvent * event); | |
| 104 | ||
| 105 | /** | |
| 106 | * Sets the NMUserRecord object for the given event. | |
| 107 | * The user record represents the event source. | |
| 108 | * | |
| 109 | * @param event The event. | |
| 110 | * @param user_record The user record to associate with the event. | |
| 111 | * | |
| 112 | */ | |
| 113 | void nm_event_set_user_record(NMEvent * event, NMUserRecord * user_record); | |
| 114 | ||
| 115 | /** | |
|
8684
7ec649752daa
[gaim-migrate @ 9437]
Christian Hammond <chipx86@chipx86.com>
parents:
8675
diff
changeset
|
116 | * Returns the NMUserRecord object associated with the given event. |
| 8675 | 117 | * The user record represents the event source. This should not |
| 118 | * be released. If it needs to be kept around call | |
| 119 | * nm_user_record_add_ref(). | |
| 120 | * | |
| 121 | * @param event The event. | |
| 122 | * | |
| 123 | * @return The user record associated with the event, or NULL | |
| 124 | * if no user record has been set for the event. | |
| 125 | */ | |
| 126 | NMUserRecord *nm_event_get_user_record(NMEvent * event); | |
| 127 | ||
| 128 | /** | |
| 129 | * Sets the text to associate with the given event. | |
| 130 | * | |
| 131 | * @param event The event. | |
| 132 | * @param text The text to associate with the event. | |
| 133 | * | |
| 134 | */ | |
| 135 | void nm_event_set_text(NMEvent * event, const char *text); | |
| 136 | ||
| 137 | /** | |
| 138 | * Returns the text associated with the given event. | |
| 139 | * | |
| 140 | * @param event The event. | |
| 141 | * | |
| 142 | * @return The text associated with the event, or NULL | |
| 143 | * if no text has been set for the event. | |
| 144 | */ | |
| 145 | const char *nm_event_get_text(NMEvent * event); | |
| 146 | ||
| 147 | /** | |
| 148 | * Returns the source of the event (this will be the full DN of the | |
| 149 | * event source). | |
| 150 | * | |
| 151 | * @param event The event. | |
| 152 | * | |
| 153 | * @return The full DN of the event's source. | |
| 154 | */ | |
| 155 | const char *nm_event_get_source(NMEvent * event); | |
| 156 | ||
| 157 | /** | |
| 158 | * Returns the type of the event. See the defines above for | |
| 159 | * a list of possible event types. | |
| 160 | * | |
| 161 | * @param event The event. | |
| 162 | * | |
| 163 | * @return The type of the event. | |
| 164 | * | |
| 165 | */ | |
| 166 | int nm_event_get_type(NMEvent * event); | |
| 167 | ||
| 168 | /** | |
| 169 | * Returns the time that the event took place. | |
| 170 | * | |
| 171 | * @param event The event. | |
| 172 | * | |
| 13120 | 173 | * @return The timestamp for the event. |
| 8675 | 174 | */ |
| 13120 | 175 | time_t nm_event_get_gmt(NMEvent * event); |
| 8675 | 176 | |
| 177 | #endif |