]> icculus.org git repositories - taylor/freespace2.git/blob - include/chatbox.h
Initial revision
[taylor/freespace2.git] / include / chatbox.h
1 /*
2  * $Logfile: /Freespace2/code/MissionUI/Chatbox.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Header file for chat box code
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 3     5/22/99 5:35p Dave
15  * Debrief and chatbox screens. Fixed small hi-res HUD bug.
16  * 
17  * 2     10/07/98 10:53a Dave
18  * Initial checkin.
19  * 
20  * 1     10/07/98 10:49a Dave
21  * 
22  * 14    9/11/98 5:08p Dave
23  * More tweaks to kick notification system.
24  * 
25  * 13    9/11/98 4:14p Dave
26  * Fixed file checksumming of < file_size. Put in more verbose kicking and
27  * PXO stats store reporting.
28  * 
29  * 12    5/15/98 5:15p Dave
30  * Fix a standalone resetting bug.Tweaked PXO interface. Display captaincy
31  * status for team vs. team. Put in asserts to check for invalid team vs.
32  * team situations.
33  * 
34  * 11    4/14/98 5:06p Dave
35  * Don't load or send invalid pilot pics. Fixed chatbox graphic errors.
36  * Made chatbox display team icons in a team vs. team game. Fixed up pause
37  * and endgame sequencing issues.
38  * 
39  * 10    4/12/98 2:09p Dave
40  * Make main hall door text less stupid. Make sure inputbox focus in the
41  * multi host options screen is managed more intelligently.
42  * 
43  * 9     4/01/98 11:19p Dave
44  * Put in auto-loading of xferred pilot pic files. Grey out background
45  * behind pinfo popup. Put a chatbox message in when players are kicked.
46  * Moved mission title down in briefing. Other ui fixes.
47  * 
48  * 8     3/29/98 1:24p Dave
49  * Make chatbox not clear between multiplayer screens. Select player ship
50  * as default in mp team select and weapons select screens. Made create
51  * game mission list use 2 fixed size columns.
52  * 
53  * 7     2/13/98 3:46p Dave
54  * Put in dynamic chatbox sizing. Made multiplayer file lookups use cfile
55  * functions.
56  * 
57  * 6     1/16/98 2:34p Dave
58  * Made pause screen work properly (multiplayer). Changed how chat packets
59  * work.
60  * 
61  * 5     1/07/98 5:20p Dave
62  * Put in support for multiplayer campaigns with the new interface
63  * screens.
64  * 
65  * 4     12/18/97 8:59p Dave
66  * Finished putting in basic support for weapon select and ship select in
67  * multiplayer.
68  * 
69  * 3     10/01/97 4:47p Lawrance
70  * move some #defines out of header file into .cpp file
71  * 
72  * 2     10/01/97 4:39p Lawrance
73  * move chat code into Chatbox.cpp, simplify interface
74  * 
75  * 1     10/01/97 10:54a Lawrance
76  *
77  * $NoKeywords: $
78  */
79
80 #ifndef __FREESPACE_CHATBOX_H__
81 #define __FREESPACE_CHATBOX_H__
82
83 // prototype
84 struct net_player;
85
86 #define CHATBOX_MAX_LEN                                         125                     // max length of the actual text string
87
88 // chatbox flags for creation/switching between modes
89 #define CHATBOX_FLAG_SMALL                                       (1<<0)         // small chatbox
90 #define CHATBOX_FLAG_BIG                                         (1<<1)         // big chatbox
91 #define CHATBOX_FLAG_MULTI_PAUSED                (1<<2)         // chatbox in the multiplayer paused screen
92 #define CHATBOX_FLAG_DRAW_BOX                            (1<<3)         // should be drawn by the chatbox code
93 #define CHATBOX_FLAG_BUTTONS                             (1<<4)         // the chatbox should be drawing/checking its own buttons
94 // NOTE : CHATBOX_FLAG_BUTTONS requires that CHATBOX_FLAG_DRAW_BOX is also set!
95
96 // initialize all chatbox details with the given mode flags
97 int chatbox_create(int mode_flags = (CHATBOX_FLAG_SMALL | CHATBOX_FLAG_DRAW_BOX | CHATBOX_FLAG_BUTTONS));
98
99 // process this frame for the chatbox
100 int chatbox_process(int key_in=-1);
101
102 // shutdown all chatbox functionality
103 void chatbox_close();
104
105 // render the chatbox for this frame
106 void chatbox_render();
107
108 // try and scroll the chatbox up. return 0 or 1 on fail or success
109 int chatbox_scroll_up();
110
111 // try and scroll the chatbox down, return 0 or 1 on fail or success
112 int chatbox_scroll_down();
113
114 // clear the contents of the chatbox
115 void chatbox_clear();
116
117 // add a line of text (from the player identified by pid) to the chatbox
118 void chatbox_add_line(char *msg,int pid,int add_id = 1);
119
120 // force the chatbox to go into small mode (if its in large mode) - will not wotk if in multi paused chatbox mode
121 void chatbox_force_small();
122
123 // force the chatbox to go into big mode (if its in small mode) - will not work if in multi paused chatbox mode
124 void chatbox_force_big();
125
126 // "lose" the focus on the chatbox inputbox
127 void chatbox_lose_focus();
128
129 // return if the inputbox for the chatbox currently has focus
130 int chatbox_has_focus();
131
132 // grab the focus for the chatbox inputbox
133 void chatbox_set_focus();
134
135 // return if the inputbox was pressed - "clicked on"
136 int chatbox_pressed();
137
138 // reset all timestamps associated with the chatbox
139 void chatbox_reset_timestamps();
140
141 #endif
142