/************************************************************************/
/* Copyright 1998 MBARI							*/
/************************************************************************/
#ifndef _DMINPUTDETECTOR_H
#define _DMINPUTDETECTOR_H
static char DmInputDetector_h_id[] = "$Header: /u/oreilly/rov/tmacs/RCS/DmInputDetector.h,v 1.4 1998/12/18 21:07:21 oreilly Exp $";

/*
$Log: DmInputDetector.h,v $
Revision 1.4  1998/12/18 21:07:21  oreilly
Added documentation

Revision 1.3  1997/05/07 16:49:29  oreilly
Added comments

 * Revision 1.2  97/03/20  12:33:48  12:33:48  oreilly (Thomas C. O'Reilly)
 * *** empty log message ***
 * 
 * Revision 1.1  96/10/28  09:13:36  09:13:36  oreilly (Thomas C. O'Reilly)
 * Initial revision
 * 
*/


#include "DmGuiObject.h"

/*
CLASS 
DmInputDetector

DESCRIPTION
Monitors a specified DmObject for aperiodic changes;
when changes are detected, DmInputDetector calls the updateFromPeer() 
function of it's specified peer DmGuiObject. DmInputDetector has no 
visible GUI components.

WARNING: Be sure that the peer DmGuiObject's constructor also deletes
the DmInputDetector, so that DmInputDetector doesn't try to call
updateFromPeer() of an invalid (deleted) object.


AUTHOR
Tom O'Reilly
*/
class DmInputDetector : public DmGuiObject
{
  public:
  
  DmInputDetector(const char *name, Widget parent, DmObject *dmObject,
		DmGuiObject *peer);
  
  ~DmInputDetector();

  virtual const char *className()
  {
    return "DmInputDetector";
  }
  
  virtual void updateGui(DM_Item item = 0);

  DmObject *dmObject();
  
  void show()
  {
    // Do nothing; always invisible
    ;
  }

  void enable()
  {
    _enabled = True;
  }
  
  void disable()
  {
    _enabled = False;
  }
  
  
  protected:
  Boolean _enabled;
  DmObject *_dmObject;
};


#endif
