2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2007 IBM Corp.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #include <cspi/spi-private.h>
27 * AccessibleCollection_ref:
28 * @obj: a pointer to the #AccessibleCollection object on which to operate.
30 * Increment the reference count for an #AccessibleCollection object.
34 AccessibleCollection_ref (AccessibleCollection *obj)
36 cspi_object_ref (obj);
40 * AccessibleCollection_unref:
41 * @obj: a pointer to the #Accessible object on which to operate.
43 * Decrement the reference count for an #AccessibleCollection object.
47 AccessibleCollection_unref (AccessibleCollection *obj)
49 cspi_object_unref (obj);
53 * AccessibleCollection_createMatchRule:
54 * @obj: a pointer to the #Accessible object on which to operate.
55 * @states: An #AccessibleStateSet whose states are to be compared with the objects in the collection.
56 * @statematchtype A MatchType which determines the match requirements for the 'states' criterion.
57 * @attributes: An #AccessibleAttributeSet of attributes which should present
58 * in members of a matching set.
59 * @attributematchtype: A MatchType which determines the match requirements for the 'attributes' criterion.
60 * @roles: An #AcceessibleRoleSet specifying the #AccessibleRole values which are to be considered among the match criteria.
61 * @rolematchtype: A MatchType which determines the match requirements for the 'roles' criterion.
62 * @interfaces: A string which represents one or more IDL interface definitions which should be implemented by matching objects.
63 * @interfacematchtype: A MatchType which determines the match requirements for the 'interfaces' criterion.
64 * @invert: If TRUE, the resulting MatchRule will return objects which do NOT match the specified criteria,
65 * instead of those which do; i.e. this parameter "inverts" the sense of the resulting query.
67 * Returns an #AccesibleMatchRule object which encapsulates the specified criteria.
71 AccessibleCollection_createMatchRule (AccessibleCollection *obj,
72 AccessibleStateSet *states,
73 AccessibleCollectionMatchType statematchtype,
74 AccessibleAttributeSet *attributes,
75 AccessibleCollectionMatchType attributematchtype,
76 AccessibleRoleSet *roles,
77 AccessibleCollectionMatchType rolematchtype,
79 AccessibleCollectionMatchType interfacematchtype,
83 Accessibility_AttributeSet *attributeset;
84 Accessibility_RoleSet *roleset;
85 Accessibility_MatchRule retval;
88 cspi_return_val_if_fail (obj != NULL, NULL);
90 attributeset = CORBA_sequence_CORBA_string__alloc ();
91 attributeset->_length = attributes->len;
92 attributeset->_buffer = CORBA_sequence_CORBA_string_allocbuf (attributeset->_length);
94 for (i = 0; i < attributeset->_length; i++)
95 attributeset->_buffer [i] = CORBA_string_dup (attributes->attributes [i]);
97 CORBA_sequence_set_release (attributeset, TRUE);
99 roleset = Accessibility_RoleSet__alloc ();
100 roleset->_length = roles->len;
101 roleset->_buffer = Accessibility_RoleSet_allocbuf (roleset->_length);
103 for (i = 0; i < roleset->_length; i++)
104 roleset->_buffer [i] = roles->roles [i];
106 retval = Accessibility_Collection_createMatchRule (CSPI_OBJREF (obj),
118 cspi_return_val_if_ev ("createMatchRule", NULL);
120 return cspi_object_add (retval);
126 * AccessibleCollection_freeMatchRule:
127 * @obj: a pointer to the #Accessible object on which to operate.
128 * @matchrule: a pointer to the #AccessibleMatchRule to free
130 * Frees the resources associated with the specified #AccessibleMatchRule
134 AccessibleCollection_freeMatchRule (AccessibleCollection *obj,
135 AccessibleMatchRule *matchrule)
138 cspi_return_if_fail (obj != NULL);
140 Accessibility_Collection_freeMatchRule (CSPI_OBJREF (obj),
141 CSPI_OBJREF (matchrule),
144 cspi_return_if_ev ("freeMatchRule");