Module chat_control :: Class ChatControl
[hide private]
[frames] | no frames]

Class ChatControl

source code


A control for standard 1-1 chat
Instance Methods [hide private]
 
__init__(self, parent_win, contact, acct, session, resource=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
update_toolbar(self) source code
 
update_all_pep_types(self) source code
 
update_pep(self, pep_type) source code
 
_update_jingle(self, jingle_type) source code
 
update_audio(self) source code
 
update_video(self) source code
 
change_resource(self, resource) source code
 
stop_jingle(self, sid=None, reason=None) source code
 
_set_jingle_state(self, jingle_type, state, sid=None, reason=None) source code
 
set_audio_state(self, state, sid=None, reason=None) source code
 
set_video_state(self, state, sid=None, reason=None) source code
 
_get_audio_content(self) source code
 
on_num_button_pressed(self, widget, num) source code
 
on_num_button_released(self, released) source code
 
on_dtmf_button_clicked(self, widget) source code
 
on_dtmf_window_focus_out_event(self, widget, event) source code
 
on_mic_hscale_value_changed(self, widget, value) source code
 
on_sound_hscale_value_changed(self, widget, value) source code
 
on_avatar_eventbox_enter_notify_event(self, widget, event)
Enter the eventbox area so we under conditions add a timeout to show a bigger avatar after 0.5 sec
source code
 
on_avatar_eventbox_leave_notify_event(self, widget, event)
Left the eventbox area that holds the avatar img
source code
 
on_avatar_eventbox_button_press_event(self, widget, event)
If right-clicked, show popup
source code
 
on_location_eventbox_button_release_event(self, widget, event) source code
 
_on_window_motion_notify(self, widget, event)
It gets called no matter if it is the active window or not
source code
 
_schedule_activity_timers(self) source code
 
update_ui(self)
Derived types SHOULD implement this
source code
 
_update_banner_state_image(self)
Derived types MAY implement this
source code
 
draw_banner_text(self)
Draw the text in the fat line at the top of the window that houses the name, jid
source code
 
close_jingle_content(self, jingle_type) source code
 
on_jingle_button_toggled(self, widget, jingle_type) source code
 
on_audio_button_toggled(self, widget) source code
 
on_video_button_toggled(self, widget) source code
 
_toggle_gpg(self) source code
 
_show_lock_image(self, visible, enc_type='', enc_enabled=False, chat_logged=False, authenticated=False)
Set lock icon visibility and create tooltip
source code
 
_on_authentication_button_clicked(self, widget) source code
 
send_message(self, message, keyID='', chatstate=None, xhtml=None, process_commands=True)
Send a message to contact
source code
 
check_for_possible_paused_chatstate(self, arg)
Did we move mouse of that window or write something in message textview in the last 5 seconds? If yes - we go active for mouse, composing for kbd.
source code
 
check_for_possible_inactive_chatstate(self, arg)
Did we move mouse over that window or wrote something in message textview in the last 30 seconds? if yes - we go active.
source code
 
reset_kbd_mouse_timeout_vars(self) source code
 
on_cancel_session_negotiation(self) source code
 
print_esession_details(self)
Print esession settings to textview
source code
 
print_conversation(self, text, frm='', tim=None, encrypted=False, subject=None, xhtml=None, simple=False, xep0184_id=None, displaymarking=None)
Print a line in the conversation
source code
 
get_tab_label(self, chatstate)
Return a suitable tab label string.
source code
 
get_tab_image(self, count_unread=True) source code
 
prepare_context_menu(self, hide_buttonbar_items=False)
Set compact view menuitem active state sets active and sensitivity state for toggle_gpg_menuitem sets sensitivity for history_menuitem (False for tranasports) and file_transfer_menuitem and hide()/show() for add_to_roster_menuitem
source code
 
send_chatstate(self, state, contact=None)
Send OUR chatstate as STANDLONE chat state message (eg.
source code
 
shutdown(self)
Derived classes MUST implement this
source code
 
minimizable(self)
Called to check if control can be minimized
source code
 
safe_shutdown(self)
Called to check if control can be closed without loosing data.
source code
 
allow_shutdown(self, method, on_yes, on_no, on_minimize)
Called to check is a control is allowed to shutdown.
source code
 
handle_incoming_chatstate(self)
Handle incoming chatstate that jid SENT TO us
source code
 
set_control_active(self, state)
Called when the control becomes active (state is True) or inactive (state is False)
source code
 
show_avatar(self) source code
 
_on_drag_data_received(self, widget, context, x, y, selection, target_type, timestamp)
Derived types SHOULD implement this
source code
 
_on_message_tv_buffer_changed(self, textbuffer) source code
 
restore_conversation(self) source code
 
read_queue(self)
Read queue and print messages containted in it
source code
 
show_bigger_avatar(self, small_avatar)
Resize the avatar, if needed, so it has at max half the screen size and shows it
source code
 
_on_window_avatar_leave_notify_event(self, widget, event)
Just left the popup window that holds avatar
source code
 
_on_window_motion_notify_event(self, widget, event)
Just moved the mouse so show the cursor
source code
 
_on_send_file_menuitem_activate(self, widget) source code
 
_on_add_to_roster_menuitem_activate(self, widget) source code
 
_on_contact_information_menuitem_activate(self, widget) source code
 
_on_toggle_gpg_menuitem_activate(self, widget) source code
 
_on_convert_to_gc_menuitem_activate(self, widget)
User wants to invite some friends to chat
source code
 
_on_toggle_e2e_menuitem_activate(self, widget) source code
 
begin_e2e_negotiation(self) source code
 
got_connected(self) source code
 
update_status_display(self, name, uf_show, status)
Print the contact's status and update the status/GPG image
source code

Inherited from ChatControlBase: append_emoticon, bring_scroll_to_end, chat_buttons_set_visible, clear, connect_style_event, disconnect_style_event, draw_banner, get_font_attrs, get_nb_unread, get_seclabel, got_disconnected, handle_message_textview_mykey_press, lighten_color, make_href, on_actions_button_clicked, on_banner_label_populate_popup, on_color_menuitem_activale, on_conversation_vadjustment_changed, on_conversation_vadjustment_value_changed, on_emoticons_button_clicked, on_font_menuitem_activale, on_formattings_button_clicked, on_minimize_menuitem_toggled, on_msg_textview_populate_popup, on_quote, on_seclabels_ready, print_conversation_line, redraw_after_event_removed, repaint_themed_widgets, save_sent_message, scroll_to_end_iter, sent_messages_scroll, set_speller, setup_seclabel, show_emoticons_menu, size_request, status_url_clicked, toggle_emoticons, update_font, update_tags, widget_set_visible

Inherited from message_control.MessageControl: get_full_jid, get_specific_unread, set_session

Inherited from command_system.implementation.middleware.ChatCommandProcessor: command_postprocessor, command_preprocessor, execute_command, looks_like_command, process_as_command

Inherited from command_system.framework.CommandProcessor: get_command, list_commands

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Inherited from command_system.implementation.middleware.CommandTools: add_history, append_with_tags, clear_input, echo, echo_error, install_tags, send, set_input, shift_line

Class Variables [hide private]
  TYPE_ID = 'chat'
  old_msg_kind = None
  COMMAND_HOST = ChatCommands

Inherited from ChatControlBase: keycode_c, keycode_ins, keymap

Inherited from command_system.framework.CommandProcessor: COMMAND_PREFIX

Properties [hide private]

Inherited from object: __class__

Inherited from command_system.implementation.middleware.CommandTools: connection, full_jid

Method Details [hide private]

__init__(self, parent_win, contact, acct, session, resource=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: command_system.implementation.middleware.CommandTools.__init__

update_toolbar(self)

source code 

update_all_pep_types(self)

source code 

update_pep(self, pep_type)

source code 

_update_jingle(self, jingle_type)

source code 

update_audio(self)

source code 

update_video(self)

source code 

change_resource(self, resource)

source code 

stop_jingle(self, sid=None, reason=None)

source code 

_set_jingle_state(self, jingle_type, state, sid=None, reason=None)

source code 

set_audio_state(self, state, sid=None, reason=None)

source code 

set_video_state(self, state, sid=None, reason=None)

source code 

_get_audio_content(self)

source code 

on_num_button_pressed(self, widget, num)

source code 

on_num_button_released(self, released)

source code 

on_dtmf_button_clicked(self, widget)

source code 

on_dtmf_window_focus_out_event(self, widget, event)

source code 

on_mic_hscale_value_changed(self, widget, value)

source code 

on_sound_hscale_value_changed(self, widget, value)

source code 

on_avatar_eventbox_enter_notify_event(self, widget, event)

source code 
Enter the eventbox area so we under conditions add a timeout to show a bigger avatar after 0.5 sec

on_avatar_eventbox_leave_notify_event(self, widget, event)

source code 
Left the eventbox area that holds the avatar img

on_avatar_eventbox_button_press_event(self, widget, event)

source code 
If right-clicked, show popup

on_location_eventbox_button_release_event(self, widget, event)

source code 

_on_window_motion_notify(self, widget, event)

source code 
It gets called no matter if it is the active window or not

_schedule_activity_timers(self)

source code 

update_ui(self)

source code 
Derived types SHOULD implement this
Overrides: message_control.MessageControl.update_ui
(inherited documentation)

_update_banner_state_image(self)

source code 
Derived types MAY implement this
Overrides: ChatControlBase._update_banner_state_image
(inherited documentation)

draw_banner_text(self)

source code 
Draw the text in the fat line at the top of the window that houses the name, jid
Overrides: ChatControlBase.draw_banner_text

close_jingle_content(self, jingle_type)

source code 

on_jingle_button_toggled(self, widget, jingle_type)

source code 

on_audio_button_toggled(self, widget)

source code 

on_video_button_toggled(self, widget)

source code 

_toggle_gpg(self)

source code 

_show_lock_image(self, visible, enc_type='', enc_enabled=False, chat_logged=False, authenticated=False)

source code 
Set lock icon visibility and create tooltip

_on_authentication_button_clicked(self, widget)

source code 

send_message(self, message, keyID='', chatstate=None, xhtml=None, process_commands=True)

source code 
Send a message to contact
Overrides: message_control.MessageControl.send_message

check_for_possible_paused_chatstate(self, arg)

source code 
Did we move mouse of that window or write something in message textview in the last 5 seconds? If yes - we go active for mouse, composing for kbd. If not - we go paused if we were previously composing

check_for_possible_inactive_chatstate(self, arg)

source code 
Did we move mouse over that window or wrote something in message textview in the last 30 seconds? if yes - we go active. If no - we go inactive

reset_kbd_mouse_timeout_vars(self)

source code 

on_cancel_session_negotiation(self)

source code 

print_esession_details(self)

source code 
Print esession settings to textview

print_conversation(self, text, frm='', tim=None, encrypted=False, subject=None, xhtml=None, simple=False, xep0184_id=None, displaymarking=None)

source code 

Print a line in the conversation

If frm is set to status: it's a status message.
if frm is set to error: it's an error message. The difference between
        status and error is mainly that with error, msg count as a new message
        (in systray and in control).
If frm is set to info: it's a information message.
If frm is set to print_queue: it is incomming from queue.
If frm is set to another value: it's an outgoing message.
If frm is not set: it's an incomming message.

get_tab_label(self, chatstate)

source code 

Return a suitable tab label string. Returns a tuple such as: (label_str, color) either of which can be None if chatstate is given that means we have HE SENT US a chatstate and we want it displayed

Derivded classes MUST implement this.

Overrides: message_control.MessageControl.get_tab_label
(inherited documentation)

get_tab_image(self, count_unread=True)

source code 
Overrides: message_control.MessageControl.get_tab_image

prepare_context_menu(self, hide_buttonbar_items=False)

source code 
Set compact view menuitem active state sets active and sensitivity state for toggle_gpg_menuitem sets sensitivity for history_menuitem (False for tranasports) and file_transfer_menuitem and hide()/show() for add_to_roster_menuitem
Overrides: message_control.MessageControl.prepare_context_menu

send_chatstate(self, state, contact=None)

source code 
Send OUR chatstate as STANDLONE chat state message (eg. no body) to contact only if new chatstate is different from the previous one if jid is not specified, send to active tab

shutdown(self)

source code 
Derived classes MUST implement this
Overrides: message_control.MessageControl.shutdown
(inherited documentation)

minimizable(self)

source code 

Called to check if control can be minimized

Derived classes MAY implement this.

Overrides: message_control.MessageControl.minimizable
(inherited documentation)

safe_shutdown(self)

source code 

Called to check if control can be closed without loosing data. returns True if control can be closed safely else False

Derived classes MAY implement this.

Overrides: message_control.MessageControl.safe_shutdown
(inherited documentation)

allow_shutdown(self, method, on_yes, on_no, on_minimize)

source code 

Called to check is a control is allowed to shutdown. If a control is not in a suitable shutdown state this method should call on_response_no, else on_response_yes or on_response_minimize

Derived classes MAY implement this.

Overrides: message_control.MessageControl.allow_shutdown
(inherited documentation)

handle_incoming_chatstate(self)

source code 
Handle incoming chatstate that jid SENT TO us

set_control_active(self, state)

source code 
Called when the control becomes active (state is True) or inactive (state is False)
Overrides: message_control.MessageControl.set_control_active
(inherited documentation)

show_avatar(self)

source code 

_on_drag_data_received(self, widget, context, x, y, selection, target_type, timestamp)

source code 
Derived types SHOULD implement this
Overrides: ChatControlBase._on_drag_data_received
(inherited documentation)

_on_message_tv_buffer_changed(self, textbuffer)

source code 

restore_conversation(self)

source code 

read_queue(self)

source code 
Read queue and print messages containted in it

show_bigger_avatar(self, small_avatar)

source code 
Resize the avatar, if needed, so it has at max half the screen size and shows it

_on_window_avatar_leave_notify_event(self, widget, event)

source code 
Just left the popup window that holds avatar

_on_window_motion_notify_event(self, widget, event)

source code 
Just moved the mouse so show the cursor

_on_send_file_menuitem_activate(self, widget)

source code 

_on_add_to_roster_menuitem_activate(self, widget)

source code 

_on_contact_information_menuitem_activate(self, widget)

source code 

_on_toggle_gpg_menuitem_activate(self, widget)

source code 

_on_convert_to_gc_menuitem_activate(self, widget)

source code 
User wants to invite some friends to chat

_on_toggle_e2e_menuitem_activate(self, widget)

source code 

begin_e2e_negotiation(self)

source code 

got_connected(self)

source code 
Overrides: message_control.MessageControl.got_connected

update_status_display(self, name, uf_show, status)

source code 
Print the contact's status and update the status/GPG image

Class Variable Details [hide private]

TYPE_ID

Value:
'chat'

old_msg_kind

Value:
None

COMMAND_HOST

Value:
ChatCommands