home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ICMDHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
6KB
|
100 lines
#ifndef _ICMDHDR_
#define _ICMDHDR_
/*******************************************************************************
* FILE NAME: icmdhdr.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* ICommandHandler - Process an application or system command event. *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*******************************************************************************/
#ifndef _IHANDLER_
#include <ihandler.hpp>
#endif
#ifndef _ICMDEVT_
#include <icmdevt.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes:
class IEvent;
class ICommandHandler : public IHandler {
typedef IHandler
Inherited;
/*******************************************************************************
* Instances of the ICommandHandler class process application and system *
* command events. This handler should be attached to the client window, the *
* frame window (note, however, that a canvas that is the client area window *
* will not cause application commands to be dispatched to the frame window), *
* or to another appropriate window, such as the owner window of a push button. *
* You can do this by passing the appropriate window on the handleEventsFor *
* function of the ICommandHandler object. *
* *
* When it receives a command event, the ICommandHandler object creates an *
* ICommandEvent object and routes it to the appropriate virtual function. You *
* should override the virtual functions of ICommandHandler to supply your own *
* specialized processing of an event. The return value from the virtual *
* functions specifies whether the ICommandEvent should be passed on for *
* additional processing, as described below: *
* *
* Value Meaning *
* --------------- *
* true - The ICommandEvent requires no additional processing. *
* false - The ICommandEvent should be passed on for additional processing: *
* -- if there is another handler for the window, the event is passed *
* on to the next handler *
* -- if this is the last handler for the window, the event is passed *
* on a call to the window's defaultProcedure function *
*******************************************************************************/
public:
/*-------------------------- Constructor/Destructor ----------------------------
| The only way to construct instances of this class is to use the default |
| constructor, which does not take any arguments. |
------------------------------------------------------------------------------*/
ICommandHandler ( );
virtual
~ICommandHandler ( );
protected:
/*---------------------------- Event Dispatching -------------------------------
| This function evaluates the event to determine if it is appropriate for |
| this handler object to process. If it is, this function calls the virtual |
| function used to process the event. |
| dispatchHandlerEvent - Calls the command or systemCommand function if a |
| command event is found. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent& event );
/*----------------------------- Event Processing -------------------------------
| These functions must be supplied by a derived class to process an |
| application or system command event. |
| command - Implemented by derived classes to handle application |
| command events. |
| systemCommand - Implemented by derived classes to handle the system |
| command events. |
------------------------------------------------------------------------------*/
virtual Boolean
command ( ICommandEvent& event ),
systemCommand ( ICommandEvent& event );
}; // ICommandHandler
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _ICMDHDR_ */