| 1 | /* |
| 2 | * PROPRIETARY INFORMATION. This software is proprietary to POWDER |
| 3 | * Development, and is not to be reproduced, transmitted, or disclosed |
| 4 | * in any way without written permission. |
| 5 | * |
| 6 | * Produced by: Jeff Lait |
| 7 | * |
| 8 | * POWDER Development |
| 9 | * |
| 10 | * NAME: msg.h ( POWDER Library, C++ ) |
| 11 | * |
| 12 | * COMMENTS: |
| 13 | * Platform independent message handler. |
| 14 | * |
| 15 | * This is the message glue library. It handles the writing |
| 16 | * of status messages or prompts to the display. It deals with |
| 17 | * -more-, scrollback, wordwrap, etc. |
| 18 | * |
| 19 | * For displaying a block of scrollable text, see the gfx_ |
| 20 | * functions in gfx_engine. |
| 21 | */ |
| 22 | |
| 23 | #ifndef __msg_h__ |
| 24 | #define __msg_h__ |
| 25 | |
| 26 | #include "buf.h" |
| 27 | |
| 28 | void msg_init(); |
| 29 | |
| 30 | // Waits for any net-new keypress. |
| 31 | void msg_awaitaccept(); |
| 32 | |
| 33 | // Send a standard message across. This program will handle line wrapping, |
| 34 | // pausing for user to read long messages or for the previous message |
| 35 | // to clear, etc. |
| 36 | void msg_report(const char *msg, bool wait=true); |
| 37 | void msg_report(BUF buf, bool wait=true); |
| 38 | |
| 39 | // Much like msg_report, except the message is first broadcast across |
| 40 | // the center of the screen. It is then placed into the message buffer |
| 41 | // for scrollback purposes. |
| 42 | void msg_announce(const char *msg); |
| 43 | void msg_announce(BUF buf); |
| 44 | |
| 45 | // This does an append-style message. It will allow this message to break |
| 46 | // between lines (but not "pages"), and be tacked on after other messages. |
| 47 | void msg_append(const char *msg); |
| 48 | |
| 49 | // This message requires an accept before it continues. |
| 50 | void msg_alert(const char *msg); |
| 51 | |
| 52 | // Asks the user for a questions, return false if cancelled |
| 53 | bool msg_askdir(const char *question, int &dx, int &dy, bool allowdiag=false); |
| 54 | |
| 55 | // Clear all messages. |
| 56 | void msg_clear(); |
| 57 | |
| 58 | // Reports if queue is empty. |
| 59 | bool msg_isempty(); |
| 60 | |
| 61 | // Restores the last message that was cleared. |
| 62 | // Using this repeatedly will get earlier messages, and restorelast |
| 63 | // of false will get later messages. If it is outside its valid range, |
| 64 | // false is returned. |
| 65 | bool msg_restore(bool restorelast); |
| 66 | |
| 67 | // Shows the entire message history in the pager. |
| 68 | void msg_displayhistory(); |
| 69 | |
| 70 | #endif |