### ICnrEditHandler

  The ICnrEditHandler class supports direct editing of data in the container.

  Create a handler derived from ICnrEditHandler and attach it to the container whose data is to be edited. You can do this by calling ICnrEditHandler::handleEventsFor to pass the container or the container's owner window to the container edit handler.

  ICnrEditHandler processes the following events from the container:

  - Begin direct editing (see ICnrBeginEditEvent)
  - End direct editing (see ICnrEndEditEvent)
  - Reallocate storage for edited data (see ICnrReallocStringEvent)

  When the container edit handler receives one of these container edit events, it creates a corresponding event object and routes that object to the appropriate ICnrEditHandler virtual function. You must override these virtual functions to supply your own specialized processing of a container edit event. Note that when overriding beginEdit, you must call the base class function ICnrEditHandler::beginEdit before adding your own behavior. If you override endEdit, you must call the base class function ICnrEditHandler::endEdit after you complete your processing.

  The return value from the virtual functions specifies whether the container edit event should be passed on for additional processing, as follows:

  Return Value :ddhd.Meaning
  true
    The container edit event requires no additional processing. Do not pass it to another handler.
  false
    Pass the container edit event to the next handler for additional processing, as follows:
    - If there is another handler for the container, pass the container edit event to the next handler.
    - If this is the last handler for the container, call IWindow::dispatch to dispatch the container edit event to the container's owner window.
    - If this is the last handler for the owner window, call IWindow::defaultProcedure to process the container edit event.

### ICnrEditHandler - Member Functions and Data by Group

### Constructors & Destructor

You can construct and destruct objects of this class.

~ICnrEditHandler

      public:
      virtual ~ICnrEditHandler()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

ICnrEditHandler

      public:
      ICnrEditHandler(StringType stringType = isIString)

  You can only construct instances of this class by providing the type of the user data that needs to be edited. The data can be one of the types specified by the StringType enumeration.

  The default behavior of this class provides for the reallocation of the user data. The default behavior of this class also manages the allocation of other types of editable data, such as the following:

  - Icon text
  - Container title
  - Details view column headings

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Event Dispatching

Use these members to implement the class.

handleEventsFor

      public:
      virtual ICnrEditHandler&
        handleEventsFor( IContainerControl* container )

  Attaches the handler to the specified container control.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

stopHandlingEventsFor

      public:
      virtual ICnrEditHandler&
        stopHandlingEventsFor( IContainerControl* container )

  Detaches the handler from the specified container control.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

dispatchHandlerEvent

      protected:
      virtual bool dispatchHandlerEvent(IEvent& event)

  If a container edit event is found, the appropriate event processing virtual function is called.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Event Processing

Event-processing members must be supplied by a derived class to provide additional processing for an edit event.

beginEdit

      public:
      virtual bool beginEdit(ICnrBeginEditEvent& event)

  Called when an edit window has been opened in the container. The default behavior creates an IMultiLineEdit object by calling ICnrEditHandler::multiLineEdit. If ICnrEditHandler::setMLEHandler has been previously called to store an edit handler, the handler is added to the IMultiLineEdit object.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

endEdit

      public:
      virtual bool endEdit(ICnrEndEditEvent& event)

  Called when editing has ended. This is received after reallocateString is called.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

isDataIString

      public:
      bool isDataIString() const

  If the user data is type IString, true is returned.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

reallocateString

      public:
      virtual bool
        reallocateString( ICnrReallocStringEvent& event )

  Called when text has been modified in the container and storage needs to be reallocated. If the data is an IString, the reallocation is provided by calling ICnrReallocStringEvent::reallocateString. If the data is of the type isCharacterPointer, the reallocation is provided by calling ICnrReallocStringEvent::reallocateText.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Multiline Edit Processing

Use these members to enable processing of events to the container's edit field.

mleHandler

      public:
      IHandler* mleHandler() const

  Called to return the handler for a multiline entry field. If a handler has not been provided, 0 is returned.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

multiLineEdit

      public:
      virtual IMultiLineEdit*
        multiLineEdit( const IWindowHandle& handleMultiLineEdit )

  Called to return an IMultiLineEdit "wrapper." You can override this function to specialize the edit control.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Ignored

setMLEHandler

      public:
      virtual void setMLEHandler(IHandler* anMLEHandler)

  Stores a handler to be added to the IMultiLineEdit control when that control is created.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### ICnrEditHandler - Enumerations

StringType

      enum StringType { isIString,
                        isCharacterPointer }

  Enumeration identifying the type of user data in the details view of the container:

  isIString
    The data is an IString object.
  isCharacterPointer
    The data is a pointer to a character (char*).

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### ICnrEditHandler - Inherited Member Functions and Data

#### Inherited Public Functions

  IHandler

  -     virtual ~IHandler()

  -     virtual IString asDebugInfo() const

  -     virtual IString asString() const

  -     virtual IHandler& disable()

  -     virtual IHandler& enable(bool enable = true)

  -     IHandler()

  -     bool isEnabled() const

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IHandler

  -     virtual IEventResult defaultProcedure(IEvent& event)

  -     virtual bool dispatchHandlerEvent(IEvent& event) = 0

#### Inherited Protected Data

  - None