[at-spi2-core] document: add support to current page and page count



commit 250979b71b9a6ec511e0d317e825fad52ee7f9a7
Author: Alejandro Piñeiro <apinheiro igalia com>
Date:   Thu Nov 28 19:28:09 2013 +0100

    document: add support to current page and page count
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719508

 atspi/atspi-document.c |   42 ++++++++++++++++++++++++++++++++++++++++++
 atspi/atspi-document.h |    4 ++++
 xml/Document.xml       |    4 ++++
 3 files changed, 50 insertions(+), 0 deletions(-)
---
diff --git a/atspi/atspi-document.c b/atspi/atspi-document.c
index f95925b..bd3ac4c 100644
--- a/atspi/atspi-document.c
+++ b/atspi/atspi-document.c
@@ -133,6 +133,48 @@ atspi_document_get_document_attributes (AtspiDocument *obj, GError **error)
   return _atspi_dbus_return_hash_from_message (message);
 }
 
+/**
+ * atspi_document_get_page_count:
+ * @obj: a pointer to the #AtspiDocument object to query.
+ *
+ * Gets the page count of an #AccessibleDocument object.
+ *
+ * Returns: a #gint indicating the page count of an
+ * #AccessibleDocument object.
+ **/
+gint
+atspi_document_get_page_count (AtspiDocument *obj, GError **error)
+{
+  dbus_int32_t retval = 0;
+
+  g_return_val_if_fail (obj != NULL, -1);
+
+  _atspi_dbus_get_property (obj, atspi_interface_document, "PageCount", error, "i", &retval);
+
+  return retval;
+}
+
+/**
+ * atspi_document_get_current_page_number:
+ * @obj: a pointer to the #AtspiDocument object to query.
+ *
+ * Gets the current page number of an #AccessibleDocument object.
+ *
+ * Returns: a #gint indicating the current page number in the
+ * #AccessibleDocument object.
+ **/
+gint
+atspi_document_get_current_page_number (AtspiDocument *obj, GError **error)
+{
+  dbus_int32_t retval = 0;
+
+  g_return_val_if_fail (obj != NULL, -1);
+
+  _atspi_dbus_get_property (obj, atspi_interface_document, "CurrentPageNumber", error, "i", &retval);
+
+  return retval;
+}
+
 static void
 atspi_document_base_init (AtspiDocument *klass)
 {
diff --git a/atspi/atspi-document.h b/atspi/atspi-document.h
index cb6f966..f326d89 100644
--- a/atspi/atspi-document.h
+++ b/atspi/atspi-document.h
@@ -59,6 +59,10 @@ GHashTable * atspi_document_get_attributes (AtspiDocument *obj, GError **error);
 
 GHashTable * atspi_document_get_document_attributes (AtspiDocument *obj, GError **error);
 
+gint atspi_document_get_page_count (AtspiDocument *obj, GError **error);
+gint atspi_document_get_current_page_number (AtspiDocument *obj, GError **error);
+
+
 G_END_DECLS
 
 #endif /* _ATSPI_DOCUMENT_H_ */
diff --git a/xml/Document.xml b/xml/Document.xml
index 28b205d..d12a306 100644
--- a/xml/Document.xml
+++ b/xml/Document.xml
@@ -2,6 +2,10 @@
 <node name="/node">
 <interface name="org.a11y.atspi.Document">
 
+  <property name="CurrentPageNumber" type="i" access="read"/>
+
+  <property name="PageCount" type="i" access="read"/>
+
   <method name="GetLocale">
     <arg direction="out" type="s"/>
   </method>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]