MessageHandler Class Reference

If a system object must respond to system messages then its class should be derived from the abstract MessageHandler class. When a MessageHandler is constructed it gets added to a list of MessageHandlers which are all targets of system messages. To send a message to all or just a subset of MessageHandlers, you should use the static Broadcast method. The virtual 'Message' function is called whenever the MessageHandler is sent a message. More...

#include <pump.h>

Inheritance diagram for MessageHandler:

ListItem CCObject SimpleCCObject BlobManager ColourBarMsgHandler ColourDropMsgHandler ColourManager LayerMsgHandler OpDescriptor Operation RulerPair SelRangeMessageHandler List of all members.

Public Member Functions

 MessageHandler (CCRuntimeClass *Class=CC_RUNTIME_CLASS(MessageHandler), BOOL SendMessages=TRUE)
 If the SendMessage flag is TRUE then this function adds the MessageHandler to a list of MessageHandlers constructed with the same Class parameter. The Class specified should have been registered using RegisterClassGroup during startup.
virtual ~MessageHandler ()
 MessageHandler destructor, removes the MessageHandler from a MessageHandler list, if it's on one.

Static Public Member Functions

static MsgResult Broadcast (Msg *Message, CCRuntimeClass *Class=NULL)
 Sends a message to the specified MessageHandlers. Note that you should not use this function directly. Instead use one of the BROADCAST macros.
static BOOL RegisterClassGroup (CCRuntimeClass *Class)
 This function should be called to register a Class group at startup eg. Application::Init. See the Message Handler constructor for more information.
static ListGetClassList (CCRuntimeClass *Class)
 For obtaining a pointer to a list of MessageHandlers in the specified class group.
static void Destroy ()
 This static function should be Called before we quit Camelot. It deletes all message handler class lists.
static BOOL MessageHandlerExists (CCRuntimeClass *Class)
 Searches for a message handler with runtime class (Class).

Static Public Attributes

static MsgpTmpMsg

Protected Member Functions

virtual MsgResult Message (Msg *Msg)
 The default message handler receives global messages, extracts information from them and then calls virtual On<Message> handlers.
virtual BOOL OnDeathMsg (void)
virtual BOOL OnSelChangingMsg (SelChangingMsg::SelectionState State)
virtual BOOL OnColourChangingMsg (ColourChangingMsg *Msg)
virtual BOOL OnDocViewMsg (DocView *pDocView, DocViewMsg::DocViewState State)
virtual BOOL OnBarMsg (BarMsg *Msg)
virtual BOOL OnDocChangingMsg (Document *pChangingDoc, DocChangingMsg::DocState State)
virtual BOOL OnOptionsChangingMsg (OptionsChangingMsg *Msg)
virtual BOOL OnCommonAttrsChangedMsg (void)

Static Protected Member Functions

static void SendNoMoreMessages (MessageHandler *MessageHandlerToRemove)
 Call this function when you want Messages to stop being sent to the MessageHandler. The MessageHandler is simply removed from its message handler list.

Static Protected Attributes

static List MessageHandlerClassList
static BOOL PostDeath = FALSE

Detailed Description

If a system object must respond to system messages then its class should be derived from the abstract MessageHandler class. When a MessageHandler is constructed it gets added to a list of MessageHandlers which are all targets of system messages. To send a message to all or just a subset of MessageHandlers, you should use the static Broadcast method. The virtual 'Message' function is called whenever the MessageHandler is sent a message.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/03/93
See also:

Definition at line 149 of file pump.h.


Constructor & Destructor Documentation

MessageHandler::MessageHandler CCRuntimeClass Class = CC_RUNTIME_CLASS(MessageHandler),
BOOL  SendMessages = TRUE
 

If the SendMessage flag is TRUE then this function adds the MessageHandler to a list of MessageHandlers constructed with the same Class parameter. The Class specified should have been registered using RegisterClassGroup during startup.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/03/94
Parameters:
Class,: Specifies the MessageHandler list this MessageHandler should [INPUTS] be added to. This class must be derived from Class. (See Purpose for a description of how to use this)
SendMessages: This flag specifies if the MessageHandler should be added to a message list or not. For example certain operations may not be interested in any messages. Setting SendMessages to FALSE in this situation will make message dispatching more efficient.
Parameters:
- [OUTPUTS]
Returns:
-
Note: The reason for specifying a class parameter is that it allows you to send messages to selected groups of MessageHandlers. For example if a dialog message is being sent then it is more efficient to broadcast this message only to Operations derived from DialogOperation. So all DialogOpS should specify a DialogOp class in their MessageHandler constructor.

It is important not to create too many groups of MessageHandlers as this can lead to inefficient message dispatching. Only create a new group if you see a situation where a message should be sent only to MessageHandlers in that group.

Returns:
Errors: In the retail version: If a MessageHandler list for the class specified does not exist then one is created (because the constructor cannot fail). In the debug version an ENSURE failure will occur.
See also:
MessageHandler::Broadcast

MessageHandler::RegisterClassGroup

Definition at line 184 of file pump.cpp.

00185 {
00186     if (SendMessages)
00187     {   
00188         // The MessageHandler is to receive messages so it needs to be added to a list grouping 
00189         // all MessageHandlers with the same Class. 
00190 
00191         ListItem* AddMessageHandlerList = NULL; // The list the message handler should be added to. 
00192 
00193         // Firstly determine if there is already a MessageHandlerList to place the MessageHandler on
00194         ListItem* CurrentMessageHandlerList = MessageHandlerClassList.GetHead(); 
00195         while (CurrentMessageHandlerList != NULL)
00196         {
00197             if (((MessageHandlerList*)CurrentMessageHandlerList)->MessageHandlerClass == Class)
00198             {
00199                 AddMessageHandlerList = CurrentMessageHandlerList;  
00200                 break; 
00201             }
00202             CurrentMessageHandlerList = 
00203                 MessageHandlerClassList.GetNext(CurrentMessageHandlerList); 
00204         }
00205 
00206         if (AddMessageHandlerList == NULL)  // There is no suitable MessageHandlerList so we 
00207                                             // must create one.  
00208         {
00209             // this test can go off when someone forgot to register a class. It can also
00210             // go off in DLL builds if a default parameter of CC_RUNTIME_CLASS is used
00211             // as the compiler screws up the function call
00212             ERROR3_PF( ("Class %s not registered for MessageHandler", Class->GetClassName() ) );
00213 
00214             AddMessageHandlerList = new MessageHandlerList(Class); 
00215             MessageHandlerClassList.AddHead(AddMessageHandlerList); 
00216         }
00217 
00218         // Add the MessageHandler to the MessageHandler list 
00219         ((MessageHandlerList*)AddMessageHandlerList)->m_List.AddHead(this); 
00220     }
00221 }

MessageHandler::~MessageHandler  )  [virtual]
 

MessageHandler destructor, removes the MessageHandler from a MessageHandler list, if it's on one.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/2/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 376 of file pump.cpp.

00377 {
00378 
00379     SendNoMoreMessages(this); // Removes the Message Handler from any Message list 
00380                                // it may have been on. 
00381 
00382 }


Member Function Documentation

MsgResult MessageHandler::Broadcast Msg Message,
CCRuntimeClass Class = NULL
[static]
 

Sends a message to the specified MessageHandlers. Note that you should not use this function directly. Instead use one of the BROADCAST macros.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/2/94
Parameters:
Msg - The message to send [INPUTS] this will be deleted after the message has been sent
Class - Class specifies which MessageHandlers you wish to send the message to.If Class = NULL (which is the default) then the message is sent to all MessageHandlers, otherwise the message is sent only to those MessageHandlers with a runtime class Class, or a class derived from Class.

Parameters:
- [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.

See also:
MessageHandler::Message

MessageHandler::RegisterClassGroup

BROADCAST_TO_ALL

BROADCAST_TO_CLASS

Definition at line 428 of file pump.cpp.

00429 {
00430     // If the DeathMsg has been sent to all MessageHandlers then we won't allow any more
00431     // broadcasts...
00432     if (PostDeath)
00433     {
00434         delete Message;
00435         return (OK);
00436     } 
00437 
00438     // Indicate we may need to refresh button states on exit
00439 //  ControlList::Get()->Changed();
00440 
00441 /*  Document* pOldCurDoc = Document::GetCurrent();
00442     View* pOldCurView = View::GetCurrent();
00443 */
00444     if (Class == NULL)
00445     {
00446         // Send the message to all Message Handlers
00447         Class = CC_RUNTIME_CLASS(MessageHandler); 
00448     };
00449      
00450     MessageHandlerList* CurrentMessageHandlerList = 
00451         (MessageHandlerList*)(MessageHandlerClassList.GetHead()); 
00452     ListItem* CurrentMessageHandler; 
00453     ListItem* NextMessageHandler; 
00454     BOOL Result; 
00455 
00456     #ifdef _DEBUG
00457     BOOL FoundClassGrp = FALSE; 
00458     #endif
00459     
00460     BOOL Failed = FALSE;  // Set to TRUE if a Message fn returns FAIL
00461     String_256 FirstErrStr;  // Used to save the first error description set
00462     UINT32 FirstErrMod=0; 
00463     
00464     while (CurrentMessageHandlerList != NULL)
00465     {   
00466         // Determine if we should send messages to the objects in the 
00467         // list
00468         const CCRuntimeClass* GroupClass = CurrentMessageHandlerList-> MessageHandlerClass; 
00469         while (GroupClass != NULL)
00470         {
00471             if (GroupClass == Class)
00472             {  
00473                 #ifdef _DEBUG
00474                 FoundClassGrp = TRUE; 
00475                 #endif
00476                 // GroupClass is equal to or derived from Class
00477                 // Send the message to every MessageHandler in the list
00478                 CurrentMessageHandler = CurrentMessageHandlerList->m_List.GetHead(); 
00479                 while (CurrentMessageHandler != NULL)
00480                 {   
00481                     // Get the next message handler now cos there is no guarantee that 
00482                     // CurrentMessageHandler will survive. 
00483                     NextMessageHandler = (MessageHandlerList*)
00484                         (CurrentMessageHandlerList->m_List.GetNext(CurrentMessageHandler)); 
00485 
00486                     Result = ((MessageHandler*)CurrentMessageHandler)->
00487                               Message(Message); // Send the message 
00488 
00489                     if (Result == EAT_MSG) 
00490                     {
00491                         delete Message;
00492 /*
00493                         // We need to restore the old current doc and view's,
00494                         // but they may have been deleted, so we must first
00495                         // check that they are still in the doc list.
00496                         Document *pDoc = (Document *) Camelot.Documents.GetHead();
00497                         while (pDoc != NULL)
00498                         {
00499                             if (pDoc == pOldCurDoc)
00500                             {
00501                                 // Restore the old current values
00502                                 if (pOldCurView)
00503                                     pOldCurView->SetCurrent();
00504                                 else
00505                                     View::SetNoCurrent();
00506                                 if (pOldCurDoc)
00507                                     pOldCurDoc->SetCurrent();
00508                                 else
00509                                     Document::SetNoCurrent();
00510 
00511                                 break;
00512                             }
00513 
00514                             pDoc = (Document *) Camelot.Documents.GetNext(pDoc);
00515                         }
00516 */
00517                         return EAT_MSG;     // The message has been eaten
00518                     }
00519                     if (Result == FAIL)
00520                     {
00521                         // If we have failed previously then we need not do anything special
00522                         if (!Failed)
00523                         {
00524                             // Record the error which was set, we will restore this value prior
00525                             // to returning from the function. 
00526                             FirstErrStr = Error::GetErrorString(); 
00527                             FirstErrMod = Error::GetErrorModule(); 
00528                             Failed = TRUE; // So we don't record the error again    
00529                         }
00530                         // Continue to send the message on to other MessageHandlers
00531                     }
00532                     // Get the next Message Handler
00533                     CurrentMessageHandler = NextMessageHandler;
00534                 }
00535                 break; 
00536 
00537             }
00538             GroupClass = GroupClass->GetBaseClass1();
00539         }
00540 
00541         CurrentMessageHandlerList = (MessageHandlerList*)
00542             (MessageHandlerClassList.GetNext(CurrentMessageHandlerList)); 
00543     }
00544 
00545     // If we have just sent the DeathMsg then flag that we will allow no more!
00546     CCRuntimeClass* MsgType = Message->GetRuntimeClass();
00547     if (MsgType==CC_RUNTIME_CLASS(DeathMsg))
00548     {
00549         PostDeath = TRUE;
00550     }
00551 
00552     delete Message;
00553     #ifdef _DEBUG   
00554     ENSURE(FoundClassGrp, "Message cannot be sent"); 
00555     #endif
00556 
00557 /*  // Restore the old current values
00558     if (pOldCurView)
00559         pOldCurView->SetCurrent();
00560     else
00561         View::SetNoCurrent();
00562     if (pOldCurDoc)
00563         pOldCurDoc->SetCurrent();
00564     else
00565         Document::SetNoCurrent();
00566 */
00567     if (Failed)
00568     {
00569         // Restore the error
00570         Error::SetError(0, FirstErrStr, FirstErrMod);
00571         InformError();  
00572         return FAIL; 
00573     }
00574     else
00575     {
00576         return OK;
00577     }
00578 }

void MessageHandler::Destroy  )  [static]
 

This static function should be Called before we quit Camelot. It deletes all message handler class lists.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
-

Definition at line 716 of file pump.cpp.

00717 {
00718     ListItem* CurrentMessageHandlerList = MessageHandlerClassList.GetHead(); 
00719 
00720     while (CurrentMessageHandlerList != NULL)
00721     {
00722         ListItem* NextItem = MessageHandlerClassList.GetNext(CurrentMessageHandlerList);
00723 
00724         delete( MessageHandlerClassList.RemoveItem(CurrentMessageHandlerList) ); 
00725 
00726         CurrentMessageHandlerList = NextItem;
00727     }       
00728 }

List * MessageHandler::GetClassList CCRuntimeClass Class  )  [static]
 

For obtaining a pointer to a list of MessageHandlers in the specified class group.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/3/94
Parameters:
Class,: The class group [INPUTS]
- [OUTPUTS]
Returns:
The list of MessageHandlers in the Class group, NULL if the class group could not be found

Errors: An ENSURE will occur if the class group could not be found

See also:
-

Definition at line 282 of file pump.cpp.

00283 {
00284     ListItem* CurrentMessageHandlerList = MessageHandlerClassList.GetHead(); 
00285     while (CurrentMessageHandlerList != NULL)
00286     {
00287         if (((MessageHandlerList*)CurrentMessageHandlerList)->MessageHandlerClass == Class)
00288         {
00289             return (&(((MessageHandlerList*)CurrentMessageHandlerList)->m_List)); 
00290         }
00291         CurrentMessageHandlerList = MessageHandlerClassList.GetNext(CurrentMessageHandlerList); 
00292     }
00293     ENSURE(FALSE, "Could not find class list"); 
00294     return NULL; 
00295 }

MsgResult MessageHandler::Message Msg Message  )  [protected, virtual]
 

The default message handler receives global messages, extracts information from them and then calls virtual On<Message> handlers.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/2/94
Parameters:
Message,: The message [INPUTS]
Returns:
OK Message handled ok (return this even if you don't need to respond to the message).
FAIL Something terrible happened whilst processing the message eg. we ran out of memory. You must set ERROR if you are returning this value. The message will continue to be sent to other MessageHandlers.

EAT_MSG The Message was handled ok but don't send it to any more MessageHandlers.

Returns:
Errors: You must set ERROR if you are returning FAIL.
See also:
Operation::Broadcast

Reimplemented in ArrangeAlignment, AppPrefsDlg, GIFAnimationPropertyTabsDlg, AnimExOptns, BarCreationDlg, BarStatesDlg, BarRedefineStateDlg, DialogBarOp, SystemBarOp, InformationBarOp, BfxDlg, BfxPlugInDlg, CBiasGainDlg, BlobbyDlg, BlobbyBar, BlobbyTabDlg, BlobManager, BmapPrevDlg, BitmapExportPreviewDialog, BmpPrefsDlg, JPEGExportPrefsDialog, PhotoCDDlg, BmpDlg, CBaseBrushNameDlg, CBrushEditDlg, CMXTreeDlg, ColourEditDlg, ColourManager, CXFTreeDlg, DaveDlg, DebugTreeDlg, DialogOp, DialogTabOp, ExtendSetsDlg, ImagemapDlg, FileInfo, GuidelinePropDlg, WebAddressDlg, InfoBarOp, LayerMsgHandler, LayerDlg, LayerNameDlg, LayerPropertyTabsDlg, NameDialog, NewColourDlg, NameGallery, BaseNameObjectsDlg, OpDescriptor, ChangeFeatherSizeSliderOpDesc, ChangeFeatherProfileOpDesc, SepsDlg, UnitPropertiesDlg, PreviewDialog, PrintPrefsDlg, SelRangeMessageHandler, RenderDemoDlg, RulerPair, SelMediaDlg, SuperGallery, SGalleryOptionsDlg, SGallerySortDlg, SGallerySearchDlg, TEMPLATESGallery, BitmapSGallery, ColourSGallery, ColourNameDlg, FrameSGallery, LayerSGallery, LibraryGallery, LibClipartSGallery, LibFillsSGallery, LineGallery, NameGallery, NameObjectsDlg, StatusLine, StandardBar, TipsDlg, TemplateDialog, ToolbarDlg, ToolnameDlg, CustomizeBarDlg, TraceDlg, URLImportDlg, WebPrefsDlg, NativePrefsDlg, XSEPSExportOptions, BevelInfoBarOp, BezToolInfoBarOp, BlendInfoBarOp, BlankInfoBarOp, ContourInfoBarOp, GradInfoBarOp, TranspInfoBarOp, FreeHandInfoBarOp, GridInfoBarOp, LiveEffectsInfoBarOp, MouldInfoBarOp, PenToolInfoBarOp, QuickShapeBaseInfoBarOp, SelectorInfoBarOp, SliceInfoBarOp, TextInfoBarOp, OpZoomDescriptor, OpZoomComboDescriptor, ZoomInfoBarOp, ColourBarMsgHandler, PasteSpecialDlg, ColourDropMsgHandler, PrintProgressDlg, FontsSGallery, and SGalleryLinePropertiesDlg.

Definition at line 609 of file pump.cpp.

00610 {
00611     // Find out the type of the message
00612     CCRuntimeClass* MsgType = Message->GetRuntimeClass();
00613 
00614     if (MsgType==CC_RUNTIME_CLASS(DeathMsg))
00615     {
00616         return(OnDeathMsg() ? OK : FAIL);   
00617     }
00618     else if (MsgType==CC_RUNTIME_CLASS(SelChangingMsg))
00619     {
00620         return(OnSelChangingMsg( ((SelChangingMsg*)Message)->State ) ? OK: FAIL);
00621     }
00622     else if (MsgType==CC_RUNTIME_CLASS(ColourChangingMsg))
00623     {
00624         return(OnColourChangingMsg((ColourChangingMsg*)Message) ? OK: FAIL);
00625     }
00626     else if (MsgType==CC_RUNTIME_CLASS(DocViewMsg))
00627     {
00628         DocViewMsg* DVMsg = (DocViewMsg*)Message; 
00629         return(OnDocViewMsg(DVMsg->pNewDocView, DVMsg->State) ? OK: FAIL);
00630     }
00631 #if !defined(EXCLUDE_FROM_RALPH)
00632     else if (MsgType==CC_RUNTIME_CLASS(BarMsg))
00633     {
00634         return(OnBarMsg((BarMsg*)Message) ? OK: FAIL);  
00635     }
00636 #endif
00637     else  if (MsgType==CC_RUNTIME_CLASS(DocChangingMsg))
00638     {
00639         DocChangingMsg* DCMsg = (DocChangingMsg*)Message;
00640         return(OnDocChangingMsg(DCMsg->pChangingDoc, DCMsg->State) ? OK: FAIL); 
00641     } 
00642 #if !defined(EXCLUDE_FROM_RALPH)
00643     else if (MsgType==CC_RUNTIME_CLASS(OptionsChangingMsg))
00644     {
00645         return(OnOptionsChangingMsg((OptionsChangingMsg*)Message) ? OK: FAIL);
00646     }
00647 #endif
00648     else if (MsgType==CC_RUNTIME_CLASS(CommonAttrsChangedMsg))
00649     {
00650         return(OnCommonAttrsChangedMsg() ? OK: FAIL);
00651     }
00652     else return OK; 
00653 }

BOOL MessageHandler::MessageHandlerExists CCRuntimeClass Class  )  [static]
 

Searches for a message handler with runtime class (Class).

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/08/94
Parameters:
Class,: The message handler's runtime class [INPUTS]
- [OUTPUTS]
Returns:
TRUE if a MessageHandler exists with runtime class 'Class'
eg. to determine if there is a 'live' BlobbyDlg operation if (MessageHandler::MessageHandlerExists(CC_RUNTIME_CLASS(DialogOp,BlobbyDlg))) { ... }
Returns:
Errors: -
See also:
-

Definition at line 319 of file pump.cpp.

00320 {
00321     const CCRuntimeClass* BaseClass;
00322 
00323     // Search for the class list
00324     MessageHandlerList* CurrentMessageHandlerList = 
00325         (MessageHandlerList*)(MessageHandlerClassList.GetHead()); 
00326     while (CurrentMessageHandlerList != NULL)
00327     {
00328         BaseClass = Class; 
00329         // An instance of the Class message handler could be on any Class group list
00330         // which it is derived from 
00331         while (BaseClass != NULL)
00332         {
00333             if (BaseClass == CurrentMessageHandlerList->MessageHandlerClass)
00334             {
00335                 // Could be on this list !
00336                 // Search for a message handler with class 'Class'
00337                 MessageHandler* MHandler =  (MessageHandler*)
00338                     (CurrentMessageHandlerList->m_List.GetHead());
00339                 while (MHandler != NULL)
00340                 {
00341                     if (MHandler->GetRuntimeClass() == Class)
00342                     {
00343                         return TRUE; 
00344                     }
00345                     MHandler = (MessageHandler*)
00346                         (CurrentMessageHandlerList->m_List.GetNext(MHandler));
00347 
00348                 }
00349                 break;
00350             }
00351             BaseClass = BaseClass->GetBaseClass1();
00352         }
00353         CurrentMessageHandlerList = 
00354             (MessageHandlerList*)MessageHandlerClassList.GetNext(CurrentMessageHandlerList); 
00355     }
00356     return FALSE; 
00357 } 

virtual BOOL MessageHandler::OnBarMsg BarMsg Msg  )  [inline, protected, virtual]
 

Definition at line 206 of file pump.h.

00206 {return TRUE;};

virtual BOOL MessageHandler::OnColourChangingMsg ColourChangingMsg Msg  )  [inline, protected, virtual]
 

Definition at line 202 of file pump.h.

00202 { return TRUE; };

virtual BOOL MessageHandler::OnCommonAttrsChangedMsg void   )  [inline, protected, virtual]
 

Reimplemented in OpChangeLineAttribOpDesc, OpChangeLineWidthOpDesc, ChangeFeatherSizeSliderOpDesc, and LineGallery.

Definition at line 212 of file pump.h.

00212 {return TRUE;};

virtual BOOL MessageHandler::OnDeathMsg void   )  [inline, protected, virtual]
 

Reimplemented in DownloadOp, OpAddWebFolders, and OpAddWebLibrary.

Definition at line 198 of file pump.h.

00198 {return TRUE;}; 

virtual BOOL MessageHandler::OnDocChangingMsg Document pChangingDoc,
DocChangingMsg::DocState  State
[inline, protected, virtual]
 

Reimplemented in OpMenuImport, OpAsynchBitmapImport, OpAsynchClipartImport, OpChangeLineAttribOpDesc, OpChangeLineWidthOpDesc, OpGenericDownload, HelpDownloadOp, and OpBitmapDownload.

Definition at line 208 of file pump.h.

00208 {return TRUE;};

virtual BOOL MessageHandler::OnDocViewMsg DocView pDocView,
DocViewMsg::DocViewState  State
[inline, protected, virtual]
 

Reimplemented in QualitySliderDescriptor.

Definition at line 204 of file pump.h.

00204 {return TRUE;};

virtual BOOL MessageHandler::OnOptionsChangingMsg OptionsChangingMsg Msg  )  [inline, protected, virtual]
 

Reimplemented in ChangeFeatherSizeSliderOpDesc.

Definition at line 210 of file pump.h.

00210 {return TRUE;};

virtual BOOL MessageHandler::OnSelChangingMsg SelChangingMsg::SelectionState  State  )  [inline, protected, virtual]
 

Reimplemented in OpChangeLineWidthOpDesc, ChangeFeatherSizeSliderOpDesc, and OpChangeFeatherProfile.

Definition at line 200 of file pump.h.

00200 {return TRUE;}; 

BOOL MessageHandler::RegisterClassGroup CCRuntimeClass Class  )  [static]
 

This function should be called to register a Class group at startup eg. Application::Init. See the Message Handler constructor for more information.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/3/94
Parameters:
Class,: The class group to create. [INPUTS]
- [OUTPUTS]
Returns:
TRUE if successful, FALSE if memory could not be allocated

Errors: ERROR is called if we are out of memory, and FALSE is returned

See also:
-

Definition at line 241 of file pump.cpp.

00242 {
00243     #if _DEBUG
00244     // Lets make sure that this class has not already been registered
00245     ListItem* CurrentMessageHandlerList = MessageHandlerClassList.GetHead(); 
00246     while (CurrentMessageHandlerList != NULL)
00247     {
00248         if (((MessageHandlerList*)CurrentMessageHandlerList)->MessageHandlerClass == Class)
00249         {
00250             ENSURE(FALSE, 
00251                 "Trying to register a class group which has already been registered");      
00252         }
00253         CurrentMessageHandlerList = MessageHandlerClassList.GetNext(CurrentMessageHandlerList); 
00254     }
00255     #endif
00256 
00257     // Create a new Message handler list 
00258     ListItem* NewMessageHandlerList = new MessageHandlerList(Class); 
00259     if (NewMessageHandlerList == NULL)
00260         return FALSE;
00261     MessageHandlerClassList.AddTail(NewMessageHandlerList); 
00262     return TRUE; 
00263 }

void MessageHandler::SendNoMoreMessages MessageHandler MessageHandlerToRemove  )  [static, protected]
 

Call this function when you want Messages to stop being sent to the MessageHandler. The MessageHandler is simply removed from its message handler list.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/3/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
It is quite safe to call this function even if the MessageHandler does not receive messages. The Operation's End method exploits this.

Returns:
Errors: - Scope: protected.
See also:
-

Definition at line 678 of file pump.cpp.

00679 {
00680 
00681     MessageHandlerList* CurrentMessageHandlerList 
00682         = (MessageHandlerList*)MessageHandlerClassList.GetHead(); 
00683 
00684     while (CurrentMessageHandlerList != NULL)
00685     {
00686             // The MessageHandler could be on this list
00687         if ((CurrentMessageHandlerList->m_List.FindPosition(MessageHandlerToRemove)) >= 0) // yuk
00688         {
00689             // The message handler is on the list
00690             CurrentMessageHandlerList->m_List.RemoveItem(MessageHandlerToRemove); 
00691             break; 
00692 
00693         }
00694         CurrentMessageHandlerList = (MessageHandlerList*)
00695             (MessageHandlerClassList.GetNext(CurrentMessageHandlerList)); 
00696     }   
00697 }


Member Data Documentation

List MessageHandler::MessageHandlerClassList [static, protected]
 

Definition at line 223 of file pump.h.

BOOL MessageHandler::PostDeath = FALSE [static, protected]
 

Definition at line 227 of file pump.h.

Msg * MessageHandler::pTmpMsg [static]
 

Definition at line 183 of file pump.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:56:11 2007 for Camelot by  doxygen 1.4.4