
    g
f                         d Z dZdZdZdZdZddlmZ ddlmZ dd	lm	Z	 dd
lm
Z
 ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ  G d d      Z G d d      Z G d d      Z G d d      Zy)z Implements generic chat support.z$Id$z
$Revision$z$Date$z%Copyright (c) 2010-2011 The Orca TeamLGPL   )cmdnames)debug)focus_manager)	guilabels)input_event)keybindings)messages)script_manager)settings)settings_manager)AXObject)AXUtilitiesc                   6    e Zd Zd Zd Zd Zd Zd Zd Zd Z	y)	RingListc                 <    g | _         d| _        || _        d| _        y N    )__data____full____max____cur__)selflengths     +/usr/lib/python3/dist-packages/orca/chat.py__init__zRingList.__init__3   s        c                 x   | j                   dk(  rZt        d| j                  dz
        D ]!  }| j                  |dz      | j                  |<   # || j                  | j                  dz
  <   y | j                  j	                  |       | xj                  dz  c_        | j                  | j
                  k(  rd| _         y y )Nr   r   )r   ranger   r   appendr   )r   xis      r   r    zRingList.append9   s    ==AAt||a/0 8#'==Q#7a 8./DMM$,,*+MM  #LLAL||t||+ ! ,r   c                     | j                   S N)r   r   s    r   getzRingList.getD   s    }}r   c                     | j                   dkD  r0| j                  | j                   dz
  = | xj                   dz  c_         y y )Nr   r   )r   r   r%   s    r   removezRingList.removeG   s6    LL1dllQ./LLAL r   c                     | j                   S r$   )r   r%   s    r   sizezRingList.sizeL       ||r   c                     | j                   S r$   )r   r%   s    r   maxsizezRingList.maxsizeO   r+   r   c                 8    dj                  | j                        S )N )joinr   r%   s    r   __str__zRingList.__str__R   s    wwt}}%%r   N)
__name__
__module____qualname__r   r    r&   r(   r*   r-   r1    r   r   r   r   2   s%    	"
&r   r   c                   0    e Zd ZdZddZd Zd Zd Zd Zy)	Conversation	   Nc                    || _         || _        || _        t        t        j
                        | _        d}|| j                  j                         k  r4| j                  d       |dz  }|| j                  j                         k  r4d| _	        y)a  Creates a new instance of the Conversation class.

        Arguments:
        - name: the chatroom/conversation name
        - accHistory: the accessible which holds the conversation history
        - inputArea: the editable text object for this conversation.
        r   r/   r   N)
name
accHistory	inputArear   r7   MESSAGE_LIST_LENGTH_messageHistoryr-   
addMessage_typingStatus)r   r:   r;   r<   r"   s        r   r   zConversation.__init__a   s     	$"  ((H(HI $&&..00OOBFA $&&..00  r   c                 :    | j                   j                  |       y)zAdds the current message to the message history.

        Arguments:
        - message: A string containing the message to add
        N)r>   r    )r   messages     r   r?   zConversation.addMessage   s     	##G,r   c                 @    | j                   j                         }||   S )zReturns the specified message from the message history.

        Arguments:
        - messageNumber: the index of the message to get.
        )r>   r&   )r   messageNumberr
   s      r   getNthMessagezConversation.getNthMessage   s#     ''++-&&r   c                     | j                   S )z<Returns the typing status of the buddy in this conversation.r@   r%   s    r   getTypingStatuszConversation.getTypingStatus   s     !!!r   c                     || _         y)zSets the typing status of the buddy in this conversation.

        Arguments:
        - status: a string describing the current status.
        NrG   )r   statuss     r   setTypingStatuszConversation.setTypingStatus   s     $r   r$   )	r2   r3   r4   r=   r   r?   rE   rH   rK   r5   r   r   r7   r7   [   s#      >-	'"
$r   r7   c                   6    e Zd Zd Zd Zd Zd Zd Zd Zd Z	y)	ConversationListc                     g | _         t        |      | _        t        |      | _        d}|| j                  j	                         k  r6| j                  dd       |dz  }|| j                  j	                         k  r5yy)zCreates a new instance of the ConversationList class.

        Arguments:
        - messageListLength: the size of the message history to keep.
        r   r/   Nr   )conversationsr   r>   _roomHistoryr-   r?   )r   messageListLengthr"   s      r   r   zConversationList.__init__   sz      
  ((9:
 %%67 $&&..00OOB%FA $&&..00r   c                     |sd}n.| j                  |      s| j                  |       |j                  }| j                  j	                  |       | j
                  j	                  |       y)zAdds the current message to the message history.

        Arguments:
        - message: A string containing the message to add
        - conversation: The instance of the Conversation class with which
          the message is associated
        r/   N)hasConversationaddConversationr:   r>   r    rP   )r   rB   conversationr:   s       r   r?   zConversationList.addMessage   s[     D''5$$\2$$D##G,  &r   c                 ~    | j                   j                         }| j                  j                         }||   ||   fS )zReturns a list containing the specified message from the message
        history and the name of the chatroom/conversation associated with
        that message.

        Arguments:
        - messageNumber: the index of the message to get.
        )r>   r&   rP   )r   rD   r
   roomss       r   getNthMessageAndNamez%ConversationList.getNthMessageAndName   sA     ''++-!!%%'&m(<<<r   c                     || j                   v S )zReturns True if we know about this conversation.

        Arguments:
        - conversation: the conversation of interest
        )rO   r   rU   s     r   rS   z ConversationList.hasConversation   s     t1111r   c                 ,    t        | j                        S )z<Returns the number of conversations we currently know about.)lenrO   r%   s    r   getNConversationsz"ConversationList.getNConversations   s     4%%&&r   c                 :    | j                   j                  |       y)z|Adds conversation to the list of conversations.

        Arguments:
        - conversation: the conversation to add
        N)rO   r    rZ   s     r   rT   z ConversationList.addConversation   s     	!!,/r   c                 Z    	 | j                   j                  |       y# t        $ r Y yw xY w)zRemoves conversation from the list of conversations.

        Arguments:
        - conversation: the conversation to remove

        Returns True if conversation was successfully removed.
        TF)rO   r(   	ExceptionrZ   s     r   removeConversationz#ConversationList.removeConversation   s4    	%%l3   		s    	**N)
r2   r3   r4   r   r?   rX   rS   r]   rT   ra   r5   r   r   rM   rM      s%    6'&=2'
0r   rM   c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 ZddZddZd Zd Zd Zd Zd Zd ZddZd Zd Zd Zd Zd Zd Zd Zy
)ChatzTThis class implements the chat functionality which is available to
    scripts.
    c                 p   || _         || _        g d| _        t        j                  | _        i | _        | j                          | j                         | _	        t        | j                        | _        t        | j                        | _        d| _        d| _        d| _        d| _        d| _        d| _        y)ah  Creates an instance of the Chat class.

        Arguments:
        - script: the script with which this instance is associated.
        - buddyListAncestries: a list of lists of roles beginning
          with the object serving as the actual buddy list (e.g.
          ROLE_TREE_TABLE) and ending with the top level object (e.g.
          ROLE_FRAME).
        )	F1F2F3F4F5F6F7F8F9N)_script_buddyListAncestriesmessageKeysr	   ORCA_MODIFIER_MASKmessageKeyModifierinputEventHandlerssetupInputEventHandlersgetKeyBindingskeyBindingsr\   rQ   rM   _conversationListfocusedChannelRadioButtonallChannelsRadioButtonallMessagesRadioButtonbuddyTypingCheckButtonchatRoomHistoriesCheckButtonspeakNameCheckButton)r   scriptbuddyListAncestriess      r   r   zChat.__init__  s     $7! C 	"-"@"@"$$$&..0
 "%T%5%5!6!1$2H2H!I)-&&*#&*#&*#,0)$(!r   c                    t        j                  | j                  t        j                        | j
                  d<   t        j                  | j                  t        j                        | j
                  d<   t        j                  | j                  t        j                        | j
                  d<   t        j                  | j                  t        j                        | j
                  d<   y)zDefines InputEventHandler fields for chat functions which
        will be used by the script associated with this chat instance.togglePrefixHandlertoggleBuddyTypingHandlertoggleMessageHistoriesHandlerreviewMessageN)r   InputEventHandlertogglePrefixr   CHAT_TOGGLE_ROOM_NAME_PREFIXrs   toggleBuddyTypingCHAT_TOGGLE_BUDDY_TYPINGtoggleMessageHistoriesCHAT_TOGGLE_MESSAGE_HISTORIESreadPreviousMessageCHAT_PREVIOUS_MESSAGEr%   s    r   rt   zChat.setupInputEventHandlersH  s    
 ))!!557 	 56 ))&&113 	 :; ))++668 	 ?@ ))((..0 	0
 	r   c           
         t        j                         }|j                  t        j                  dt         j                  t         j
                  | j                  d                |j                  t        j                  dt         j                  t         j
                  | j                  d                |j                  t        j                  dt         j                  t         j
                  | j                  d                | j                  D ]N  }|j                  t        j                  || j                  t         j                  | j                  d                P |S )zDefines the chat-related key bindings which will be used by
        the script associated with this chat instance.

        Returns: an instance of keybindings.KeyBindings.
        r/   r   r   r   r   )
r	   KeyBindingsadd
KeyBindingdefaultModifierMaskNO_MODIFIER_MASKrs   rp   rr   rq   )r   rv   
messageKeys      r   ru   zChat.getKeyBindingsb  s2    "--/""//,,''(=>	@	A 	""//,,''(BC	E	F 	""//,,''(GH	J	K ** 	?JOO&&++22++O<	>?	? r   c                    ddl m} |j                         }|j                  d       t        j
                  }t        j                         j                  d      }|j                  j                  |      | _        | j                  j                  |       |j                  | j                  dddd       t        j                  }t        j                         j                  d      }|j                  j                  |      | _        | j                  j                  |       |j                  | j                  dddd       t        j                   }t        j                         j                  d      }|j                  j                  |      | _        | j"                  j                  |       |j                  | j"                  dddd       |j%                         }|j                  |dd	dd       |j'                  d
t        j(                   d      }|j+                  d       |j-                  |       |j.                  j1                  dddd      }|j3                  dddd       |j5                  |       |j                         }|j5                  |       t        j                         j                  d      }t        j6                  }|j8                  j                  d|      }|j                  |t:        j<                  k(         || _        |j                  | j>                  dddd       t        j@                  }|j8                  j                  d|      }	|	jC                  |       |	j                  |t:        jD                  k(         |	| _#        |j                  | jF                  dddd       t        jH                  tK        jL                  | jN                  jP                        z  }|j8                  j                  d|      }
|
jC                  |       |
j                  |t:        jR                  k(         |
| _*        |j                  | jT                  dddd       |jW                          |S )zpReturn a GtkGrid containing the application unique configuration
        GUI items for the current application. r   )Gtk   chatSpeakRoomNamer   chatAnnounceBuddyTypingchatRoomHistories      z<b>z</b>Tg      ?chatMessageVerbosityN),gi.repositoryr   Gridset_border_widthr   CHAT_SPEAK_ROOM_NAMEr   
getManager
getSettingCheckButtonnew_with_mnemonicr}   
set_activeattachCHAT_ANNOUNCE_BUDDY_TYPINGr{   CHAT_SEPARATE_MESSAGE_HISTORIESr|   FrameLabelCHAT_SPEAK_MESSAGES_FROMset_use_markupset_label_widget	Alignmentnewset_paddingr   CHAT_SPEAK_MESSAGES_ALLRadioButtonr   CHAT_SPEAK_ALLrz   CHAT_SPEAK_MESSAGES_ACTIVE
join_groupCHAT_SPEAK_FOCUSED_CHANNELrx   "CHAT_SPEAK_MESSAGES_ALL_IF_FOCUSEDr   get_namern   appCHAT_SPEAK_ALL_IF_FOCUSEDry   show_all)r   r   gridlabelvaluemessagesFramemessagesAlignmentmessagesGridrb1rb2rb3s              r   getAppPreferencesGUIzChat.getAppPreferencesGUI  s    	&xxzb!.. ++-889LM$'OO$E$Ee$L!!!,,U3D--q!Q:44 ++-889RS&)oo&G&G&N###..u5D//Aq!<99 ++-889LMOO--e4 	)))44U;D55q!QB		M1aA.		C	 B BC4HIT"&&u-MM--c31=%%aB2+,xxzl+ ++-889OP11oo//e<u 7 778&)#D77Aq!D44oo//e<su C CCD),&D::Aq!QG<<dll../0oo//e<su B BBC&)#D77Aq!Dr   c                 l   | j                   j                         rt        j                  }n;| j                  j                         rt        j
                  }nt        j                  }|| j                  j                         | j                  j                         | j                  j                         dS )z7Returns a dictionary with the app-specific preferences.)r   r   r   r   )
ry   
get_activer   r   rx   r   r   r}   r{   r|   )r   	verbositys     r   getPreferencesFromGUIzChat.getPreferencesFromGUI  s     &&113 ::I++668 ;;I //I %.!%!:!:!E!E!G'+'B'B'M'M'O!%!B!B!M!M!O	
 	
r   c                    t         j                  }t        j                         j	                  d      }t        j                         j                  d|        |rt         j                  }| j                  j                  |       y)z Toggle whether we prefix chat room messages with the name of
        the chat room.

        Arguments:
        - script: the script associated with this event
        - inputEvent: if not None, the input event that caused this action.
        r   T)	r
   CHAT_ROOM_NAME_PREFIX_ONr   r   r   
setSettingCHAT_ROOM_NAME_PREFIX_OFFrn   presentMessage)r   r~   
inputEventlinespeakRoomNames        r   r   zChat.togglePrefix  si     00(335@@ATU##%001D-FWX55D##D)r   c                    t         j                  }t        j                         j	                  d      }t        j                         j                  d|        |rt         j                  }| j                  j                  |       y)z Toggle whether we announce when our buddies are typing a message.

        Arguments:
        - script: the script associated with this event
        - inputEvent: if not None, the input event that caused this action.
        r   T)	r
   CHAT_BUDDY_TYPING_ONr   r   r   r   CHAT_BUDDY_TYPING_OFFrn   r   )r   r~   r   r   announceTypings        r   r   zChat.toggleBuddyTyping  sk     ,,)446AAB[\##%00%>'9	;11D##D)r   c                    t         j                  }t        j                         j	                  d      }t        j                         j                  d|        |rt         j                  }| j                  j                  |       y)z Toggle whether we provide chat room specific message histories.

        Arguments:
        - script: the script associated with this event
        - inputEvent: if not None, the input event that caused this action.
        r   T)	r
   CHAT_SEPARATE_HISTORIES_ONr   r   r   r   CHAT_SEPARATE_HISTORIES_OFFrn   r   )r   r~   r   r   roomHistoriess        r   r   zChat.toggleMessageHistories  si     22(335@@ATU##%001D-FWX77D##D)r   Nc                    	 | j                   j                  |j                        }| j                  |dz   z
  }d\  }}t        j                         j                  d      rQ| j                  t        j                         j                               }|r<|j                  |      }|j                  }n| j                  j                  |      \  }}|r|r| j                  ||d       yyy# t        $ r Y w xY w)a   Speak/braille a previous chat room message.

        Arguments:
        - script: the script associated with this event
        - inputEvent: if not None, the input event that caused this action.
        - index: The index of the message to read -- by default, the most
          recent message. If we get an inputEvent, however, the value of
          index is ignored and the index of the event_string with respect
          to self.messageKeys is used instead.
        r   )NNr   TN)rp   indexevent_stringr`   rQ   r   r   r   getConversationr   get_locus_of_focusrE   r:   rw   rX   utterMessage)r   r~   r   r   rD   rB   chatRoomNamerU   s           r   r   zChat.readPreviousMessage  s    	$$**:+B+BCE ..%!)< *&&(334GH//0H0H0J0]0]0_`L&44]C+00 &&;;MJ "G\ |lGT: $7  		s   %C* *	C65C6c                    t        j                         j                  | j                  j                  d      }t        j                         j                         }|j                  | j                  j                  k7  r|t        j                  k(  ry|s|t        j                  k(  ryd}|rKt        j                         j                  | j                  j                  d      rt        j                  |z  }t        j                  s'| j                  j                  j                  ||      }n&| j                  j                  j                  ||      }t!        |j#                               rC| j                  j$                  j'                  |      }| j                  j)                  ||       | j                  j+                  |       y)aj   Speak/braille a chat room message.

        Arguments:
        - chatRoomName: name of the chat room this message came from
        - message: the chat room message
        - focused: whether or not the current chatroom has focus. Defaults
          to True so that we can use this method to present chat history
          as well as incoming messages.
        r   Nr/   r   stringvoice)r   r   getAppSettingrn   r   r   getActiveScriptr:   r   r   r   r
   CHAT_MESSAGE_FROM_ROOMpresentChatRoomLast	utilitiesappendStringr\   stripspeechGeneratorr   speakMessagedisplayBrailleMessage)r   r   rB   focusedr   r~   textr   s           r   r   zChat.utterMessage9  sO    %//1??LL46	**,<<>;;$,,+++H>>>Y(*M*MM&&(66t||7G7GI\]22\AD++<<))66tWED<<))66wEDtzz|LL0066d6CELL%%d%%8**40r   c                     |j                   S )ay  Get the actual displayed message. This will almost always be the
        unaltered any_data from an event of type object:text-changed:insert.

        Arguments:
        - event: the Event from which to take the text.

        Returns the string which should be presented as the newly-inserted
        text. (Things like chatroom name prefacing get handled elsewhere.)
        )any_datar   events     r   getMessageFromEventzChat.getMessageFromEvent_  s     ~~r   c                    |r'|j                   j                  d      r|j                  sy| j                  |j                        ry| j                  |j                        ry| j                  |      r| j                  ||j                         y| j                  |j                        r| j                  |j                        r2| j                  |j                        }t        ||j                        }n'| j                  |j                        }|j                  }| j                  |      j                  d      }|r| j!                  ||       | j#                  |j                        }|rd}|r| j%                  |||       y| j'                  |      rP|j                  }| j(                  j*                  j-                  |      }| j(                  j/                  ||       yy)aS  Gives the Chat class an opportunity to present the text from the
        text inserted Event.

        Arguments:
        - event: the text inserted Event

        Returns True if we handled this event here; otherwise False, which
        tells the associated script that is not a chat event that requires
        custom handling.
        zobject:text-changed:insertFT
r/   r   r   )type
startswithr   isGenericTextObjectsourceisInBuddyListisTypingStatusChangedEventpresentTypingStatusChangeisChatRoomMsgisNewConversationgetChatRoomNamer7   r   r:   r   r   addMessageToHistoryisFocusedChatr   isAutoCompletedTextEventrn   r   r   r   )r   r   r:   rU   rB   r   r   r   s           r   presentInsertedTextzChat.presentInsertedTextl  s    **''(DE..##ELL1 - ,,U3**5%..A-%%ell3++ELL9+D%,,?#33ELLA#((..u5;;DAG((,?
 ((6G!!$9**51>>DLL0066d6CELL%%d%%8r   c                 T   t        j                         j                  d      r| j                  |j                        }|rh||j                         k7  rU| j                  j                  j                  |      }| j                  j                  ||       |j                  |       yy)aC  Presents a change in typing status for the current conversation
        if the status has indeed changed and if the user wants to hear it.

        Arguments:
        - event: the accessible Event
        - status: a string containing the status change

        Returns True if we spoke the change; False otherwise
        r   r   r   TF)r   r   r   r   r   rH   rn   r   r   r   rK   )r   r   rJ   rU   r   s        r   r   zChat.presentTypingStatusChange  s     &&(334MN//=L<+G+G+I!I44::&:I))&)>,,V4r   c                 ^    |j                  |       | j                  j                  ||       y)aQ  Adds message to both the individual conversation's history
        as well as to the complete history stored in our conversation
        list.

        Arguments:
        - message: a string containing the message to be added
        - conversation: the instance of the Conversation class to which
          this message belongs
        N)r?   rw   )r   rB   rU   s      r   r  zChat.addMessageToHistory  s(     	())'<@r   c                 Z    t        j                  |      xr t        j                  |      S )zReturns True if the given accessible seems to be something
        unrelated to the custom handling we're attempting to do here.

        Arguments:
        - obj: the accessible object to examine.
        )r   is_editableis_single_liner   objs     r   r   zChat.isGenericTextObject  s%     &&s+O0J0J30OOr   c                 |    |y| j                   D ]*  }| j                  j                  j                  ||      s* y y)ay  Returns True if obj is the list of buddies in the buddy list
        window. Note that this method relies upon a hierarchical check,
        using a list of hierarchies provided by the script. Scripts
        which have more reliable means of identifying the buddy list
        can override this method.

        Arguments:
        - obj: the accessible being examined
        FT)ro   rn   r   hasMatchingHierarchy)r   r  roleLists      r   isBuddyListzChat.isBuddyList  sC     ;11 	H||%%::3I	 r   c                     |r| j                  |      ry| j                  D ]3  }|d   t        j                  |fd      }| j                  |      s3 y y)zReturns True if obj is, or is inside of, the buddy list.

        Arguments:
        - obj: the accessible being examined
        - includeList: whether or not the list itself should be
          considered "in" the buddy list.
        Tr   c                 4    t        j                  |       k(  S r$   )r   get_role)r!   roles    r   <lambda>z$Chat.isInBuddyList.<locals>.<lambda>  s    h>O>OPQ>RVZ>Z r   F)r  ro   r   find_ancestor)r   r  includeListr  	candidater  s        @r   r   zChat.isInBuddyList  s_     4++C011 	HA;D ..s4Z[I	*		 r   c                 \    | j                  |      }| j                  j                  |       S )zReturns True if the given accessible is the chat history
        associated with a new conversation.

        Arguments:
        - obj: the accessible object to examine.
        )r   rw   rS   )r   r  rU   s      r   r  zChat.isNewConversation  s.     ++C0))99,GGGr   c                 6   |syd}t        j                  |      st        j                  |      r&t        j                  |      r| j                  |      }| j                  j                  D ]+  }|r||j                  k(  s|c S ||j                  k(  s)|c S  y)zAttempts to locate the conversation associated with obj.

        Arguments:
        - obj: the accessible of interest

        Returns the conversation if found; None otherwise
        Nr/   )
r   is_textr   is_entryr  r  rw   rO   r:   r;   )r   r  r:   rU   s       r   r   zChat.getConversation  s      $(9(9#(>&&s+'',D 22@@ 	$L<,,,'' ///##	$ r   c                     t        j                  |      rUt        j                  t        j                  |            r-t        j
                  |       xr t        j                  |      S y)zReturns True if the given accessible is the text object for
        associated with a chat room conversation.

        Arguments:
        - obj: the accessible object to examine.
        F)r   r  is_scroll_paner   
get_parentr  is_multi_liner  s     r   r  zChat.isChatRoomMsg8  sS     s#(B(B8CVCVWZC[(\"..s33V8Q8QRU8VVr   c                 &   t        j                  |      rR| j                  j                  j	                  |      }d|d|g}t        j                  t
        j                  |d       |S d|dg}t        j                  t
        j                  |d       y)zReturns True if we plan to treat this chat as focused for
        the purpose of deciding whether or not a message should be
        presented to the user.

        Arguments:
        - obj: the accessible object to examine.
        zINFO:z's window is focused chat:Tz!is not focused chat (not showing)F)r   
is_showingrn   r    topLevelObjectIsActiveAndCurrentr   printTokens
LEVEL_INFO)r   r  activetokenss       r   r  zChat.isFocusedChatD  s     !!#&\\++LLSQFs$@&IFe..=M3 CD%**FD9r   c                    d }t        j                  ||      }d}	 | j                  j                  j	                  |      }|j                         j                         | j                  j                  j                         j                         k7  r|}|st        j                  |t        j                        }	 | j                  j                  j	                  |      }|j                         j                         | j                  j                  j                         j                         k7  r|}|S |S # t        $ r Y w xY w# t        $ r Y |S w xY w)zAttempts to find the name of the current chat room.

        Arguments:
        - obj: The accessible of interest

        Returns a string containing what we think is the chat room name.
        c                 Z    t        j                  |       xs t        j                  |       S r$   )r   is_page_tabis_frame)r!   s    r   predz"Chat.getChatRoomName.<locals>.prede  s#    **1-H1E1Ea1HHr   r/   )r   r  rn   r   displayedTextlowerr   r:   r`   r   r-  )r   r  r.  ancestorr:   r   s         r   r  zChat.getChatRoomNameW  s#   	I ))#t4	<<))77ADzz|!!#t||'8'8'>'>'@'F'F'HH --c;3G3GHH||--;;HE::<%%'4<<+<+<+B+B+D+J+J+LLD t!  		  s%   A8D8 <A8E 8	EE	EEc                     t        j                  |j                        sy| j                  j                  j                         \  }}|dk(  r|j                  r|j                  dk7  ryy)zReturns True if event is associated with text being autocompleted.

        Arguments:
        - event: the accessible event being examined
        FTab	T)r   r  r   rn   r   lastKeyAndModifiersr   )r   r   lastKeymodss       r   r  zChat.isAutoCompletedTextEvent  sT     ""5<<0..BBDe5>>T3Ir   c                      y)zReturns True if event is associated with a change in typing status.

        Arguments:
        - event: the accessible event being examined
        Fr5   r   s     r   r   zChat.isTypingStatusChangedEvent  s     r   r   )T)r2   r3   r4   __doc__r   rt   ru   r   r   r   r   r   r   r   r   r  r   r  r   r  r   r  r   r  r  r  r  r   r5   r   r   rc   rc     s    ()T4&PAF
.$$";@$1L?B*A(P((	H#J
&'R r   rc   N)r9  __id____version____date____copyright____license__r/   r   r   r   r   r   r	   r
   r   r   r   	ax_objectr   ax_utilitiesr   r   r7   rM   rc   r5   r   r   <module>rA     sx   ( '	7            %!& !&RE$ E$Zi ibC
 C
r   