Back to index

tetex-bin  3.0
Public Member Functions | Static Public Member Functions | Private Attributes
LinkGoToR Class Reference

#include <Link.h>

Inheritance diagram for LinkGoToR:
Inheritance graph
[legend]
Collaboration diagram for LinkGoToR:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LinkGoToR (Object *fileSpecObj, Object *destObj)
virtual ~LinkGoToR ()
virtual GBool isOk ()
virtual LinkActionKind getKind ()
GStringgetFileName ()
LinkDestgetDest ()
GStringgetNamedDest ()

Static Public Member Functions

static LinkActionparseDest (Object *obj)
static LinkActionparseAction (Object *obj, GString *baseURI=NULL)
static GStringgetFileSpecName (Object *fileSpecObj)

Private Attributes

GStringfileName
LinkDestdest
GStringnamedDest

Detailed Description

Definition at line 153 of file Link.h.


Constructor & Destructor Documentation

LinkGoToR::LinkGoToR ( Object fileSpecObj,
Object destObj 
)

Definition at line 397 of file Link.cc.

                                                         {
  dest = NULL;
  namedDest = NULL;

  // get file name
  fileName = getFileSpecName(fileSpecObj);

  // named destination
  if (destObj->isName()) {
    namedDest = new GString(destObj->getName());
  } else if (destObj->isString()) {
    namedDest = destObj->getString()->copy();

  // destination dictionary
  } else if (destObj->isArray()) {
    dest = new LinkDest(destObj->getArray());
    if (!dest->isOk()) {
      delete dest;
      dest = NULL;
    }

  // error
  } else {
    error(-1, "Illegal annotation destination");
  }
}

Here is the call graph for this function:

LinkGoToR::~LinkGoToR ( ) [virtual]

Definition at line 424 of file Link.cc.

                      {
  if (fileName)
    delete fileName;
  if (dest)
    delete dest;
  if (namedDest)
    delete namedDest;
}

Member Function Documentation

Definition at line 169 of file Link.h.

{ return dest; }

Definition at line 168 of file Link.h.

{ return fileName; }
GString * LinkAction::getFileSpecName ( Object fileSpecObj) [static, inherited]

Definition at line 108 of file Link.cc.

                                                        {
  GString *name;
  Object obj1;

  name = NULL;

  // string
  if (fileSpecObj->isString()) {
    name = fileSpecObj->getString()->copy();

  // dictionary
  } else if (fileSpecObj->isDict()) {
    if (!fileSpecObj->dictLookup("Unix", &obj1)->isString()) {
      obj1.free();
      fileSpecObj->dictLookup("F", &obj1);
    }
    if (obj1.isString())
      name = obj1.getString()->copy();
    else
      error(-1, "Illegal file spec in link");
    obj1.free();

  // error
  } else {
    error(-1, "Illegal file spec in link");
  }

  return name;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual LinkActionKind LinkGoToR::getKind ( ) [inline, virtual]

Implements LinkAction.

Definition at line 167 of file Link.h.

{ return actionGoToR; }

Definition at line 170 of file Link.h.

{ return namedDest; }
virtual GBool LinkGoToR::isOk ( ) [inline, virtual]

Implements LinkAction.

Definition at line 164 of file Link.h.

{ return fileName && (dest || namedDest); }
LinkAction * LinkAction::parseAction ( Object obj,
GString baseURI = NULL 
) [static, inherited]

Definition at line 40 of file Link.cc.

                                                                 {
  LinkAction *action;
  Object obj2, obj3, obj4;

  if (!obj->isDict()) {
    error(-1, "Bad annotation action");
    return NULL;
  }

  obj->dictLookup("S", &obj2);

  // GoTo action
  if (obj2.isName("GoTo")) {
    obj->dictLookup("D", &obj3);
    action = new LinkGoTo(&obj3);
    obj3.free();

  // GoToR action
  } else if (obj2.isName("GoToR")) {
    obj->dictLookup("F", &obj3);
    obj->dictLookup("D", &obj4);
    action = new LinkGoToR(&obj3, &obj4);
    obj3.free();
    obj4.free();

  // Launch action
  } else if (obj2.isName("Launch")) {
    action = new LinkLaunch(obj);

  // URI action
  } else if (obj2.isName("URI")) {
    obj->dictLookup("URI", &obj3);
    action = new LinkURI(&obj3, baseURI);
    obj3.free();

  // Named action
  } else if (obj2.isName("Named")) {
    obj->dictLookup("N", &obj3);
    action = new LinkNamed(&obj3);
    obj3.free();

  // Movie action
  } else if (obj2.isName("Movie")) {
    obj->dictLookupNF("Annot", &obj3);
    obj->dictLookup("T", &obj4);
    action = new LinkMovie(&obj3, &obj4);
    obj3.free();
    obj4.free();

  // unknown action
  } else if (obj2.isName()) {
    action = new LinkUnknown(obj2.getName());

  // action is missing or wrong type
  } else {
    error(-1, "Bad annotation action");
    action = NULL;
  }

  obj2.free();

  if (action && !action->isOk()) {
    delete action;
    return NULL;
  }
  return action;
}

Here is the call graph for this function:

Here is the caller graph for this function:

LinkAction * LinkAction::parseDest ( Object obj) [static, inherited]

Definition at line 29 of file Link.cc.

                                             {
  LinkAction *action;

  action = new LinkGoTo(obj);
  if (!action->isOk()) {
    delete action;
    return NULL;
  }
  return action;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 175 of file Link.h.

Definition at line 174 of file Link.h.

Definition at line 177 of file Link.h.


The documentation for this class was generated from the following files: