home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ICNREEVT_
- #define _ICNREEVT_
- /*******************************************************************************
- * FILE NAME: icnreevt.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * ICnrBeginEditEvent *
- * ICnrEndEditEvent *
- * ICnrReallocStringEvent *
- * *
- * COPYRIGHT: *
- * (C) Copyright IBM Corporation 1992 *
- * All Rights Reserved *
- * Licensed Materials * Property of IBM *
- * *
- * HISTORY: *
- * $Log: R:/ibmclass/icnr/vcs/icnreevt.hpv $
- //
- // Rev 1.6 26 Oct 1992 00:12:36 BOBLOVE
- //External Beta release
- * *
- *******************************************************************************/
-
- #ifndef _ICNRBEVT_
- #include <icnrbevt.hpp>
- #endif
-
- // Forward Declarations
- class IContainerObject;
- class IContainerControl;
- class IContainerColumn;
-
-
- class ICnrEditEvent : public ICnrEvent
- {
- /*******************************************************************************
- * This class forms the base of the container edit events. *
- *******************************************************************************/
-
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is only one way to construct instances of this class: |
- | 1. From the base IEvent class. |
- ------------------------------------------------------------------------------*/
- ICnrEditEvent(IEvent& cpszevt);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These functions provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | |
- | isTitleWindow - Returns true if the title is being edited. |
- | isLeftDetailsHeading - Returns true if the left details heading is being |
- | edited. |
- | isRightDetailsHeading - Returns true if the right details heading is being |
- | edited. |
- | isDetailsData - Returns true if editing data in a column of the |
- | details view. |
- | isLeftDetails - Returns true if editing the left column of the |
- | details view. |
- | isRightDetails - Returns true if editing the right column of the |
- | details view. |
- | object - Return the object being edited or zero if the edit |
- | is not object related (e.g. title). |
- | column - Returns the column being edited or zero if the edit |
- | is not column related (e.g. title). |
- | container - Returns the container where editing is occurring. |
- ------------------------------------------------------------------------------*/
- Boolean
- isTitleWindow() const,
- isLeftDetailsHeading() const,
- isRightDetailsHeading() const,
- isDetailsData() const,
- isLeftDetails() const,
- isRightDetails() const;
-
- IContainerObject
- *object();
-
- IContainerColumn
- *column();
-
- IContainerControl
- *container();
-
- protected:
- /*----------------------------- IMPLEMENTATION ---------------------------------
- | These functions are used to implement the class: |
- | textRef - Returns a pointer to the current text pointer for BeginEdit |
- | and ReallocString events. Returns a pointer to the new |
- | text pointer for EndEdit. |
- | textSize - Returns the number of bytes in the text string for EndEdit |
- | and ReallocString events otherwise returns zero. |
- ------------------------------------------------------------------------------*/
- char
- **textRef();
-
- unsigned long
- textSize() const;
-
- };
-
-
- class ICnrReallocStringEvent : public ICnrEditEvent
- {
- /*******************************************************************************
- * This class is dispatched when text is edited in the container and it is *
- * necessary to reallocate the storage for the text. *
- *******************************************************************************/
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is only one way to construct instances of this class: |
- | 1. From the base IEvent class. |
- ------------------------------------------------------------------------------*/
- ICnrReallocStringEvent(IEvent& event);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These functions provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | |
- | currentText - Returns the current text stored in the edit field. |
- | newTextSize - Returns the size of storage that needs to be |
- | allocated to store the new text string. |
- ------------------------------------------------------------------------------*/
- virtual IString
- currentText();
-
- long
- newTextSize();
-
- /*------------------------------ TEXT ALLOCATION -------------------------------
- | These functions reallocate the storage for the text field either by updating |
- | an IString or using operator new() for a char*. |
- | |
- | reallocString - Create and store an IString of the appropriate size |
- | to hold the new data. |
- | reallocText - Call operator new() to acquire storage of the appropriate |
- | size to hold the new data. |
- ------------------------------------------------------------------------------*/
- void
- reallocateString();
- void
- reallocateText();
- };
-
-
- class ICnrBeginEditEvent : public ICnrEditEvent
- {
- /*******************************************************************************
- * This class is dispatched when a request is mage to edit text in the *
- * container. *
- *******************************************************************************/
- public:
-
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is only one way to construct instances of this class: |
- | 1. From the base IEvent class. |
- ------------------------------------------------------------------------------*/
- ICnrBeginEditEvent(IEvent& event);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These functions provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | |
- | currentText - Returns the current text stored in the edit field. |
- ------------------------------------------------------------------------------*/
- IString
- currentText();
- };
-
- class ICnrEndEditEvent : public ICnrEditEvent
- {
- /*******************************************************************************
- * This class is dispatched when text editing is complete. *
- *******************************************************************************/
- public:
-
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There is only one way to construct instances of this class: |
- | 1. From the base IEvent class. |
- ------------------------------------------------------------------------------*/
- ICnrEndEditEvent(IEvent& evt);
-
- /*-------------------------------- ACCESSORS -----------------------------------
- | These functions provide means of getting and setting the accessible |
- | attributes of instances of this class: |
- | |
- | newText - Returns the new text stored in the edited field. |
- ------------------------------------------------------------------------------*/
- IString
- newText();
- };
-
-
- /* INLINES */
-
- inline ICnrEditEvent :: ICnrEditEvent(IEvent& cpszevt)
- : ICnrEvent(cpszevt) {}
-
- inline ICnrReallocStringEvent :: ICnrReallocStringEvent(IEvent& cpszevt)
- : ICnrEditEvent(cpszevt) {}
-
- inline ICnrBeginEditEvent :: ICnrBeginEditEvent(IEvent& evt)
- : ICnrEditEvent(evt) {}
-
- inline ICnrEndEditEvent :: ICnrEndEditEvent(IEvent& evt)
- : ICnrEditEvent(evt) {}
-
-
- #endif