1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright (C) 2008 Collabora Ltd.
4 Copyright (C) 2008 Nokia Corporation
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 class ConnectionInterfaceLocation(dbus.service.Interface):
27 An interface on connections to support protocols which allow users to
28 publish their current geographical location, and subscribe to the
29 current location of their contacts.
31 This interface is geared strongly towards automatic propagation and
32 use of this information, so focuses on latitude, longitude and
33 altitude which can be determined by GPS, although provision is also
34 included for an optional human-readable description of locations. All
35 co-ordinate information is required to be relative to the WGS84
38 The information published through this interface is intended to have
39 the same scope as presence information, so will normally be made
40 available to those individuals on the user's "publish" contact list.
41 Even so, user interfaces should not automatically publish location
42 information without the consent of the user, and it is recommended
43 that an option is made available to reduce the accuracy of the
44 reported information to allow the user to maintain their privacy.
46 Location information is represented using the terminology of XMPP's
48 or the XEP-0080-derived
54 self._interfaces.add('org.freedesktop.Telepathy.Connection.Interface.Location')
56 @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.Location', in_signature='au', out_signature='a{ua{sv}}')
57 def GetLocations(self, Contacts):
59 Return the current locations of the given contacts, if they are
60 already known. If any of the given contacts' locations are not known,
61 request their current locations, but return immediately without waiting
62 for a reply; if a reply with a non-empty location is later received
63 for those contacts, the LocationUpdated
64 signal will be emitted for them.
67 This method is appropriate for "lazy" location finding, for instance
68 displaying the location (if available) of everyone in your contact
73 raise NotImplementedError
75 @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.Location', in_signature='u', out_signature='a{sv}')
76 def RequestLocation(self, Contact):
78 Return the current location of the given contact. If necessary, make
79 a request to the server for up-to-date information, and wait for a
83 This method is appropriate for use in a "Contact Information..."
84 dialog; it can be used to show progress information (while waiting
85 for the method to return), and can distinguish between various error
90 raise NotImplementedError
92 @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.Location', in_signature='a{sv}', out_signature='')
93 def SetLocation(self, Location):
95 Set the local user's own location.
98 raise NotImplementedError
100 @dbus.service.signal('org.freedesktop.Telepathy.Connection.Interface.Location', signature='ua{sv}')
101 def LocationUpdated(self, Contact, Location):
103 Emitted when a contact's location changes or becomes known.