
    Yf!                         d Z ddlmZmZ  G d de          Z G d de          Z G d de          Z G d	 d
e          Z G d de          Z G d de          Z	 G d de          Z
dS )z
Pan-protocol chat client.
    )	Attribute	Interfacec                   b    e Zd ZdZ ed          Z ed          Zd Zd Zd Z	d Z
d Z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                     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 )accountName	autoLoginusernamepasswordhostports         M/var/www/html/env/lib/python3.11/site-packages/twisted/words/im/interfaces.py__init__zIAccount.__init__             c                      dS )z7
        Am I online?

        @rtype: boolean
        Nr   r   r   r   isOnlinezIAccount.isOnline*   r   r   c                     dS )z
        Go on-line.

        @type chatui: Implementor of C{IChatUI}

        @rtype: L{Deferred} with an eventual L{IClient} result.
        Nr   )chatuis    r   logOnzIAccount.logOn1   r   r   c                      dS )z
        Sign off.
        Nr   r   r   r   logOffzIAccount.logOff:   r   r   c                     dS )z*
        @rtype: L{Group<IGroup>}
        Nr   	groupNames    r   getGroupzIAccount.getGroup?   r   r   c                     dS )z,
        @rtype: L{Person<IPerson>}
        Nr   )
personNames    r   	getPersonzIAccount.getPersonD   r   r   N)__name__
__module____qualname____doc__r   clientgatewayTyper   r   r   r   r   r    r   r   r   r   r      s          YUVVF)E K	 	 	      
  
    r   r   c                   D    e Zd Z ed          Zd Zd Zd Zd	dZd Z	dS )
IClientz!The L{IAccount} I am a Client forc                     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   logonDeferreds      r   r   zIClient.__init__M   r   r   c                     dS )zb
        @param groupName: The name of the group to join.
        @type groupName: string
        Nr   r   s    r   	joinGroupzIClient.joinGroupU   r   r   c                     dS )zc
        @param groupName: The name of the group to leave.
        @type groupName: string
        Nr   r   s    r   
leaveGroupzIClient.leaveGroup[   r   r   r   c                     d S Nr   )namehides     r   getGroupConversationzIClient.getGroupConversationa       r   c                     d S r1   r   )r2   s    r   r    zIClient.getPersond   r5   r   Nr   )
r!   r"   r#   r   r*   r   r-   r/   r4   r    r   r   r   r(   r(   J   st        i;<<G             r   r(   c                   .    e Zd Zd Zd Zd Zd ZddZdS )IPersonc                     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   r2   r*   s     r   r   zIPerson.__init__i   r   r   c                      dS )zA
        Am I online right now?

        @rtype: boolean
        Nr   r   r   r   r   zIPerson.isOnlines   r   r   c                      dS )zS
        What is my on-line status?

        @return: L{locals.StatusEnum}
        Nr   r   r   r   	getStatuszIPerson.getStatusz   r   r   c                      dS )z;
        @rtype: string (XXX: How about a scalar?)
        Nr   r   r   r   getIdleTimezIPerson.getIdleTime   r   r   Nc                     dS )zi
        Send a message to this person.

        @type text: string
        @type metadata: dict
        Nr   textmetadatas     r   sendMessagezIPerson.sendMessage   r   r   r1   )r!   r"   r#   r   r   r>   r@   rE   r   r   r   r9   r9   h   sd                
     r   r9   c                   ^    e Zd ZdZ ed          Z ed          Zd Zd Zd
dZ	d Z
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                     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;   s     r   r   zIGroup.__init__   r   r   c                     dS )zR
        Set this Groups topic on the server.

        @type text: string
        Nr   )rC   s    r   setTopiczIGroup.setTopic   r   r   Nc                     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   rB   s     r   sendGroupMessagezIGroup.sendGroupMessage   r   r   c                      dS )z"
        Join this group.
        Nr   r   r   r   joinzIGroup.join   r   r   c                      dS )z$
        Depart this group.
        Nr   r   r   r   leavezIGroup.leave   r   r   r1   )r!   r"   r#   r$   r   r2   r*   r   rJ   rL   rN   rP   r   r   r   rG   rG      s          9>??DiIJJG         
    r   rG   c                   6    e Zd ZdZd Zd Zd Zd Zd Zd Z	dS )	IConversationz0
    A conversation with a specific person.
    c                     dS )z*
        @type person: L{IPerson}
        Nr   )personr   s     r   r   zIConversation.__init__   r   r   c                      dS zA
        doesn't seem like it belongs in this interface.
        Nr   r   r   r   showzIConversation.show   r   r   c                      dS z#
        nor this neither.
        Nr   r   r   r   r3   zIConversation.hide   r   r   c                     d S r1   r   rB   s     r   sendTextzIConversation.sendText   r5   r   c                     d S r1   r   rB   s     r   showMessagezIConversation.showMessage   r5   r   c                     dS )zR
        @param person: XXX Shouldn't this always be Conversation.person?
        Nr   )rT   newnicks     r   changedNickzIConversation.changedNick   r   r   N)
r!   r"   r#   r$   r   rW   r3   r[   r]   r`   r   r   r   rR   rR      sx           
  
  
        r   rR   c                   D    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
S )IGroupConversationc                      dS rV   r   r   r   r   rW   zIGroupConversation.show   r   r   c                      dS rY   r   r   r   r   r3   zIGroupConversation.hide   r   r   c                     d S r1   r   rB   s     r   r[   zIGroupConversation.sendText   r5   r   c                     d S r1   r   )senderrC   rD   s      r   showGroupMessagez#IGroupConversation.showGroupMessage   r5   r   c                     dS )zT
        Sets the list of members in the group and displays it to the user.
        Nr   )memberss    r   setGroupMembersz"IGroupConversation.setGroupMembers   r   r   c                     dS )z
        Displays the topic (from the server) for the group conversation window.

        @type topic: string
        @type author: string (XXX: Not Person?)
        Nr   )topicauthors     r   rJ   zIGroupConversation.setTopic   r   r   c                     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   members    r   memberJoinedzIGroupConversation.memberJoined  r   r   c                     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   oldnickr_   s     r   memberChangedNickz$IGroupConversation.memberChangedNick	  r   r   c                     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   rp   s    r   
memberLeftzIGroupConversation.memberLeft  r   r   N)r!   r"   r#   rW   r3   r[   rh   rk   rJ   rr   rv   rx   r   r   r   rb   rb      s          
  
      
          r   rb   c                   B    e Zd Zd Zd Zd ZddZddZd Zd Z	d	 Z
d
S )IChatUIc                     dS )zp
        Notifies user that an account has been signed on to.

        @type client: L{Client<IClient>}
        Nr   r%   s    r   registerAccountClientzIChatUI.registerAccountClient  r   r   c                     dS )z~
        Notifies user that an account has been signed off or disconnected.

        @type client: L{Client<IClient>}
        Nr   r|   s    r   unregisterAccountClientzIChatUI.unregisterAccountClient#  r   r   c                      dS )z)
        @rtype: L{ContactsList}
        Nr   r   r   r   getContactsListzIChatUI.getContactsList*  r   r   r   c                     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   )rT   Class
stayHiddens      r   getConversationzIChatUI.getConversation2  r   r   c                     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   )groupr   r   s      r   r4   zIChatUI.getGroupConversation>  r   r   c                     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   r2   r%   s     r   r    zIChatUI.getPersonJ  r   r   c                     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   r   s     r   r   zIChatUI.getGroupV  r   r   c                     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   rt   s     r   contactChangedNickzIChatUI.contactChangedNickb  r   r   Nr7   )r!   r"   r#   r}   r   r   r   r4   r    r   r   r   r   r   rz   rz     s              
 
 
 

 
 
 

 
 

 
 
    r   rz   N)r$   zope.interfacer   r   r   r(   r9   rG   rR   rb   rz   r   r   r   <module>r      sh  
  0 / / / / / / /2 2 2 2 2y 2 2 2j    i   <$ $ $ $ $i $ $ $N1 1 1 1 1Y 1 1 1h    I   @5 5 5 5 5 5 5 5pO O O O Oi O O O O Or   