msg.h File Reference

(r1785/r751)

#include "dlgtypes.h"
#include "errors.h"

Go to the source code of this file.

Classes

class  Msg
 The base Msg class from which all messages must be derived. More...
class  OpMsg
 This message is sent whenever something happens to an operation. More...
class  DialogMsg
 A DialogMsg is sent whenever the user interacts with the gadgets in a dialog box, It is only sensible to send this message to DialogOp objects. More...
class  DeathMsg
 This message is sent just before camelot's death. When a long-life operation receives this message it should tidy-up then call End(). More...

Defines

#define BROADCAST_TO_ALL(Message)
 The BROADCAST_TO_ALL macro is used to send a message to all MessageHandler objects in the system. If any MessageHandler returns a FAIL value then InformError is called.
#define BROADCAST_TO_CLASS(Message, Class)
 The BROADCAST_TO_ALL macro is used to send a message to all MessageHandler objects with a class derived from or equal to Class.
#define IS_OUR_DIALOG_MSG(Message)
 This macro for use in DialogOp classes evaluates to TRUE if the Message is a DialogMsg for the DialogOp. See DialogMsg for a full description of its usage.
#define DLG_EAT_IF_HUNGRY(DialogMsg)   ((DialogMsg)->DlgWndID) == NULL ? OK : EAT_MSG
 You should use this macro to return from a DialogOp's Message function after a DialogMsg has been processed. See DialogMsg for a full description of its use.
#define MESSAGE_IS_A(Message, MsgClass)   (Message->IsKindOf(CC_RUNTIME_CLASS(MsgClass)))
 This macro determines if Message is a kind of MsgClass.


Define Documentation

#define BROADCAST_TO_ALL Message   ) 
 

Value:

The BROADCAST_TO_ALL macro is used to send a message to all MessageHandler objects in the system. If any MessageHandler returns a FAIL value then InformError is called.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A value of OK or EAT_MSG indicates that the message was successfully sent to the MessageHandler objects. i.e. the MessageHandlers Message functions all returned either OK, or EAT_MSG.
OK means that message got sent to all specified MessageHandlers and all of them return OK. This does not imply than anyone acted on the message of course.

EAT_MSG means that a handler processed the message and didn't want it to be passed on.

A FAIL value indicates that one or more Message handlers returned a FAIL value from their Message functions. In this situation the broadcast function will call InformError describing the first error which occured.

Usage:

BROADCAST_TO_ALL(AMsg(p1,p2,p3))

See also:
BROADCAST_TO_CLASS

MessageHandler::Broadcast

Definition at line 286 of file msg.h.

#define BROADCAST_TO_CLASS Message,
Class   ) 
 

Value:

The BROADCAST_TO_ALL macro is used to send a message to all MessageHandler objects with a class derived from or equal to Class.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A value of OK or EAT_MSG indicates that the message was successfully sent to the MessageHandler objects. i.e. the MessageHandlers Message functions all returned either OK, or EAT_MSG.
OK means that message got sent to all specified MessageHandlers and all of them return OK. This does not imply than anyone acted on the message of course.

EAT_MSG means that a handler processed the message and didn't want it to be passed on.

A FAIL value indicates that one or more Message handlers returned a FAIL value from their Message functions. In this situation the broadcast function will call InformError describing the first error which occured.

To send a message to all DialogOp objects

BROADCAST_TO_CLASS(DialogMsg(p1,p2,p3), DialogOp)

To send a message to all Operation objects, including DialogOp objects.

BROADCAST_TO_CLASS(AMsg(p1,p2,p3), Operation)

Returns:
Errors: -
See also:
BROADCAST_TO_ALL

MessageHandler::Broadcast

Definition at line 332 of file msg.h.

#define DLG_EAT_IF_HUNGRY DialogMsg   )     ((DialogMsg)->DlgWndID) == NULL ? OK : EAT_MSG
 

You should use this macro to return from a DialogOp's Message function after a DialogMsg has been processed. See DialogMsg for a full description of its use.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/4/94
Parameters:
DialogMsg,: The dialog message (DialogMsg) [INPUTS]
- [OUTPUTS]
Returns:
-
return(DLG_EAT_IF_HUNGRY(Msg));

Returns:
Errors: -
See also:
IS_OUR_DIALOG_MSG

Definition at line 400 of file msg.h.

#define IS_OUR_DIALOG_MSG Message   ) 
 

Value:

(                                                                       \
        (WindowID != NULL) &&                                               \
            (                                                               \
                ((Message)->IsKindOf(CC_RUNTIME_CLASS(DialogMsg))) &&       \
                    (                                                       \
                        (WindowID == ((DialogMsg*)(Message))->DlgWndID) ||  \
                        ( ((DialogMsg*)(Message))->DlgWndID == NULL)        \
                    )                                                       \
            )                                                               \
    )
This macro for use in DialogOp classes evaluates to TRUE if the Message is a DialogMsg for the DialogOp. See DialogMsg for a full description of its usage.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/94
Parameters:
Message,: Msg* [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
DialogMsg

DLG_EAT_IF_HUNGRY

Definition at line 364 of file msg.h.

#define MESSAGE_IS_A Message,
MsgClass   )     (Message->IsKindOf(CC_RUNTIME_CLASS(MsgClass)))
 

This macro determines if Message is a kind of MsgClass.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/3/94
Parameters:
Message,: Msg* [INPUTS] MsgClass: A class eg. DialogMsg
- [OUTPUTS]
Returns:

Errors: -

See also:
-

Definition at line 420 of file msg.h.


Generated on Sat Nov 10 03:49:15 2007 for Camelot by  doxygen 1.4.4