1 #Copyright (C) 2008 Codethink Ltd
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.
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.
16 from base import BaseProxy, Enum
17 from factory import add_accessible_class
23 #------------------------------------------------------------------------------
25 class Collection(BaseProxy):
27 def createMatchRule(self, *args, **kwargs):
28 func = self.get_dbus_method("createMatchRule")
29 return func(*args, **kwargs)
31 def freeMatchRule(self, *args, **kwargs):
32 func = self.get_dbus_method("freeMatchRule")
33 return func(*args, **kwargs)
35 def getActiveDescendant(self, *args, **kwargs):
36 func = self.get_dbus_method("getActiveDescendant")
37 return func(*args, **kwargs)
39 def getMatches(self, *args, **kwargs):
40 func = self.get_dbus_method("getMatches")
41 return func(*args, **kwargs)
43 def getMatchesFrom(self, *args, **kwargs):
44 func = self.get_dbus_method("getMatchesFrom")
45 return func(*args, **kwargs)
47 def getMatchesTo(self, *args, **kwargs):
48 func = self.get_dbus_method("getMatchesTo")
49 return func(*args, **kwargs)
51 def isAncestorOf(self, *args, **kwargs):
52 func = self.get_dbus_method("isAncestorOf")
53 return func(*args, **kwargs)
55 class MatchType(Enum):
62 5:'MATCH_LAST_DEFINED',
65 MATCH_ALL = MatchType(1)
66 MATCH_ANY = MatchType(2)
67 MATCH_EMPTY = MatchType(4)
68 MATCH_INVALID = MatchType(0)
69 MATCH_LAST_DEFINED = MatchType(5)
70 MATCH_NONE = MatchType(3)
72 class SortOrder(Enum):
74 0:'SORT_ORDER_INVALID',
75 1:'SORT_ORDER_CANONICAL',
78 4:'SORT_ORDER_REVERSE_CANONICAL',
79 5:'SORT_ORDER_REVERSE_FLOW',
80 6:'SORT_ORDER_REVERSE_TAB',
81 7:'SORT_ORDER_LAST_DEFINED',
84 SORT_ORDER_CANONICAL = SortOrder(1)
85 SORT_ORDER_FLOW = SortOrder(2)
86 SORT_ORDER_INVALID = SortOrder(0)
87 SORT_ORDER_LAST_DEFINED = SortOrder(7)
88 SORT_ORDER_REVERSE_CANONICAL = SortOrder(4)
89 SORT_ORDER_REVERSE_FLOW = SortOrder(5)
90 SORT_ORDER_REVERSE_TAB = SortOrder(6)
91 SORT_ORDER_TAB = SortOrder(3)
93 class TreeTraversalType(Enum):
95 0:'TREE_RESTRICT_CHILDREN',
96 1:'TREE_RESTRICT_SIBLING',
98 3:'TREE_LAST_DEFINED',
101 TREE_INORDER = TreeTraversalType(2)
102 TREE_LAST_DEFINED = TreeTraversalType(3)
103 TREE_RESTRICT_CHILDREN = TreeTraversalType(0)
104 TREE_RESTRICT_SIBLING = TreeTraversalType(1)
106 # ATTENTION - Register the Application class with the accessible factory.
107 add_accessible_class(interfaces.ATSPI_COLLECTION, Collection)
109 #END----------------------------------------------------------------------------