2008-07-28 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / pyatspi / factory.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 from base import *
16 from accessible import *
17
18 ATSPI_ACCESSIBLE = 'org.freedesktop.atspi.Accessible'
19 ATSPI_ACTION = 'org.freedesktop.atspi.Action'
20 ATSPI_APPLICATION = 'org.freedesktop.atspi.Application'
21 ATSPI_COMPONENT = 'org.freedesktop.atspi.Component'
22 ATSPI_DOCUMENT = 'org.freedesktop.atspi.Document'
23 ATSPI_EDITABLE_TEXT = 'org.freedesktop.atspi.EditableText'
24 ATSPI_HYPERLINK = 'org.freedesktop.atspi.Hyperlink'
25 ATSPI_HYPERTEXT = 'org.freedesktop.atspi.Hypertext'
26 ATSPI_IMAGE = 'org.freedesktop.atspi.Image'
27 ATSPI_LOGIN_HELPER = 'org.freedesktop.atspi.LoginHelper'
28 ATSPI_SELECTION = 'org.freedesktop.atspi.Selection'
29 ATSPI_SELECTOR = 'org.freedesktop.atspi.Selector'
30 ATSPI_STREAMABLE_CONTENT = 'org.freedesktop.atspi.Content'
31 ATSPI_TABLE = 'org.freedesktop.atspi.Table'
32 ATSPI_TEXT = 'org.freedesktop.atspi.Text'
33 ATSPI_VALUE = 'org.freedesktop.atspi.Value'
34
35 #------------------------------------------------------------------------------
36
37 _interfaces = {
38                 ATSPI_ACCESSIBLE:Accessible,
39                 #ATSPI_ACTION:
40                 #ATSPI_APPLICATION:
41                 #ATSPI_COMPONENT:
42                 #ATSPI_DOCUMENT:
43                 #ATSPI_EDITABLE_TEXT:
44                 #ATSPI_HYPERLINK:
45                 #ATSPI_HYPERTEXT:
46                 #ATSPI_IMAGE:
47                 #ATSPI_LOGIN_HELPER:
48                 #ATSPI_SELECTION:
49                 #ATSPI_SELECTOR:
50                 #ATSPI_STREAMABLE_CONTENT:
51                 #ATSPI_TABLE:
52                 #ATSPI_TEXT:
53                 #ATSPI_TREE:
54                 #ATSPI_VALUE:
55 }
56
57 def interfaceFactory(self, busobject, cache, app, path, interface):
58         """
59         The queryInterfaces method needs to return
60         different atspi interfaces depending on the interface name.
61         This class registers names and ATSPI interface
62         classes to perform this task.
63         """
64         return _interfaces[interface](object, cache, app, path, interface)
65
66 #END----------------------------------------------------------------------------