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 Document(Accessible):
27 Primarily a 'tagging' interface which indicates the start of
28 document content in the Accessibility hierarchy. Accessible objects
29 below the node implementing Document are normally assumed to
30 be part of the document content. Attributes of Document are those
31 attributes associated with the document as a whole. Objects that
32 implement Document are normally expected to implement Collection
36 def getAttributeValue(self, *args, **kwargs):
38 Gets the value of a single attribute, if specified for the document
40 @param : attributename
41 a string indicating the name of a specific attribute (name-value
43 @return a string corresponding to the value of the specified
44 attribute, or an empty string if the attribute is unspecified
47 func = self.get_dbus_method("getAttributeValue", dbus_interface=ATSPI_DOCUMENT)
48 return func(*args, **kwargs)
50 def getAttributes(self, *args, **kwargs):
52 Gets all attributes specified for a document as a whole. For
53 attributes which change within the document content, see Accessibility::Text::getAttributes
55 @return an AttributeSet containing the attributes of the document,
58 func = self.get_dbus_method("getAttributes", dbus_interface=ATSPI_DOCUMENT)
59 return func(*args, **kwargs)
61 def getLocale(self, *args, **kwargs):
63 Gets the locale associated with the document's content. e.g.
64 the locale for LOCALE_TYPE_MESSAGES.
65 @return a string compliant with the POSIX standard for locale
68 func = self.get_dbus_method("getLocale", dbus_interface=ATSPI_DOCUMENT)
69 return func(*args, **kwargs)
71 # Register the accessible class with the factory.
72 accessible_factory.register_accessible_class(ATSPI_DOCUMENT, Document)
74 #END----------------------------------------------------------------------------