
    Vh!                         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
y)z
Pan-protocol chat client.
    )	Attribute	Interfacec                   T    e Zd ZdZ ed      Z ed      Zd Zd Zd Z	d Z
d Zd	 Zy
)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                      y)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         K/home/dcms/DCMS/lib/python3.12/site-packages/twisted/words/im/interfaces.py__init__zIAccount.__init__           c                       y)z7
        Am I online?

        @rtype: boolean
        Nr   r   r   r   isOnlinezIAccount.isOnline*   r   r   c                      y)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                       y)z
        Sign off.
        Nr   r   r   r   logOffzIAccount.logOff:   r   r   c                      y)z*
        @rtype: L{Group<IGroup>}
        Nr   	groupNames    r   getGroupzIAccount.getGroup?   r   r   c                      y)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?     UVFEK	

r   r   c                   <    e Zd Z ed      Zd Zd Zd ZddZd Z	y)	IClientz!The L{IAccount} I am a Client forc                      y)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                      y)zb
        @param groupName: The name of the group to join.
        @type groupName: string
        Nr   r   s    r   	joinGroupzIClient.joinGroupU   r   r   c                      y)zc
        @param groupName: The name of the group to leave.
        @type groupName: string
        Nr   r   s    r   
leaveGroupzIClient.leaveGroup[   r   r   c                      y Nr   )namehides     r   getGroupConversationzIClient.getGroupConversationa       r   c                      y 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   s&    ;<Gr   r(   c                   ,    e Zd Zd Zd Zd Zd ZddZy)IPersonc                      y)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                       y)zA
        Am I online right now?

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

        @return: L{locals.StatusEnum}
        Nr   r   r   r   	getStatuszIPerson.getStatusz   r   r   c                       y)z;
        @rtype: string (XXX: How about a scalar?)
        Nr   r   r   r   getIdleTimezIPerson.getIdleTime   r   r   Nc                      y)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   s    
r   r9   c                   P    e Zd ZdZ ed      Z ed      Zd Zd Zd
dZ	d Z
d	 Zy)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                      y)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                      y)zR
        Set this Groups topic on the server.

        @type text: string
        Nr   )rC   s    r   setTopiczIGroup.setTopic   r   r   Nc                      y)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                       y)z"
        Join this group.
        Nr   r   r   r   joinzIGroup.join   r   r   c                       y)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      s8     >?DIJG
r   rG   c                   4    e Zd ZdZd Zd Zd Zd Zd Zd Z	y)	IConversationz0
    A conversation with a specific person.
    c                      y)z*
        @type person: L{IPerson}
        Nr   )personr   s     r   r   zIConversation.__init__   r   r   c                       yzA
        doesn't seem like it belongs in this interface.
        Nr   r   r   r   showzIConversation.show   r   r   c                       yz#
        nor this neither.
        Nr   r   r   r   r3   zIConversation.hide   r   r   c                      y r1   r   rB   s     r   sendTextzIConversation.sendText   r5   r   c                      y r1   r   rB   s     r   showMessagezIConversation.showMessage   r5   r   c                      y)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      s%    


r   rR   c                   B    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zy
)IGroupConversationc                       yrV   r   r   r   r   rW   zIGroupConversation.show   r   r   c                       yrY   r   r   r   r   r3   zIGroupConversation.hide   r   r   c                      y r1   r   rB   s     r   r[   zIGroupConversation.sendText   r5   r   c                      y r1   r   )senderrC   rD   s      r   showGroupMessagez#IGroupConversation.showGroupMessage   r5   r   c                      y)zT
        Sets the list of members in the group and displays it to the user.
        Nr   )memberss    r   setGroupMembersz"IGroupConversation.setGroupMembers   r   r   c                      y)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                      y)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                      y)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                      y)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                   @    e Zd Zd Zd Zd Zd
dZd
dZd Zd Z	d Z
y	)IChatUIc                      y)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                      y)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                       y)z)
        @rtype: L{ContactsList}
        Nr   r   r   r   getContactsListzIChatUI.getContactsList*  r   r   c                      y)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                      y)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                      y)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                      y)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                      y)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      sj   
 02y 2ji <$i $N1Y 1hI @5 5pOi Or   