atspi_action_do_action_name: change parameter type
[platform/upstream/at-spi2-core.git] / atspi / atspi-action.c
index 7e498e9..ccf05bd 100644 (file)
@@ -44,7 +44,7 @@ atspi_action_get_n_actions (AtspiAction *obj, GError **error)
 }
 
 /**
- * atspi_action_get_description:
+ * atspi_action_get_description: (rename-to atspi_action_get_action_description)
  * @obj: a pointer to the #AtspiAction implementor to query.
  * @i: an integer indicating which action to query.
  *
@@ -52,10 +52,28 @@ atspi_action_get_n_actions (AtspiAction *obj, GError **error)
  *      object implementing #AtspiAction.
  *
  * Returns: a UTF-8 string describing the '@i-th' invocable action.
+ *
+ * Deprecated: 2.10: Use atspi_action_get_action_description instead.
  **/
 gchar *
 atspi_action_get_description (AtspiAction *obj, int i, GError **error)
 {
+  return atspi_action_get_action_description (obj, i, error);
+}
+
+/**
+ * atspi_action_get_action_description:
+ * @obj: a pointer to the #AtspiAction implementor to query.
+ * @i: an integer indicating which action to query.
+ *
+ * Get the description of '@i-th' action invocable on an
+ *      object implementing #AtspiAction.
+ *
+ * Returns: a UTF-8 string describing the '@i-th' invocable action.
+ **/
+gchar *
+atspi_action_get_action_description (AtspiAction *obj, int i, GError **error)
+{
   dbus_int32_t d_i = i;
   char *retval = NULL;
 
@@ -110,7 +128,7 @@ atspi_action_get_key_binding (AtspiAction *obj, gint i, GError **error)
 }
 
 /**
- * atspi_action_get_name:
+ * atspi_action_get_name: (rename-to atspi_action_get_action_name)
  * @obj: a pointer to the #AtspiAction implementor to query.
  * @i: an integer indicating which action to query.
  *
@@ -118,10 +136,28 @@ atspi_action_get_key_binding (AtspiAction *obj, gint i, GError **error)
  *      object implementing #AtspiAction.
  *
  * Returns: the non-localized name of the action, as a UTF-8 string.
+ *
+ * Deprecated: 2.10: Use atspi_action_get_action_name instead.
  **/
 gchar *
 atspi_action_get_name (AtspiAction *obj, gint i, GError **error)
 {
+  return atspi_action_get_action_name (obj, i, error);
+}
+
+/**
+ * atspi_action_get_action_name:
+ * @obj: a pointer to the #AtspiAction implementor to query.
+ * @i: an integer indicating which action to query.
+ *
+ * Get the name of the '@i-th' action invocable on an
+ *      object implementing #AtspiAction.
+ *
+ * Returns: the non-localized name of the action, as a UTF-8 string.
+ **/
+gchar *
+atspi_action_get_action_name (AtspiAction *obj, gint i, GError **error)
+{
   dbus_int32_t d_i = i;
   char *retval = NULL;
 
@@ -178,6 +214,28 @@ atspi_action_do_action (AtspiAction *obj, gint i, GError **error)
   return retval;
 }
 
+/**
+ * atspi_action_do_action_name:
+ * @obj: a pointer to the #AtspiAction to query.
+ * @name: a action name specifying which action to invoke.
+ *
+ * Invoke the action indicated by name.
+ *
+ * Returns: #TRUE if the action is successfully invoked, otherwise #FALSE.
+ **/
+gboolean
+atspi_action_do_action_name (AtspiAction *obj, const gchar *name, GError **error)
+{
+  const char *action_name = name;
+  dbus_bool_t retval = FALSE;
+
+  g_return_val_if_fail (obj != NULL, FALSE);
+
+  _atspi_dbus_call (obj, atspi_interface_action, "DoActionName", error, "s=>b", action_name, &retval);
+
+  return retval;
+}
+
 static void
 atspi_action_base_init (AtspiAction *klass)
 {