2008-08-27 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / pyatspi / collection.py
1 #Copyright (C) 2008 Codethink Ltd
2
3 #This library is free software; you can redistribute it and/or
4 #modify it under the terms of the GNU Lesser General Public
5 #License version 2 as published by the Free Software Foundation.
6
7 #This program is distributed in the hope that it will be useful,
8 #but WITHOUT ANY WARRANTY; without even the implied warranty of
9 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 #GNU General Public License for more details.
11 #You should have received a copy of the GNU Lesser General Public License
12 #along with this program; if not, write to the Free Software
13 #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14
15 import interfaces
16 from base import BaseProxy, Enum
17 from factory import add_accessible_class
18
19 __all__ = [
20            "Collection",
21           ]
22
23 #------------------------------------------------------------------------------
24
25 class Collection(BaseProxy):
26     
27     def createMatchRule(self, *args, **kwargs):
28         func = self.get_dbus_method("createMatchRule")
29         return func(*args, **kwargs)
30     
31     def freeMatchRule(self, *args, **kwargs):
32         func = self.get_dbus_method("freeMatchRule")
33         return func(*args, **kwargs)
34     
35     def getActiveDescendant(self, *args, **kwargs):
36         func = self.get_dbus_method("getActiveDescendant")
37         return func(*args, **kwargs)
38     
39     def getMatches(self, *args, **kwargs):
40         func = self.get_dbus_method("getMatches")
41         return func(*args, **kwargs)
42     
43     def getMatchesFrom(self, *args, **kwargs):
44         func = self.get_dbus_method("getMatchesFrom")
45         return func(*args, **kwargs)
46     
47     def getMatchesTo(self, *args, **kwargs):
48         func = self.get_dbus_method("getMatchesTo")
49         return func(*args, **kwargs)
50     
51     def isAncestorOf(self, *args, **kwargs):
52         func = self.get_dbus_method("isAncestorOf")
53         return func(*args, **kwargs)
54     
55     class MatchType(Enum):
56         _enum_lookup = {
57             0:'MATCH_INVALID',
58             1:'MATCH_ALL',
59             2:'MATCH_ANY',
60             3:'MATCH_NONE',
61             4:'MATCH_EMPTY',
62             5:'MATCH_LAST_DEFINED',
63         }
64     
65     MATCH_ALL = MatchType(1)
66     
67     MATCH_ANY = MatchType(2)
68     
69     MATCH_EMPTY = MatchType(4)
70     
71     MATCH_INVALID = MatchType(0)
72     
73     MATCH_LAST_DEFINED = MatchType(5)
74     
75     MATCH_NONE = MatchType(3)
76
77     class SortOrder(Enum):
78         _enum_lookup = {
79             0:'SORT_ORDER_INVALID',
80             1:'SORT_ORDER_CANONICAL',
81             2:'SORT_ORDER_FLOW',
82             3:'SORT_ORDER_TAB',
83             4:'SORT_ORDER_REVERSE_CANONICAL',
84             5:'SORT_ORDER_REVERSE_FLOW',
85             6:'SORT_ORDER_REVERSE_TAB',
86             7:'SORT_ORDER_LAST_DEFINED',
87         }
88     
89     SORT_ORDER_CANONICAL = SortOrder(1)
90     
91     SORT_ORDER_FLOW = SortOrder(2)
92     
93     SORT_ORDER_INVALID = SortOrder(0)
94     
95     SORT_ORDER_LAST_DEFINED = SortOrder(7)
96     
97     SORT_ORDER_REVERSE_CANONICAL = SortOrder(4)
98     
99     SORT_ORDER_REVERSE_FLOW = SortOrder(5)
100     
101     SORT_ORDER_REVERSE_TAB = SortOrder(6)
102     
103     SORT_ORDER_TAB = SortOrder(3)
104
105     class TreeTraversalType(Enum):
106         _enum_lookup = {
107             0:'TREE_RESTRICT_CHILDREN',
108             1:'TREE_RESTRICT_SIBLING',
109             2:'TREE_INORDER',
110             3:'TREE_LAST_DEFINED',
111         }
112     
113     TREE_INORDER = TreeTraversalType(2)
114     
115     TREE_LAST_DEFINED = TreeTraversalType(3)
116     
117     TREE_RESTRICT_CHILDREN = TreeTraversalType(0)
118     
119     TREE_RESTRICT_SIBLING = TreeTraversalType(1)
120
121 # ATTENTION - Register the Application class with the accessible factory.
122 add_accessible_class(interfaces.ATSPI_COLLECTION, Collection)
123
124 #END----------------------------------------------------------------------------