home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IPAGEHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
9KB
|
137 lines
#ifndef _IPAGEHDR_
#define _IPAGEHDR_
/*******************************************************************************
* FILE NAME: ipagehdr.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IPageHandler - Process events for a page on an INotebook object. *
* *
* 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 _IPAGEEVT_
#include <ipageevt.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes:
class IEvent;
class INotebookDrawItemEvent;
class IPageHandler : public IHandler {
typedef IHandler
Inherited;
/*******************************************************************************
* The IPageHandler class handles the processing of page change events for the *
* INotebook class. *
* *
* The IPageHandler class is designed to handle events resulting from a user *
* interacting with a notebook page. An IPageHandler object can be used to *
* handle page events for a notebook by either being added to the notebook *
* itself or to the owner window of the notebook. This is done by either *
* passing the notebook or owner window to the handleEventsFor function of the *
* IPageHandler object. *
* *
* When it receives a page event, the IPageHandler object creates the *
* appropriate event object and routes it to the appropriate virtual function. *
* You can override the virtual functions of the IPageHandler to supply your *
* own specialized processing of an event. The return values from the virtual *
* functions specify whether the page event should be passed on to another *
* handler object to be processed, as follows: *
* *
* Value Meaning *
* --------------- *
* true - The page event requires no additional processing and should not *
* be passed to another handler. *
* false - The page event should be passed to the next handler, as follows: *
* -- If there is another handler for the notebook or owner window, *
* the event is passed on to the next handler. *
* -- If this is the last handler for the notebook, the event is *
* dispatched to the owner window of the notebook. (See *
* IWindow::dispatch.) *
* -- If this is the last handler for the owner window, the event is *
* passed on a call to the owner window's defaultProcedure *
* function. (See IWindow::defaultProcedure.) *
* *
* Example: *
* MyWindow::MyWindow() *
* : ... *
* { *
* MyPageHandler* pgh = new MyPageHandler(); *
* ... *
* INotebook* pnbk = new INotebook(ID_NB, this, this, IRectangle(...)); *
* pgh->handleEventsFor(pnbk); *
* ... *
* show(); *
* } *
* Boolean MyPageHandler::select(IPageEvent& evt) *
* { *
* Boolean bProcessed = false; *
* // do some processing *
* ... *
* return bProcessed; *
* } *
*******************************************************************************/
public:
/*------------------------------- Constructor ----------------------------------
| The only way to construct instances of this class is to use the default |
| constructor, which does not take any arguments. |
------------------------------------------------------------------------------*/
IPageHandler :: IPageHandler ( );
virtual
IPageHandler :: ~IPageHandler ( );
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 appropriate function if a page event is |
| found. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent& evt );
/*----------------------------- Event Processing -------------------------------
| The following functions must be supplied by a derived class to process |
| various notebook page-related events. |
| resize - Implemented by derived classes to process a page size change |
| notification. |
| select - Implemented by derived classes to process the notification that |
| a new page is at the top of the notebook. |
| remove - Implemented by derived classes to process a page deletion |
| notification. |
| help - Implemented by derived classes to process a notification that |
| help has been requested for a notebook page. |
| drawTab - Implemented by derived classes to draw the page tab. |
------------------------------------------------------------------------------*/
virtual Boolean
resize ( IPageEvent &event ),
select ( IPageSelectEvent &event ),
remove ( IPageRemoveEvent &event ),
help ( IPageHelpEvent &event ),
drawTab ( INotebookDrawItemEvent &event );
}; // IPageHandler
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _IPAGEHDR_ */