U
    
W[!                     @   s   d Z ddlmZmZ G dd deZG dd deZG dd deZG d	d
 d
eZG dd deZG dd deZ	G dd deZ
dS )z
Pan-protocol chat client.
    )	Interface	Attributec                   @   sP   e Zd ZdZedZedZdd Zdd Zdd	 Z	d
d Z
dd Zdd ZdS )IAccountz;
    I represent a user's account with a chat service.
    z<The L{IClient} currently connecting to this account, if any.z;A C{str} that identifies the protocol used by this account.c                 C   s   dS )a  
        @type accountName: string
        @param accountName: A name to refer to the account by locally.
        @type autoLogin: boolean
        @type username: string
        @type password: string
        @type host: string
        @type port: integer
        N )ZaccountNameZ	autoLoginZusernameZpasswordZhostZportr   r   =/usr/lib/python3/dist-packages/twisted/words/im/interfaces.py__init__   s    zIAccount.__init__c                   C   s   dS )z7
        Am I online?

        @rtype: boolean
        Nr   r   r   r   r   isOnline(   s    zIAccount.isOnlinec                 C   s   dS )z
        Go on-line.

        @type chatui: Implementor of C{IChatUI}

        @rtype: L{Deferred} with an eventual L{IClient} result.
        Nr   )chatuir   r   r   logOn/   s    zIAccount.logOnc                   C   s   dS )z
        Sign off.
        Nr   r   r   r   r   logOff8   s    zIAccount.logOffc                 C   s   dS )z*
        @rtype: L{Group<IGroup>}
        Nr   Z	groupNamer   r   r   getGroup=   s    zIAccount.getGroupc                 C   s   dS )z,
        @rtype: L{Person<IPerson>}
        Nr   )Z
personNamer   r   r   	getPersonB   s    zIAccount.getPersonN)__name__
__module____qualname____doc__r   clientZgatewayTyper   r   r
   r   r   r   r   r   r   r   r      s   	r   c                   @   s>   e Zd ZedZdd Zdd Zdd Zdd	d
Zdd Z	dS )IClientz!The L{IAccount} I am a Client forc                 C   s   dS )z
        @type account: L{IAccount}
        @type chatui: L{IChatUI}
        @param logonDeferred: Will be called back once I am logged on.
        @type logonDeferred: L{Deferred<twisted.internet.defer.Deferred>}
        Nr   )accountr	   ZlogonDeferredr   r   r   r   M   s    zIClient.__init__c                 C   s   dS )zb
        @param groupName: The name of the group to join.
        @type groupName: string
        Nr   r   r   r   r   	joinGroupU   s    zIClient.joinGroupc                 C   s   dS )zc
        @param groupName: The name of the group to leave.
        @type groupName: string
        Nr   r   r   r   r   
leaveGroup[   s    zIClient.leaveGroupr   c                 C   s   d S Nr   )namehider   r   r   getGroupConversationa   s    zIClient.getGroupConversationc                 C   s   d S r   r   )r   r   r   r   r   e   s    zIClient.getPersonN)r   )
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   I   s   
r   c                   @   s6   e Zd Zdd Zdd Zdd Zdd Zdd
dZd	S )IPersonc                 C   s   dS )z
        Initialize me.

        @param name: My name, as the server knows me.
        @type name: string
        @param account: The account I am accessed through.
        @type account: I{Account}
        Nr   r   r   r   r   r   r   l   s    zIPerson.__init__c                   C   s   dS )zA
        Am I online right now?

        @rtype: boolean
        Nr   r   r   r   r   r   w   s    zIPerson.isOnlinec                   C   s   dS )zS
        What is my on-line status?

        @return: L{locals.StatusEnum}
        Nr   r   r   r   r   	getStatus   s    zIPerson.getStatusc                   C   s   dS )z;
        @rtype: string (XXX: How about a scalar?)
        Nr   r   r   r   r   getIdleTime   s    zIPerson.getIdleTimeNc                 C   s   dS )zi
        Send a message to this person.

        @type text: string
        @type metadata: dict
        Nr   textmetadatar   r   r   sendMessage   s    zIPerson.sendMessage)N)r   r   r   r   r   r   r   r#   r   r   r   r   r   j   s
   r   c                   @   sJ   e Zd ZdZedZedZdd Zdd Zdd	d
Z	dd Z
dd ZdS )IGroupz
    A group which you may have a conversation with.

    Groups generally have a loosely-defined set of members, who may
    leave and join at any time.
    z'My C{str} name, as the server knows me.z/The L{Account<IAccount>} I am accessed through.c                 C   s   dS )z
        Initialize me.

        @param name: My name, as the server knows me.
        @type name: str
        @param account: The account I am accessed through.
        @type account: L{Account<IAccount>}
        Nr   r   r   r   r   r      s    zIGroup.__init__c                 C   s   dS )zR
        Set this Groups topic on the server.

        @type text: string
        Nr   )r!   r   r   r   setTopic   s    zIGroup.setTopicNc                 C   s   dS )a  
        Send a message to this group.

        @type text: str

        @type metadata: dict
        @param metadata: Valid keys for this dictionary include:

            - C{'style'}: associated with one of:
                - C{'emote'}: indicates this is an action
        Nr   r    r   r   r   sendGroupMessage   s    zIGroup.sendGroupMessagec                   C   s   dS )z"
        Join this group.
        Nr   r   r   r   r   join   s    zIGroup.joinc                   C   s   dS )z$
        Depart this group.
        Nr   r   r   r   r   leave   s    zIGroup.leave)N)r   r   r   r   r   r   r   r   r%   r&   r'   r(   r   r   r   r   r$      s   
r$   c                   @   s@   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dS )IConversationz0
    A conversation with a specific person.
    c                 C   s   dS )z*
        @type person: L{IPerson}
        Nr   )personr	   r   r   r   r      s    zIConversation.__init__c                   C   s   dS zA
        doesn't seem like it belongs in this interface.
        Nr   r   r   r   r   show   s    zIConversation.showc                   C   s   dS z#
        nor this neither.
        Nr   r   r   r   r   r      s    zIConversation.hidec                 C   s   d S r   r   r    r   r   r   sendText   s    zIConversation.sendTextc                 C   s   d S r   r   r    r   r   r   showMessage   s    zIConversation.showMessagec                 C   s   dS )zR
        @param person: XXX Shouldn't this always be Conversation.person?
        Nr   )r*   newnickr   r   r   changedNick   s    zIConversation.changedNickN)
r   r   r   r   r   r,   r   r.   r/   r1   r   r   r   r   r)      s   r)   c                   @   sT   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd ZdS )IGroupConversationc                   C   s   dS r+   r   r   r   r   r   r,      s    zIGroupConversation.showc                   C   s   dS r-   r   r   r   r   r   r      s    zIGroupConversation.hidec                 C   s   d S r   r   r    r   r   r   r.     s    zIGroupConversation.sendTextc                 C   s   d S r   r   )Zsenderr!   r"   r   r   r   showGroupMessage  s    z#IGroupConversation.showGroupMessagec                 C   s   dS )zT
        Sets the list of members in the group and displays it to the user.
        Nr   )membersr   r   r   setGroupMembers  s    z"IGroupConversation.setGroupMembersc                 C   s   dS )z
        Displays the topic (from the server) for the group conversation window.

        @type topic: string
        @type author: string (XXX: Not Person?)
        Nr   )ZtopicZauthorr   r   r   r%     s    zIGroupConversation.setTopicc                 C   s   dS )z
        Adds the given member to the list of members in the group conversation
        and displays this to the user,

        @type member: string (XXX: Not Person?)
        Nr   memberr   r   r   memberJoined  s    zIGroupConversation.memberJoinedc                 C   s   dS )z
        Changes the oldnick in the list of members to C{newnick} and displays this
        change to the user,

        @type oldnick: string (XXX: Not Person?)
        @type newnick: string
        Nr   Zoldnickr0   r   r   r   memberChangedNick$  s    z$IGroupConversation.memberChangedNickc                 C   s   dS )z
        Deletes the given member from the list of members in the group
        conversation and displays the change to the user.

        @type member: string (XXX: Not Person?)
        Nr   r6   r   r   r   
memberLeft.  s    zIGroupConversation.memberLeftN)r   r   r   r,   r   r.   r3   r5   r%   r8   r:   r;   r   r   r   r   r2      s   		
r2   c                   @   sP   e Zd Zdd Zdd Zdd Zddd	Zdd
dZdd Zdd Z	dd Z
dS )IChatUIc                 C   s   dS )zp
        Notifies user that an account has been signed on to.

        @type client: L{Client<IClient>}
        Nr   r   r   r   r   registerAccountClient:  s    zIChatUI.registerAccountClientc                 C   s   dS )z~
        Notifies user that an account has been signed off or disconnected.

        @type client: L{Client<IClient>}
        Nr   r=   r   r   r   unregisterAccountClientB  s    zIChatUI.unregisterAccountClientc                   C   s   dS )z)
        @rtype: L{ContactsList}
        Nr   r   r   r   r   getContactsListJ  s    zIChatUI.getContactsListr   c                 C   s   dS )aT  
        For the given person object, returns the conversation window
        or creates and returns a new conversation window if one does not exist.

        @type person: L{Person<IPerson>}
        @type Class: L{Conversation<IConversation>} class
        @type stayHidden: boolean

        @rtype: L{Conversation<IConversation>}
        Nr   )r*   Class
stayHiddenr   r   r   getConversationR  s    zIChatUI.getConversationc                 C   s   dS )a  
        For the given group object, returns the group conversation window or
        creates and returns a new group conversation window if it doesn't exist.

        @type group: L{Group<interfaces.IGroup>}
        @type Class: L{Conversation<interfaces.IConversation>} class
        @type stayHidden: boolean

        @rtype: L{GroupConversation<interfaces.IGroupConversation>}
        Nr   )grouprA   rB   r   r   r   r   _  s    zIChatUI.getGroupConversationc                 C   s   dS )z
        Get a Person for a client.

        Duplicates L{IAccount.getPerson}.

        @type name: string
        @type client: L{Client<IClient>}

        @rtype: L{Person<IPerson>}
        Nr   r   r   r   r   r   r   l  s    zIChatUI.getPersonc                 C   s   dS )z
        Get a Group for a client.

        Duplicates L{IAccount.getGroup}.

        @type name: string
        @type client: L{Client<IClient>}

        @rtype: L{Group<IGroup>}
        Nr   rE   r   r   r   r   y  s    zIChatUI.getGroupc                 C   s   dS )z
        For the given person, changes the person's name to newnick, and
        tells the contact list and any conversation windows with that person
        to change as well.

        @type oldnick: string
        @type newnick: string
        Nr   r9   r   r   r   contactChangedNick  s    zIChatUI.contactChangedNickN)r   )r   )r   r   r   r>   r?   r@   rC   r   r   r   rF   r   r   r   r   r<   8  s   

r<   N)r   Zzope.interfacer   r   r   r   r   r$   r)   r2   r<   r   r   r   r   <module>   s   4!-9&B