summaryrefslogtreecommitdiff
path: root/atk/atkdocument.c
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2013-11-28 17:03:53 +0100
committerAlejandro Piñeiro <apinheiro@igalia.com>2013-11-28 19:02:49 +0100
commitfaeb56936d97eaef6791fc9fd72fbe1f44558e92 (patch)
tree5451ef7871753d5fbf4dc3b5d7a9cb64dc2e0326 /atk/atkdocument.c
parente520bacef46797cf5ec93304b884bb39aec852af (diff)
downloadatk-faeb56936d97eaef6791fc9fd72fbe1f44558e92.tar.gz
atkdocument: add get_current_page_number() and get_page_count() methods
https://bugzilla.gnome.org/show_bug.cgi?id=709214
Diffstat (limited to 'atk/atkdocument.c')
-rwxr-xr-xatk/atkdocument.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/atk/atkdocument.c b/atk/atkdocument.c
index f1515bb..c975132 100755
--- a/atk/atkdocument.c
+++ b/atk/atkdocument.c
@@ -360,3 +360,59 @@ atk_document_set_attribute_value (AtkDocument *document,
return FALSE;
}
}
+
+/**
+ * atk_document_get_current_page_number:
+ * @document: the #AtkDocument
+ *
+ * Since: 2.12
+ *
+ * Returns: current page number inside @document. -1 if not
+ * implemented, not know by the implementor or irrelevant.
+ */
+gint
+atk_document_get_current_page_number (AtkDocument *document)
+{
+ AtkDocumentIface *iface;
+
+ g_return_val_if_fail (ATK_IS_DOCUMENT (document), FALSE);
+
+ iface = ATK_DOCUMENT_GET_IFACE (document);
+
+ if (iface->get_current_page_number)
+ {
+ return (iface->get_current_page_number) (document);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+/**
+ * atk_document_get_page_count:
+ * @document: the #AtkDocument
+ *
+ * Since: 2.12
+ *
+ * Returns: total page count of @document. -1 if not implemented, not
+ * know by the implementor or irrelevant.
+ */
+gint
+atk_document_get_page_count (AtkDocument *document)
+{
+ AtkDocumentIface *iface;
+
+ g_return_val_if_fail (ATK_IS_DOCUMENT (document), FALSE);
+
+ iface = ATK_DOCUMENT_GET_IFACE (document);
+
+ if (iface->get_page_count)
+ {
+ return (iface->get_page_count) (document);
+ }
+ else
+ {
+ return -1;
+ }
+}