/*
 *    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 _TT_OBJECT_SPEC_H
#define _TT_OBJECT_SPEC_H

#include <desktop/tt_c.h>

#include "TTGeneric.h"

class TTFile;

class TTObjectSpec : public TTGeneric {
public:
  TTObjectSpec (const char *file, const char *type, Tt_status&);
  TTObjectSpec (const TTFile &file, const char *type, Tt_status&);
  TTObjectSpec (const char *objid, Tt_status&);
  TTObjectSpec (const TTObjectSpec&);
  TTObjectSpec &operator= (const TTObjectSpec&);
  ~TTObjectSpec ();

  int operator== (const TTObjectSpec&) const;
  int operator== (const char *) const;

  char *getID (Tt_status&) const;
  char *getFile (Tt_status&) const;
  char *getOType (Tt_status&) const;
  char *getObjectKey (Tt_status&) const;

  Tt_status createAfterDestroy ();
  Tt_status createAfterDestroy (const char *file, const char *type);
  Tt_status write ();
  Tt_status destroy ();
  Tt_status move (const char *file);
  Tt_status move (const TTFile &file);

  int   getPropertyNameCount (Tt_status&) const;
  char *getPropertyName (int, Tt_status&) const;

  int       getPropertyCount (const char *name, Tt_status&) const;
  Tt_status getProperty (const char *name, int, char*&) const;
  Tt_status getProperty (const char *name, int, unsigned char*&, int&) const;

  Tt_status setProperty (const char *name, const char *);
  Tt_status setProperty (const char *name, const unsigned char *, int);

  Tt_status addProperty (const char *name, const char *);
  Tt_status addProperty (const char *name, const unsigned char *, int);

private:
  char *file;
  char *otype;
  char *objid;

  void  setTTObjectSpecDefaults ();
  void  copy (const TTObjectSpec&);
  void  destroyObject ();
};

#endif
