Blame atk/atkhyperlinkimpl.c

Packit Service ef73c4
/* ATK -  Accessibility Toolkit
Packit Service ef73c4
 * Copyright 2006 Sun Microsystems Inc.
Packit Service ef73c4
 *
Packit Service ef73c4
 * This library is free software; you can redistribute it and/or
Packit Service ef73c4
 * modify it under the terms of the GNU Lesser General Public
Packit Service ef73c4
 * License as published by the Free Software Foundation; either
Packit Service ef73c4
 * version 2 of the License, or (at your option) any later version.
Packit Service ef73c4
 *
Packit Service ef73c4
 * This library is distributed in the hope that it will be useful,
Packit Service ef73c4
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service ef73c4
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service ef73c4
 * Lesser General Public License for more details.
Packit Service ef73c4
 *
Packit Service ef73c4
 * You should have received a copy of the GNU Lesser General Public
Packit Service ef73c4
 * License along with this library; if not, write to the
Packit Service ef73c4
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit Service ef73c4
 * Boston, MA 02111-1307, USA.
Packit Service ef73c4
 */
Packit Service ef73c4
Packit Service ef73c4
#include "config.h"
Packit Service ef73c4
Packit Service ef73c4
#include <string.h>
Packit Service ef73c4
#include "atkhyperlinkimpl.h"
Packit Service ef73c4
Packit Service ef73c4
/**
Packit Service ef73c4
 * SECTION:atkhyperlinkimpl
Packit Service ef73c4
 * @Short_description: An interface from which the AtkHyperlink
Packit Service ef73c4
 *  associated with an AtkObject may be obtained.
Packit Service ef73c4
 * @Title:AtkHyperlinImpl
Packit Service ef73c4
 *
Packit Service ef73c4
 * AtkHyperlinkImpl allows AtkObjects to refer to their associated
Packit Service ef73c4
 * AtkHyperlink instance, if one exists.  AtkHyperlinkImpl differs
Packit Service ef73c4
 * from AtkHyperlink in that AtkHyperlinkImpl is an interface, whereas
Packit Service ef73c4
 * AtkHyperlink is a object type.  The AtkHyperlinkImpl interface
Packit Service ef73c4
 * allows a client to query an AtkObject for the availability of an
Packit Service ef73c4
 * associated AtkHyperlink instance, and obtain that instance.  It is
Packit Service ef73c4
 * thus particularly useful in cases where embedded content or inline
Packit Service ef73c4
 * content within a text object is present, since the embedding text
Packit Service ef73c4
 * object implements AtkHypertext and the inline/embedded objects are
Packit Service ef73c4
 * exposed as children which implement AtkHyperlinkImpl, in addition
Packit Service ef73c4
 * to their being obtainable via AtkHypertext:getLink followed by
Packit Service ef73c4
 * AtkHyperlink:getObject.
Packit Service ef73c4
 *
Packit Service ef73c4
 * The AtkHyperlinkImpl interface should be supported by objects
Packit Service ef73c4
 * exposed within the hierarchy as children of an AtkHypertext
Packit Service ef73c4
 * container which correspond to "links" or embedded content within
Packit Service ef73c4
 * the text.  HTML anchors are not, for instance, normally exposed
Packit Service ef73c4
 * this way, but embedded images and components which appear inline in
Packit Service ef73c4
 * the content of a text object are. The AtkHyperlinkIface interface
Packit Service ef73c4
 * allows a means of determining which children are hyperlinks in this
Packit Service ef73c4
 * sense of the word, and for obtaining their corresponding
Packit Service ef73c4
 * AtkHyperlink object, from which the embedding range, URI, etc. can
Packit Service ef73c4
 * be obtained.
Packit Service ef73c4
 *
Packit Service ef73c4
 * To some extent this interface exists because, for historical
Packit Service ef73c4
 * reasons, AtkHyperlink was defined as an object type, not an
Packit Service ef73c4
 * interface.  Thus, in order to interact with AtkObjects via
Packit Service ef73c4
 * AtkHyperlink semantics, a new interface was required.
Packit Service ef73c4
 */
Packit Service ef73c4
Packit Service ef73c4
GType
Packit Service ef73c4
atk_hyperlink_impl_get_type (void)
Packit Service ef73c4
{
Packit Service ef73c4
  static GType type = 0;
Packit Service ef73c4
Packit Service ef73c4
  if (!type) {
Packit Service ef73c4
    GTypeInfo tinfo =
Packit Service ef73c4
    {
Packit Service ef73c4
      sizeof (AtkHyperlinkImplIface),
Packit Service ef73c4
      (GBaseInitFunc) NULL,
Packit Service ef73c4
      (GBaseFinalizeFunc) NULL,
Packit Service ef73c4
Packit Service ef73c4
    };
Packit Service ef73c4
Packit Service ef73c4
    type = g_type_register_static (G_TYPE_INTERFACE, "AtkHyperlinkImpl", &tinfo, 0);
Packit Service ef73c4
  }
Packit Service ef73c4
Packit Service ef73c4
  return type;
Packit Service ef73c4
}
Packit Service ef73c4
Packit Service ef73c4
/**
Packit Service ef73c4
 * atk_hyperlink_impl_get_hyperlink:
Packit Service ef73c4
 * @impl: a #GObject instance that implements AtkHyperlinkImplIface
Packit Service ef73c4
 *
Packit Service ef73c4
 * Gets the hyperlink associated with this object.
Packit Service ef73c4
 *
Packit Service ef73c4
 * Returns: (transfer full):  an AtkHyperlink object which points to this
Packit Service ef73c4
 * implementing AtkObject.
Packit Service ef73c4
 *
Packit Service ef73c4
 * Since: 1.12
Packit Service ef73c4
 **/
Packit Service ef73c4
AtkHyperlink *
Packit Service ef73c4
atk_hyperlink_impl_get_hyperlink (AtkHyperlinkImpl *impl)
Packit Service ef73c4
{
Packit Service ef73c4
  AtkHyperlinkImplIface *iface;
Packit Service ef73c4
Packit Service ef73c4
  g_return_val_if_fail (impl != NULL, NULL);
Packit Service ef73c4
  g_return_val_if_fail (ATK_IS_HYPERLINK_IMPL (impl), NULL);
Packit Service ef73c4
Packit Service ef73c4
  iface = ATK_HYPERLINK_IMPL_GET_IFACE (impl);
Packit Service ef73c4
Packit Service ef73c4
  if (iface->get_hyperlink)
Packit Service ef73c4
    {
Packit Service ef73c4
      return (iface->get_hyperlink) (impl);
Packit Service ef73c4
    }
Packit Service ef73c4
  return NULL;
Packit Service ef73c4
}
Packit Service ef73c4