GXPS Links

## GXPS Links GXPS Links — XPS Links |

## Synopsis

    #include <libgxps/gxps.h>

                        GXPSLinkTarget;
                        GXPSLink;

    GXPSLinkTarget *    gxps_link_target_copy               (GXPSLinkTarget *target);
    void                gxps_link_target_free               (GXPSLinkTarget *target);
    gboolean            gxps_link_target_is_internal        (GXPSLinkTarget *target);
    const gchar *       gxps_link_target_get_anchor         (GXPSLinkTarget *target);
    const gchar *       gxps_link_target_get_uri            (GXPSLinkTarget *target);

    GXPSLink *          gxps_link_copy                      (GXPSLink *link);
    void                gxps_link_free                      (GXPSLink *link);
    GXPSLinkTarget *    gxps_link_get_target                (GXPSLink *link);
    void                gxps_link_get_area                  (GXPSLink *link,
                                                             cairo_rectangle_t *area);

## Object Hierarchy

      GBoxed
       +----GXPSLinkTarget

      GBoxed
       +----GXPSLink

## 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()`.

## Details

### 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.

### gxps_link_target_copy ()

    GXPSLinkTarget *    gxps_link_target_copy               (GXPSLinkTarget *target);

Creates a copy of a GXPSLinkTarget

`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.

`target` : | a GXPSLinkTarget

### gxps_link_target_is_internal ()

    gboolean            gxps_link_target_is_internal        (GXPSLinkTarget *target);

Gets whether `target` destination is internal or not.

`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.

`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.

`target` : | a GXPSLinkTarget
Returns : | the URI of `target`.

### gxps_link_copy ()

    GXPSLink *          gxps_link_copy                      (GXPSLink *link);

Creates a copy of a GXPSLink.

`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.

`link` : | a GXPSLink

### gxps_link_get_target ()

    GXPSLinkTarget *    gxps_link_get_target                (GXPSLink *link);

Gets the GXPSLinkTarget mapped by `link`.

`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.

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

## See Also

GXPSFile, GXPSPage, GXPSDocumentStructure