1 /* AbiSource Application Framework
2  * Copyright (C) 1998 AbiSource, Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301 USA.
18  */
19 
20 #ifndef XAP_DIALOG_MESSAGEBOX_H
21 #define XAP_DIALOG_MESSAGEBOX_H
22 
23 #include "xap_Dialog.h"
24 #include "xap_Strings.h"
25 
26 class ABI_EXPORT XAP_Dialog_MessageBox : public XAP_Dialog_NonPersistent
27 {
28 public:
29 	XAP_Dialog_MessageBox(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
30 	virtual ~XAP_Dialog_MessageBox(void) ;
31 
32 	virtual void					runModal(XAP_Frame * pFrame) = 0;
33 
34 	typedef enum { b_O, b_OC, b_YN, b_YNC }			tButtons;
35 	typedef enum { a_OK, a_CANCEL, a_YES, a_NO }	tAnswer;
36 
37 	void							setMessage(XAP_String_Id id, ...);
38 	void							setMessage(const char * sz, ...);
39 	void							setSecondaryMessage(XAP_String_Id id, ...);
40 	void							setSecondaryMessage(const char * sz, ...);
41 	void							setButtons(XAP_Dialog_MessageBox::tButtons buttons);
42 	void							setDefaultAnswer(XAP_Dialog_MessageBox::tAnswer answer);
43 	XAP_Dialog_MessageBox::tAnswer	getAnswer(void) const;
44 
45 protected:
46 	char *							m_szMessage;
47 	char *							m_szSecondaryMessage;
48 	XAP_Dialog_MessageBox::tButtons	m_buttons;
49 	XAP_Dialog_MessageBox::tAnswer	m_defaultAnswer;
50 	XAP_Dialog_MessageBox::tAnswer	m_answer;
51 };
52 
53 #endif /* XAP_DIALOG_MESSAGEBOX_H */
54