Back to index

tetex-bin  3.0
Public Member Functions | Static Public Member Functions
LinkAction Class Reference

#include <Link.h>

Inheritance diagram for LinkAction:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~LinkAction ()
virtual GBool isOk ()=0
virtual LinkActionKind getKind ()=0

Static Public Member Functions

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

Detailed Description

Definition at line 38 of file Link.h.


Constructor & Destructor Documentation

virtual LinkAction::~LinkAction ( ) [inline, virtual]

Definition at line 42 of file Link.h.

{}

Member Function Documentation

GString * LinkAction::getFileSpecName ( Object fileSpecObj) [static]

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 LinkAction::getKind ( ) [pure virtual]
virtual GBool LinkAction::isOk ( ) [pure virtual]

Implemented in LinkUnknown, LinkMovie, LinkNamed, LinkURI, LinkLaunch, LinkGoToR, and LinkGoTo.

Here is the caller graph for this function:

LinkAction * LinkAction::parseAction ( Object obj,
GString baseURI = NULL 
) [static]

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]

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:


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