home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IEVENT_
- #define _IEVENT_
- /*******************************************************************************
- * FILE NAME: ievent.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IEvent - The base event information class, used to send & post messages *
- * *
- * 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. *
- * *
- *$Log: R:/ibmclass/ibaseapp/vcs/ievent.hpv $ *
- //
- // Rev 1.23 25 Oct 1992 23:32:34 BOBLOVE
- // Fixed definition errors param2() and erCl
- //
- // Rev 1.22 25 Oct 1992 17:59:50 nunn
- // Brad Broyles changes for external beta
-
- Rev 1.1 01 Jan 1989 12:00:00 LM & KKL
- Initiate code
- Rev 1.2 01 May 1991 12:00:00 KKL
- Combine all dolts into 1 file - modified for better performance
- Rev 1.3 01 Oct 1991 12:00:00 KKL
- Update per R2.0 spec.
- Rev 1.4 17 Jul 1991 12:00:00 KKL
- New event dispatching
- Rev 1.5 21 Oct 1992 16:00:00 WBB
- Amended to match skeleton.hpp
- *******************************************************************************/
- #ifndef _IBASE_
- #include <ibase.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IEvent;
- class IEventResult;
- #if !defined( _IHANDLE_ ) && !defined( I_NO_RELATED_HPP )
- #include <ihandle.hpp>
- #endif
- #if !defined( _IWINDOW_ ) && !defined( I_NO_RELATED_HPP )
- #include <iwindow.hpp>
- #endif
- #if !defined( _IEVTPARM_ ) && !defined( I_NO_RELATED_HPP )
- #include <ievtparm.hpp>
- #endif
- #if !defined( _IEVTRES_ ) && !defined( I_NO_RELATED_HPP )
- #include <ievtres.hpp>
- #endif
-
- class IEvent : public IBase {
- /*******************************************************************************
- * IEvent is the base event information class. Instances of this class can *
- * also be used to send and post messages to message queues. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 3 ways to construct instances of this class: |
- | 1. from an IHandle instance, an event ID, and two instances of IEventParam |
- | 2. from an IWindow instance, an event ID, and two instances of IEventParam |
- | 3. from another instance of IEvent |
- ------------------------------------------------------------------------------*/
- IEvent(IHandle h, unsigned long ulEvtId,
- IEventParam ep1, IEventParam ep2);
- IEvent(IWindow* wnd, unsigned long ulEvtId,
- IEventParam ep1, IEventParam ep2);
- IEvent(const IEvent& evtCopy);
-
- virtual
- ~IEvent() {;}
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These function provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | window - return the IWindow object pointer |
- | handle - return the IHandle object pointer |
- | eventId - return the event ID |
- | param1 - return the first event parameter |
- | param2 - return the second event parameter |
- | result - return the event result |
- | setResult - set the event result |
- ------------------------------------------------------------------------------*/
- IWindow
- *const window() const;
- const IHandle
- &handle() const;
- unsigned long
- eventId() const;
- const IEventParam
- ¶m1() const,
- ¶m2() const;
- IEventResult
- result() const;
- void
- setResult(IEventResult evt);
-
- /*-------------------------------- FUNCTIONS -----------------------------------
- | sendWindow - send the event to the window handle |
- | postQueue - post the event to the message queue handle |
- | postWindow - post the event to the window handle |
- | broadcastPostQueue - broadcast the event by posting it to all threads that |
- | have a message queue handle |
- | broadcastPostWindow - broadcast the event by posting it to all descendants |
- | of the window handle and/or to frame window only |
- | broadcastSendWindow - broadcast the event by posting it to all descendants |
- | of the window handle and/or to frame window only |
- ------------------------------------------------------------------------------*/
- IEventResult
- sendWindow();
- void
- postQueue(),
- postWindow(),
- broadcastPostQueue();
-
- enum BroadcastAttr {toDescendants, toFrameOnly, toFrameDescendants};
-
- void
- broadcastPostWindow(BroadcastAttr b = toDescendants),
- broadcastSendWindow(BroadcastAttr b = toDescendants);
-
- /*-------------------------------- OVERRIDES -----------------------------------
- | This class overrides the following inherited functions: |
- | = - assignment operator |
- ------------------------------------------------------------------------------*/
- IEvent
- &operator=(const IEvent& evtCopy);
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- unsigned long
- makeCommand(BroadcastAttr b);
- IHandle
- hCl;
- unsigned long
- ulClEvtId;
- IEventParam
- epCl1,
- epCl2;
- IEventResult
- erCl;
- }; // IEvent
-
- /*--------------------------------- INLINES ----------------------------------*/
- #ifndef I_NO_INLINES
- #include <ievent.inl>
- #endif
-
- #endif /* _IEVENT_ */