/* riscnet.h
 *
 * POPstar: Acorn POP3 client / SMTP send
 * RiscNet interface code
 *
 *  Joseph Heenan, 1998
 *
 * This file contains all definitions and declarations for RiscNet wimp messages.
 *
 * $Id: riscnet,v 1.2 1999/10/05 22:34:02 joseph Exp $
 *
 */

#ifndef RISCNET_H
#define RISCNET_H

#include "wimp.h" /* WimpMessage */

/* Any messages not detailed here are ignored by POPstar */

/* Ignored:

Riscnet_PreDial &51C81
Riscnet_Online &51C82
Riscnet_News_RequestFetch &51C89
Riscnet_News_SendNew &51C8A
Riscnet_News_Finish &51C8B

*/

/* To be implemented later:

Riscnet_Started &51C80
--

b%+20 =Version number
This announces that the Riscnet application has started.

Riscnet_PreOffline &51C83
--

This is sent just before riscnet is about to go offline..
If you still need the connection to the internet (mail fetch is active, news
fetch is active e.t.c.) you should give a error box, but still allow to give
the user an option to still logoff. Otherwise acknolege this message..
and broadcast (0 in the application field) the Riscnet_PreOffline message again.


Riscnet_ClickIcon &51C85
--

b%+20=len
b%+24=String of the application name (including !) that has just been clicked on. CHR$0 terminated.

This is sent when the user wishes to load up a new program, it is so that if a program is already running, it could give the illusion of clicking on the iconbar icon. If you take ne action to this message you MUST respond to it, or riscnet will load up another copy of your application.

*/

#define Riscnet_Mail_RequestFetch            0x51C86
/*
 * This is sent when the auto-fetch routine wants the mail to fetch new mail.
 * After a time delay... You must respond to it, else riscnet will start another copy of the mail program
 */

#define Riscnet_Mail_SendNew                 0x51C87
/*
 * b%+20=number of mail messages to be sent
 *
 * This is sent when riscnet detects new outgoing mail.
 * You must respond to it, else riscnet will start another copy of the mail program.
 */

#define Riscnet_Mail_Finish                  0x51C88
/*
 * b%+20=number of new mail messages recieved.
 *
 * This is sent by the mail fetcher back to riscnet.
 */

#define Riscnet_Offline                      0x51C84
/*
 * This is sent if no tasks object to going offline.
 * Tasks should quit when the received this message.
 * Must not be claimed.
 */


extern void riscnet_init( void ); /* called when POPstar is loaded */

extern void riscnet_mailfinish( int /*num new msgs*/ ); /* sends Riscnet_Mail_Finish message */

#define Riscnet_FirstMsg 0x51C80
#define Riscnet_LastMsg  0x51C8B
extern void riscnet_wimpmessage( WimpMessage */*msg*/ );
/* handles wimp messages between Riscnet_FirstMsg and LastMsg inclusive */

extern int riscnet_present; /* 'true' if RiscNet module is present, or if Riscnet_Starts is received */

#endif
