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.
15 from interfaces import *
16 from accessible import Accessible
17 from factory import accessible_factory
23 #------------------------------------------------------------------------------
25 class Hypertext(Accessible):
27 An interface used for objects which implement linking between
28 multiple resource or content locations, or multiple 'markers'
29 within a single document. A Hypertext instance is associated
30 with one or more Hyperlinks, which are associated with particular
31 offsets within the Hypertext's included content.
34 def getLink(self, *args, **kwargs):
36 Get one of the Hyperlinks associated with this Hypertext object,
39 an integer from 0 to getNLinks() - 1.
40 @return the Hyperlink in this Hypertext object.
42 func = self.get_dbus_method("getLink", dbus_interface=ATSPI_HYPERTEXT)
43 return func(*args, **kwargs)
45 def getLinkIndex(self, *args, **kwargs):
47 Get the hyperlink index, if any, associated with a particular
48 character offset in the Hypertext object. For Hypertext implementors
49 without textual content, all hyperlinks are associated with character
51 @return the index of the Hyperlink associated with character
52 offset characterIndex, or -1 if no Hyperlink is associated with
53 that character offset.
55 func = self.get_dbus_method("getLinkIndex", dbus_interface=ATSPI_HYPERTEXT)
56 return func(*args, **kwargs)
58 def getNLinks(self, *args, **kwargs):
60 Query the hypertext object for the number of Hyperlinks it contains.
61 @return the number of Hyperlinks associated with this Hypertext
62 object, as a long integer.
64 func = self.get_dbus_method("getNLinks", dbus_interface=ATSPI_HYPERTEXT)
65 return func(*args, **kwargs)
67 # Register the accessible class with the factory.
68 accessible_factory.register_accessible_class(ATSPI_HYPERTEXT, Hypertext)
70 #END----------------------------------------------------------------------------