[l10n] Updated Catalan (Valencian) translation
[platform/upstream/atk.git] / atk / atkdocument.c
old mode 100755 (executable)
new mode 100644 (file)
index bf5cc9a..4e7245a
@@ -17,6 +17,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include "config.h"
+
 #include "atkdocument.h"
 
 /**
@@ -39,6 +41,7 @@ enum {
   LOAD_COMPLETE,
   RELOAD,
   LOAD_STOPPED,
+  PAGE_CHANGED,
   LAST_SIGNAL
 };
 
@@ -133,6 +136,27 @@ atk_document_base_init (AtkDocumentIface *class)
                       g_cclosure_marshal_VOID__VOID,
                       G_TYPE_NONE, 0);
 
+      /**
+       * AtkDocument::page-changed:
+       * @atkdocument: the object on which the signal was emitted
+       * @page_number: the new page number. If this value is unknown
+       * or not applicable, -1 should be provided.
+       *
+       * The 'page-changed' signal is emitted when the current page of
+       * a document changes, e.g. pressing page up/down in a document
+       * viewer.
+       *
+       * Since: 2.12
+       */
+      atk_document_signals[PAGE_CHANGED] =
+        g_signal_new ("page_changed",
+                      ATK_TYPE_DOCUMENT,
+                      G_SIGNAL_RUN_LAST,
+                      0,
+                      (GSignalAccumulator) NULL, NULL,
+                      g_cclosure_marshal_VOID__INT,
+                      G_TYPE_NONE, 1, G_TYPE_INT);
+
       initialized = TRUE;
     }
 }
@@ -143,6 +167,9 @@ atk_document_base_init (AtkDocumentIface *class)
  *
  * Gets a string indicating the document type.
  *
+ * Deprecated: Since 2.12. Please use atk_document_get_attributes() to
+ * ask for the document type if it applies.
+ *
  * Returns: a string indicating the document type
  **/
 const gchar*
@@ -172,6 +199,10 @@ atk_document_get_document_type (AtkDocument *document)
  * up to the caller to check atk_document_get_type to determine
  * how to cast this pointer.
  *
+ * Deprecated: Since 2.12. @document is already a representation of
+ * the document. Use it directly, or one of its children, as an
+ * instance of the DOM.
+ *
  * Returns: (transfer none): a %gpointer that points to an instance of the DOM.
  **/
 gpointer 
@@ -203,13 +234,11 @@ atk_document_get_document (AtkDocument *document)
  *          a different locale, see atk_text_get_attributes and
  *          atk_image_get_image_locale.
  *
- * Deprecated: This method is deprecated since ATK version
- * 2.7.90. Please use atk_object_get_object_locale() instead.
+ * Deprecated: 2.7.90: Please use atk_object_get_object_locale() instead.
  *
  * Returns: a UTF-8 string indicating the POSIX-style LC_MESSAGES
  *          locale of the document content as a whole, or NULL if
  *          the document content does not specify a locale.
- * Virtual: get_document_locale
  **/
 const gchar *
 atk_document_get_locale (AtkDocument *document)
@@ -243,7 +272,6 @@ atk_document_get_locale (AtkDocument *document)
  * Returns: (transfer none): An AtkAttributeSet containing the explicitly
  *          set name-value-pair attributes associated with this document
  *          as a whole.
- * Virtual: get_document_attributes
  **/
 AtkAttributeSet *
 atk_document_get_attributes (AtkDocument *document)
@@ -272,10 +300,9 @@ atk_document_get_attributes (AtkDocument *document)
  *
  * Since: 1.12
  *
- * Returns: a string value associated with the named attribute for this
- *    document, or NULL if a value for #attribute_name has not been specified
- *    for this document.
- * Virtual: get_document_attribute_value
+ * Returns: (nullable): a string value associated with the named
+ *    attribute for this document, or NULL if a value for
+ *    #attribute_name has not been specified for this document.
  */
 const gchar *
 atk_document_get_attribute_value (AtkDocument *document, 
@@ -309,7 +336,6 @@ atk_document_get_attribute_value (AtkDocument *document,
  * Returns: TRUE if #value is successfully associated with #attribute_name
  *          for this document, FALSE otherwise (e.g. if the document does not
  *          allow the attribute to be modified).
- * Virtual: set_document_attribute
  */
 gboolean
 atk_document_set_attribute_value (AtkDocument *document, 
@@ -331,3 +357,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;
+    }
+}