===== Released 1.1.4 =====
[atk.git] / atk / atkdocument.c
blob564a403fcaf34c0cc51f4fe320168f8838327cd0
1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #include "atkdocument.h"
22 GType
23 atk_document_get_type ()
25 static GType type = 0;
27 if (!type) {
28 static const GTypeInfo tinfo =
30 sizeof (AtkDocumentIface),
31 (GBaseInitFunc) NULL,
32 (GBaseFinalizeFunc) NULL,
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkDocument", &tinfo, 0);
39 return type;
42 /**
43 * atk_document_get_document_type:
44 * @document: a #GObject instance that implements AtkDocumentIface
46 * Gets a string indicating the document type.
48 * Returns: a string indicating the document type
49 **/
50 G_CONST_RETURN gchar*
51 atk_document_get_document_type (AtkDocument *document)
53 AtkDocumentIface *iface;
55 g_return_val_if_fail (ATK_IS_DOCUMENT (document), NULL);
57 iface = ATK_DOCUMENT_GET_IFACE (document);
59 if (iface->get_document_type)
61 return (iface->get_document_type) (document);
63 else
65 return NULL;
69 /**
70 * atk_document_get_document:
71 * @document: a #GObject instance that implements AtkDocumentIface
73 * Gets a %gpointer that points to an instance of the DOM. It is
74 * up to the caller to check atk_document_get_type to determine
75 * how to cast this pointer.
77 * Returns: a %gpointer that points to an instance of the DOM.
78 **/
79 gpointer
80 atk_document_get_document (AtkDocument *document)
82 AtkDocumentIface *iface;
84 g_return_val_if_fail (ATK_IS_DOCUMENT (document), NULL);
86 iface = ATK_DOCUMENT_GET_IFACE (document);
88 if (iface->get_document)
90 return (iface->get_document) (document);
92 else
94 return NULL;