/*  
 *    SCCS ID: %Z%%M% %I% %E% SST
 *
 *    Copyright (c) 1992-1993 Mark Soloway.  All rights reserved.
 *    See SST_LEGAL_NOTICE file for terms of the license. 
 */  
  
#ifndef _TREE_DISPLAYER_CHILD_ADDED_MESSAGE_H
#define _TREE_DISPLAYER_CHILD_ADDED_MESSAGE_H

#include "TreeDisplayer_consts.h"
#include "TTObjectSpec.h"
#include "TTMessage.h"

class TreeDisplayerChildAddedMessage : public TTMessage {
public:
  TreeDisplayerChildAddedMessage (Tt_status &status) :
    TTMessage (TREE_DISPLAYER_OP_CHILD_ADDED,
	       TT_NOTICE,
	       TT_FILE,
	       status)
    {
      if (status == TT_OK) {
        (void)addArg (TT_IN, "objid", (const char *)NULL);
        status = addArg (TT_IN, "objid", (const char *)NULL);
      }
    }

  ~TreeDisplayerChildAddedMessage () {}

  Tt_status setParentNode (const char *parent_node_id)
    {
      return setArgValue (0, parent_node_id);
    }

  Tt_status setParentNode (const TTObjectSpec &parent_node)
    {
      Tt_status status; 
 
      char *objid = parent_node.getID (status); 
      if (status < TT_WRN_LAST) { 
        status = setArgValue (0, objid); 
      }   
 
      return status; 
    }

  Tt_status setChildNode (const char *child_node_id)
    {
      return setArgValue (1, child_node_id);
    }

  Tt_status setChildNode (const TTObjectSpec &child_node)
    {
      Tt_status status;

      char *objid = child_node.getID (status);
      if (status < TT_WRN_LAST) {
        status = setArgValue (1, objid);
      }  

      return status;
    }
};

#endif
