home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IFRAMHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
9KB
|
136 lines
#ifndef _IFRAMHDR_
#define _IFRAMHDR_
/*******************************************************************************
* FILE NAME: iframhdr.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IFrameHandler - Frame window event handler. *
* *
* 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
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class IFrameWindow;
class IFrameEvent;
class ICommandEvent;
class IFrameFormatEvent;
class IFrameHandler : public IHandler {
typedef IHandler
Inherited;
/*******************************************************************************
* The IFrameHandler class adds its objects to IFrameWindows to handle frame *
* window events related to maintenance of frame extensions. An instance is *
* created and added to the frame at construction, usually, by the *
* IFrameWindow::start member function. This function is called when the *
* frame is created using IFrameWindow::create, IFrameWindow::tryToLoadDialog, *
* or IFrameWindow::initialize. *
* *
* If the frame is constructed using some alternate means (for example, by a *
* subclass of IFrameWindow) and IFrameWindow::start is not called, then an *
* instance of this handler class should be created and added through another *
* means. In many such cases, an instance of some derived class is actually *
* added as a handler. *
*******************************************************************************/
public:
IFrameHandler ( );
~IFrameHandler ( );
/*------------------------------ Event Handling --------------------------------
| This function is called to handle frame-specific window events. Derived |
| classes should override this to change the handler functionality. |
| numberOfExtensions - Returns the number of frame extensions that the |
| argument frame window possesses. This number is |
| also the number of elements in the collection that |
| is returned by the frame's IFrameWindow::extensions. |
| These functions are passed by an IFrameEvent that provides an argument |
| value and in which an event result can be set. Each has a Boolean return |
| type that indicates whether an additional handler should be dispatched. |
| format - Fills in an array of window position structures, one for |
| each frame control. This function does this for the frame |
| extensions that have been added to the frame using |
| IFrameWindow::addExtension. Derived class implementations |
| usually will call their inherited version, format their |
| controls, and finally return true (so that the standard |
| frame controls are not formatted again). |
| closed - Called when the frame window is closed. This function |
| queries whether the frame is modal and dismisses it, if so. |
| It then queries the state of the destroyOnClose flag |
| maintained by the IFrameWindow and destroys the |
| Presentation Manager window if this flag is on. Else, an |
| SC_CLOSE systemCommand is posted to the client, if there is |
| a client. True is always returned. |
| activated - Called when the frame window is activated. This function |
| does not take any action. Derived classes, however, should |
| implement this function by performing their processing and |
| return false (so that other handlers can act on this event). |
| deactivated - Called when the frame is asked to give up the input focus. |
| This function does not take any action. Derived classes, |
| however, should implement this function by performing their |
| processing and returning false. |
| saved - Called when the application status is to be saved. This |
| function does not take any action and returns false. |
| Derived classes, however, should save the application |
| status and return false (so that other handlers also have a |
| chance to handle this event). |
| draw - Called when the frame window needs to be redrawn. This |
| function draws the separator lines between frame extensions |
| and returns false. Derived classes should invoke the |
| inherited implementation, perform any addition drawing they |
| require, and return false. |
| command - Called when the frame window receives a command event. |
| This function checks to see if the frame has a client. If |
| so, it returns false (so the client can receive the event). |
| Otherwise, it returns true. |
| calcRect - Called when the frame window is asked to calculate the |
| size of the client rectangle given a frame rectangle or |
| calculate the size of the frame rectangle give a client |
| rectangle. |
------------------------------------------------------------------------------*/
virtual unsigned
numberOfExtensions ( IFrameWindow *pFrame );
virtual Boolean
format ( IFrameFormatEvent &formatEvent ),
closed ( IFrameEvent &frameEvent ),
activated ( IFrameEvent &frameEvent ),
deactivated ( IFrameEvent &frameEvent ),
saved ( IFrameEvent &frameEvent ),
draw ( IFrameEvent &frameEvent ),
command ( ICommandEvent &cmdEvent ),
calcRect ( IFrameEvent &frameEvent );
protected:
/*-------------------------------- Overrides -----------------------------------
| This inherited function is overridden: |
| dispatchHandlerEvent - Intercepts all window events and dispatches |
| frame-specific events to the various handle event |
| functions. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent ( IEvent &anEvent );
private: /*------------------------ PRIVATE ----------------------------------*/
}; // class IFrameHandler
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif // _IFRAMHDR_