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