/*   ncbimsg.h
* ===========================================================================
*
*                            PUBLIC DOMAIN NOTICE
*               National Center for Biotechnology Information
*
*  This software/database is a "United States Government Work" under the
*  terms of the United States Copyright Act.  It was written as part of
*  the author's official duties as a United States Government employee and
*  thus cannot be copyrighted.  This software/database is freely available
*  to the public for use. The National Library of Medicine and the U.S.
*  Government have not placed any restriction on its use or reproduction.
*
*  Although all reasonable efforts have been taken to ensure the accuracy
*  and reliability of the software and data, the NLM and the U.S.
*  Government do not and cannot warrant the performance or results that
*  may be obtained by using this software or data. The NLM and the U.S.
*  Government disclaim all warranties, express or implied, including
*  warranties of performance, merchantability or fitness for any particular
*  purpose.
*
*  Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
* File Name:  ncbimsg.h
*
* Author:  Gish, Kans, Ostell, Schuler
*
* Version Creation Date:   1/1/91
*
* $Revision: 2.5 $
*
* File Description:
*   	prototypes for message and alert handling
*
* Modifications:
* --------------------------------------------------------------------------
* Date     Name        Description of modification
* -------  ----------  -----------------------------------------------------
* 04-15-93 Schuler     Changed _cdecl to LIBCALL
* 05-28-93 Schuler     New function: SetMonitorHook()
* 06-09-93 Schuler     Added magic_value field to Monitor
*
* ==========================================================================
*/

#ifndef _NCBIMSG_
#define _NCBIMSG_

#ifdef __cplusplus
extern "C" {
#endif

/* Message action codes */
typedef enum _MsgAction_
{
	MSG_ERROR,
	MSG_FATAL,
	MSG_OK,
	MSG_RC,
	MSG_ARI,
	MSG_YN,
	MSG_YNC,
	MSG_OKC,
	MSG_POST,
	MSG_POSTERR
}
MsgAction;

/* Message response codes */
#define ANS_NO 0
#define ANS_YES 1
#define ANS_OK 1
#define ANS_RETRY 1
#define ANS_ABORT 2
#define ANS_CANCEL 2
#define ANS_IGNORE 3


Nlm_Int2 CDECL Nlm_Message VPROTO((Nlm_Int2 key, char *format, ...));
void     LIBCALL Nlm_Beep PROTO((void));


/* Monitor type codes */
typedef enum _MonType_
{
	MonType_Int =1, MonType_Str
}
MonType;

/* Monitor notification codes */
typedef enum _MonCode_
{
	MonCode_Create=1,
	MonCode_Destroy,
	MonCode_IntValue,
	MonCode_StrValue
}
MonCode;


typedef struct _Monitor_
{
	Nlm_Int2	magic_value;
	MonType     type;
	Nlm_CharPtr strTitle;
	Nlm_Int4    intValue;
	Nlm_CharPtr strValue;
	Nlm_Int4    num1;
	Nlm_Int4    num2;
	Nlm_VoidPtr extra;	/* hook function may put things here */
}
Nlm_Monitor, *Nlm_MonitorPtr;

typedef int (LIBCALLBACK *Nlm_MonitorHook) PROTO((Nlm_MonitorPtr pMon, MonCode code));

Nlm_MonitorPtr LIBCALL Nlm_MonitorIntNew PROTO((Nlm_CharPtr title, Nlm_Int4 n1, Nlm_Int4 n2));
Nlm_MonitorPtr LIBCALL Nlm_MonitorStrNew PROTO((Nlm_CharPtr title, Nlm_Int2 len));
Nlm_Boolean    LIBCALL Nlm_MonitorStrValue PROTO((Nlm_MonitorPtr mon, Nlm_CharPtr sval));
Nlm_Boolean    LIBCALL Nlm_MonitorIntValue PROTO((Nlm_MonitorPtr mon, Nlm_Int4 ival));
Nlm_MonitorPtr LIBCALL Nlm_MonitorFree PROTO((Nlm_MonitorPtr mon));
void LIBCALL Nlm_SetMonitorHook PROTO((Nlm_MonitorHook hook));


/* aliases for Nlm_ names */
#define Beep Nlm_Beep
#define Message Nlm_Message

#define MonitorIntNew Nlm_MonitorIntNew
#define MonitorStrNew Nlm_MonitorStrNew
#define MonitorStrValue Nlm_MonitorStrValue
#define MonitorIntValue Nlm_MonitorIntValue
#define MonitorFree Nlm_MonitorFree
#define MonitorHook Nlm_MonitorHook
#define SetMonitorHook Nlm_SetMonitorHook
#define Monitor Nlm_Monitor
#define MonitorPtr Nlm_MonitorPtr

#ifdef __cplusplus
}
#endif

#endif
