Back to index

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

#include <Link.h>

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

List of all members.

Public Member Functions

 LinkUnknown (char *actionA)
virtual ~LinkUnknown ()
virtual GBool isOk ()
virtual LinkActionKind getKind ()
GStringgetAction ()

Static Public Member Functions

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

Private Attributes

GStringaction

Detailed Description

Definition at line 283 of file Link.h.


Constructor & Destructor Documentation

LinkUnknown::LinkUnknown ( char *  actionA)

Definition at line 575 of file Link.cc.

                                      {
  action = new GString(actionA);
}

Definition at line 579 of file Link.cc.

                          {
  delete action;
}

Member Function Documentation

Definition at line 297 of file Link.h.

{ return action; }
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 LinkUnknown::getKind ( ) [inline, virtual]

Implements LinkAction.

Definition at line 296 of file Link.h.

{ return actionUnknown; }
virtual GBool LinkUnknown::isOk ( ) [inline, virtual]

Implements LinkAction.

Definition at line 293 of file Link.h.

{ return action != NULL; }
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 301 of file Link.h.


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