# Generated from the Telepathy spec
""" Copyright (C) 2005, 2006 Collabora Limited 
 Copyright (C) 2005, 2006 Nokia Corporation 
 Copyright (C) 2006 INdT 

    This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  
"""

import dbus.service


class ConnectionInterfaceContactInfo(dbus.service.Interface):
    """\
      THIS INTERFACE IS DEPRECATED AND SHOULD NOT BE USED. A new version
        will be proposed in the 0.13 specification branch.

      An interface for requesting information about a contact on a given
    connection. Information is returned as a vCard represented as an XML
    string, in the format defined by JEP-0054: vcard-temp specifiation
    from the Jabber Software Foundation (this is derived from the
    aborted IETF draft draft-dawson-vcard-xml-dtd-01).

    Implementations using PHOTO or SOUND elements should use the URI encoding
    where possible, and not provide base64 encoded data to avoid unnecessary
    bus traffic. Clients should not implement support for these encoded forms.
    A separate interface will be provided for transferring user avatars.

    The following extended element names are also added to represent
      information from other systems which are not based around vCards:
    
      USERNAMEthe username of the contact on their local system (used on IRC for example)
      HOSTNAMEthe fully qualified hostname, or IPv4 or IPv6 address of the contact in dotted quad or colon-separated form
    
    """

    def __init__(self):
        self._interfaces.add('org.freedesktop.Telepathy.Connection.Interface.ContactInfo')

    @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.ContactInfo', in_signature='u', out_signature='')
    def RequestContactInfo(self, contact):
        """
        Request information for a given contact. The function will return
        after a GotContactInfo signal has been emitted for the contact, or
        an error returned.
      
        """
        raise NotImplementedError
  
    @dbus.service.signal('org.freedesktop.Telepathy.Connection.Interface.ContactInfo', signature='us')
    def GotContactInfo(self, contact, vcard):
        """
        Emitted when information has been received from the server with
        the details of a particular contact.
      
        """
        pass
  