GXPS Links: GXPS Reference Manual

## GXPS Links GXPS Links — XPS Links |

## Functions

GXPSLinkTarget * | gxps_link_target_copy ()
void | gxps_link_target_free ()
gboolean | gxps_link_target_is_internal ()
const gchar * | gxps_link_target_get_anchor ()
const gchar * | gxps_link_target_get_uri ()
GXPSLink * | gxps_link_copy ()
void | gxps_link_free ()
GXPSLinkTarget * | gxps_link_get_target ()
void | gxps_link_get_area ()

## Types and Values

| GXPSLinkTarget
| GXPSLink

## Object Hierarchy

        GBoxed
        ├── GXPSLink
        ╰── GXPSLinkTarget

## Includes

    #include <libgxps/gxps.h>

## Description

GXPSLinkTarget is a hyperlink source that can point to a location in any of the documents of the XPS file or to an external document. Internal GXPSLinkTargets have an URI relative to the XPS file, and a named destination represented by an anchor. External GXPSLinkTargets have an absolute URI pointing to a location in another XPS File and might optionally have an anchor. To get the destination pointed by a in internal GXPSLinkTarget you can use `gxps_file_get_document_for_link_target()` to get the document within the file, `gxps_document_get_page_for_anchor()` to get the page within the document, and `gxps_page_get_anchor_destination()` to get the page area.

GXPSLink maps a location in a page to a GXPSLinkTarget. To get the list of link for a page you can use `gxps_page_get_links()`.

## Functions

### gxps_link_target_copy ()

    GXPSLinkTarget *
    gxps_link_target_copy (GXPSLinkTarget *target);

Creates a copy of a GXPSLinkTarget

#### Parameters

target | a GXPSLinkTarget |

#### Returns

a copy of `target` . Free the returned object with `gxps_link_target_free()`

### gxps_link_target_free ()

    void
    gxps_link_target_free (GXPSLinkTarget *target);

Frees a GXPSLinkTarget.

#### Parameters

target | a GXPSLinkTarget |

### gxps_link_target_is_internal ()

    gboolean
    gxps_link_target_is_internal (GXPSLinkTarget *target);

Gets whether `target` destination is internal or not.

#### Parameters

target | a GXPSLinkTarget |

#### Returns

`TRUE` if the GXPSLinkTarget points to an internal location, `FALSE` if it points to a external one.

### gxps_link_target_get_anchor ()

    const gchar *
    gxps_link_target_get_anchor (GXPSLinkTarget *target);

Gets the anchor name `target` links to. If `target` is an internal GXPSLinkTarget this function always returns and anchor, if it is external it might return `NULL` if the `target` does not have an anchor.

#### Parameters

target | a GXPSLinkTarget |

#### Returns

the name of the anchor of `target` .

### gxps_link_target_get_uri ()

    const gchar *
    gxps_link_target_get_uri (GXPSLinkTarget *target);

Gets the URI `target` links to.

#### Parameters

target | a GXPSLinkTarget |

#### Returns

the URI of `target` .

### gxps_link_copy ()

    GXPSLink *
    gxps_link_copy (GXPSLink *link);

Creates a copy of a GXPSLink.

#### Parameters

link | a GXPSLink |

#### Returns

a copy of `link` . Free the returned object with `gxps_link_free()`.

### gxps_link_free ()

    void
    gxps_link_free (GXPSLink *link);

Frees a GXPSLink.

#### Parameters

link | a GXPSLink |

### gxps_link_get_target ()

    GXPSLinkTarget *
    gxps_link_get_target (GXPSLink *link);

Gets the GXPSLinkTarget mapped by `link` .

#### Parameters

link | a GXPSLink |

#### Returns

the GXPSLinkTarget of `link` .

[transfer none]

### gxps_link_get_area ()

    void
    gxps_link_get_area (GXPSLink *link,
                        cairo_rectangle_t *area);

Gets the rectangle of a page where the GXPSLinkTarget mapped by `link` is.

#### Parameters

link | a GXPSLink |
area | return location for page area. | [out]

## Types and Values

### GXPSLinkTarget

    typedef struct _GXPSLinkTarget GXPSLinkTarget;

GXPSLinkTarget represents a hyperlink source.

### GXPSLink

    typedef struct _GXPSLink GXPSLink;

GXPSLink maps a location in a page to a GXPSLinkTarget.

## See Also

GXPSFile, GXPSPage, GXPSDocumentStructure