Include _generated now so I get all the latest fancy stuff
[theonering] / src / tp / _generated / Connection_Interface_Location.py
1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright (C) 2008 Collabora Ltd.
4 Copyright (C) 2008 Nokia Corporation
5
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.
10
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.
15
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.
19   
20 """
21
22 import dbus.service
23
24
25 class ConnectionInterfaceLocation(dbus.service.Interface):
26     """\
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.
30
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
36         datum.
37
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.
45
46       Location information is represented using the terminology of XMPP's
47         XEP-0080
48         or the XEP-0080-derived
49         Geoclue API where
50         possible.
51     """
52
53     def __init__(self):
54         self._interfaces.add('org.freedesktop.Telepathy.Connection.Interface.Location')
55
56     @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.Location', in_signature='au', out_signature='a{ua{sv}}')
57     def GetLocations(self, Contacts):
58         """
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.
65
66         
67           This method is appropriate for "lazy" location finding, for instance
68           displaying the location (if available) of everyone in your contact
69           list.
70         
71       
72         """
73         raise NotImplementedError
74   
75     @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.Location', in_signature='u', out_signature='a{sv}')
76     def RequestLocation(self, Contact):
77         """
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
80         reply.
81
82         
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
86           conditions.
87         
88       
89         """
90         raise NotImplementedError
91   
92     @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.Location', in_signature='a{sv}', out_signature='')
93     def SetLocation(self, Location):
94         """
95         Set the local user's own location.
96       
97         """
98         raise NotImplementedError
99   
100     @dbus.service.signal('org.freedesktop.Telepathy.Connection.Interface.Location', signature='ua{sv}')
101     def LocationUpdated(self, Contact, Location):
102         """
103         Emitted when a contact's location changes or becomes known.
104       
105         """
106         pass
107