[TIZEN] Introduce atspi_collection_get_matches_in_matches API.
[platform/upstream/at-spi2-core.git] / atspi / atspi-collection.c
index 5a44100..d7ef6ac 100644 (file)
@@ -260,6 +260,61 @@ atspi_collection_get_matches_from (AtspiCollection *collection,
   return return_accessibles (reply);
 }
 
+//TIZEN_ONLY(20231130): Introduce atspi_collection_get_matches_in_matches API.
+/**
+ * atspi_collection_get_matches_in_matches:
+ * @collection: A pointer to the #AtspiCollection to query.
+ * @first_rule: An #AtspiMatchRule describing the initial match criteria.
+ * @second_rule: An #AtspiMatchRule describing additional match criteria.
+ * @sortby: An #AtspiCollectionSortOrder specifying the way the results are to
+ *          be sorted.
+ * @first_count: The maximum number of results to return for the initial match, or 0 for no limit.
+ * @second_count: The maximum number of results to return for the additional match, or 0 for no limit.
+ * @traverse: Not supported.
+ *
+ * Gets all #AtspiAccessible objects from the @collection that match both the @first_rule and @second_rule (if provided).
+ *
+ * Returns: (element-type AtspiAccessible*) (transfer full): All
+ *          #AtspiAccessible objects matching the given match both rules.
+ **/
+GArray *
+atspi_collection_get_matches_in_matches (AtspiCollection *collection,
+                                         AtspiMatchRule *first_rule,
+                                         AtspiMatchRule *second_rule,
+                                         AtspiCollectionSortOrder sortby,
+                                         gint first_count,
+                                         gint second_count,
+                                         gboolean traverse,
+                                         GError **error)
+{
+  DBusMessage *message = new_message (collection, "GetMatchesInMatches");
+  DBusMessage *reply;
+  dbus_int32_t d_sortby = sortby;
+  dbus_int32_t d_count1 = first_count;
+  dbus_int32_t d_count2 = second_count;
+  dbus_bool_t d_traverse = traverse;
+
+  if (!message)
+    return NULL;
+
+  if (!append_match_rule (message, first_rule))
+    return NULL;
+
+  if (!append_match_rule (message, second_rule))
+    return NULL;
+
+  dbus_message_append_args (message, DBUS_TYPE_UINT32, &d_sortby,
+                            DBUS_TYPE_INT32, &d_count1,
+                            DBUS_TYPE_INT32, &d_count2,
+                            DBUS_TYPE_BOOLEAN, &d_traverse,
+                            DBUS_TYPE_INVALID);
+  reply = _atspi_dbus_send_with_reply_and_block (message, error);
+  if (!reply)
+    return NULL;
+  return return_accessibles (reply);
+}
+//
+
 /**
  * atspi_collection_get_active_descendant:
  *