1 /* 2 * sess.h: session management 3 * Copyright (C) 2002-2003 Saulius Menkevicius 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * 19 * $Id: sess.h,v 1.9 2004/12/24 02:56:16 bobas Exp $ 20 */ 21 22 #ifndef SESS_H__ 23 #define SESS_H__ 24 25 /* preferences registered in the `sess' module */ 26 #define PREFS_SESS_STAMP_CHANNEL "sess/stamp_channel" 27 #define PREFS_SESS_STAMP_PRIVATE "sess/stamp_private" 28 #define PREFS_SESS_STAMP_STATUS "sess/stamp_status" 29 #define PREFS_SESS_IMPORTANT_CHANNELS "sess/important_channels" 30 #define PREFS_SESS_SUPPRESS_RENAME_TEXT "sess/suppress_rename_text" 31 #define PREFS_SESS_SUPPRESS_MODE_TEXT "sess/suppress_mode_text" 32 #define PREFS_SESS_SUPPRESS_JOIN_LEAVE_TEXT "sess/suppress_join_leave_text" 33 34 enum session_text_type { 35 SESSTEXT_NORMAL, 36 SESSTEXT_NOTIFY, 37 SESSTEXT_ERROR, 38 SESSTEXT_JOIN, 39 SESSTEXT_LEAVE, 40 SESSTEXT_MY_TEXT, 41 SESSTEXT_MY_ME, 42 SESSTEXT_THEIR_TEXT, 43 SESSTEXT_THEIR_ME, 44 SESSTEXT_TOPIC 45 }; 46 47 enum session_type { 48 SESSTYPE_STATUS, 49 SESSTYPE_CHANNEL, 50 SESSTYPE_PRIVATE 51 }; 52 53 void sess_register(); 54 55 typedef gpointer sess_id; 56 typedef void (*sess_enum_cb)(gpointer, enum session_type, const gchar *, gpointer, gpointer); 57 58 gpointer sess_new( 59 enum session_type type, const gchar * name, 60 gboolean closeable, gpointer user_id); 61 62 void sess_delete(gpointer); 63 gpointer sess_find(enum session_type type, const gchar * name); 64 void sess_write(gpointer, enum session_text_type, const gchar * fmt, ...); 65 gpointer sess_current(); 66 enum session_type sess_type(gpointer); 67 const gchar * sess_name(gpointer); 68 const gchar * sess_topic(gpointer); 69 gboolean sess_is_closeable(gpointer); 70 gboolean sess_topic_readonly(gpointer); 71 void sess_switch_to(gpointer); 72 void sess_enumerate(sess_enum_cb, gpointer); 73 gchar * sess_make_channel_list(); 74 75 #endif /* #ifndef SESS_H__ */ 76 77