Initial revision
[ssr] / StraySrc / Libraries / Steel / h / stddbox
1 /*
2 * stddbox
3 * Some standard Straylight dboxes.
4 *
5 * v. 1.00 (9 August 1991)
6 *
7 * © 1991-1998 Straylight
8 */
9
10 /*----- Licensing note ----------------------------------------------------*
11 *
12 * This file is part of Straylight's Steel library.
13 *
14 * Steel is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option)
17 * any later version.
18 *
19 * Steel is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with Steel. If not, write to the Free Software Foundation,
26 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */
28
29 #ifndef __stddbox_h
30 #define __stddbox_h
31
32 #ifndef __xfersend_h
33 #include "xfersend.h"
34 #endif
35
36 #ifndef __dbox_h
37 #include "dbox.h"
38 #endif
39
40 typedef BOOL (*stddbox_writableHandler)(char *result,void *handle);
41
42 /*
43 * BOOL warning(char *okMsg,char *warn,...)
44 *
45 * Use
46 * Pops up a warning box, with a Cancel button and a default action button
47 * with your own text in it.
48 *
49 * Parameters
50 * char *okMsg == what to put in the default action button.
51 * char *warn == the warning message (printf()-style format string)
52 *
53 * Returns
54 * TRUE if the user chose the OK button.
55 */
56
57 BOOL warning(char *okMsg,char *warn,...);
58
59 /*
60 * void note(char *notemsg,...)
61 *
62 * Use
63 * Displays a small note on the screen, so you can tell the user that he
64 * has done something silly, etc. A lot nicer than old werr().
65 *
66 * Parameters
67 * char *notemsg == the note (printf()-style format string)
68 */
69
70 void note(char *notemsg,...);
71
72 /*
73 * BOOL writable
74 * (
75 * char *title,
76 * char *deflt,
77 * char *result,
78 * stddbox_writableHandler proc,
79 * void *handle
80 * )
81 *
82 * Use
83 * Opens a dialogue box for the user to input a string. Needs
84 * the 'writable' template.
85 *
86 * Parameters
87 * char *title == the title for the dialogue box.
88 * char *default == the default string to put in the writable area.
89 * char *result == a buffer to contain the result string. May be 0.
90 * stddbox_writableHandler proc == proc to call when OK is clicked. May
91 * be 0. Return TRUE if successful (i.e. we may close the dbox).
92 * void *handle == passed to proc.
93 *
94 * Returns
95 * TRUE if the string has been updated.
96 */
97
98 BOOL writable
99 (
100 char *title,
101 char *deflt,
102 char *result,
103 stddbox_writableHandler proc,
104 void *handle
105 );
106
107 /*
108 * void saveWarn
109 * (
110 * BOOL useName,
111 * void (*dispose)(void *handle),
112 * char *title,
113 * char *name,
114 * int filetype,
115 * int estsize,
116 * xfersend_saveproc saveproc,
117 * xfersend_sendproc sendproc,
118 * xfersend_printproc printproc,
119 * void *handle
120 * )
121 *
122 * Use
123 * Pops up a save warning box allowing the use the luxury of saving his
124 * data before closing the file. The file is only removed if the data is
125 * 'safe'.
126 *
127 * Parameters
128 * BOOL useName == whether to use the given name in the warning message
129 * void (*dispose)(void *handle) == function to dispose the user's data
130 * the others == as for saveas()
131 */
132
133 void saveWarn
134 (
135 BOOL useName,
136 void (*dispose)(void *handle),
137 char *title,
138 char *name,
139 int filetype,
140 int estsize,
141 xfersend_saveproc saveproc,
142 xfersend_sendproc sendproc,
143 xfersend_printproc printproc,
144 void *handle
145 );
146
147 /*
148 * void progInfo
149 * (
150 * char *name,
151 * char *purpose,
152 * char *author,
153 * int version,
154 * char *date
155 * )
156 *
157 * Use
158 * Presents a standard progInfo window giving information about an
159 * application.
160 *
161 * Parameters
162 * char *name == the name of the program
163 * char *purpose == what it does
164 * char *author == author/copyright string (usually something like
165 * '© 1992-1998 Straylight')
166 * int version == the version number*100 (e.g. 374 for 3.74 etc.)
167 * char *date == the date of compilation (use _TIME_NOW)
168 */
169
170 void progInfo(char *name,char *purpose,char *author,int version,char *date);
171
172 /*
173 * void mbox(dbox d)
174 *
175 * Use
176 * Handles a monologue box (like info windows) where no input is required.
177 * You should create the dbox, fill in any fields required. This routine
178 * then handles the rest. It deletes the dbox when it's finished - it's of
179 * no use to the caller anyway - who wants a used dialogue box with no
180 * input? Yuk...
181 *
182 * You can specify a help message tag to be displayed before any messages
183 * embedded in the icons. This is passed through msgs_lookup before
184 * sending to help_addLine. Specify zero for this to send no message.
185 *
186 * Parameters
187 * dbox d == the box to handle
188 * char *help == the help message tag to stick on the top
189 */
190
191 void mbox(dbox d,char *help);
192
193 #endif