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

Class ChatControlBase

source code


A base class containing a banner, ConversationTextview, MessageTextView
Instance Methods [hide private]
 
make_href(self, match) source code
 
get_font_attrs(self)
Get pango font attributes for banner from theme settings
source code
 
get_nb_unread(self) source code
 
draw_banner(self)
Draw the fat line at the top of the window that houses the icon, jid, etc
source code
 
draw_banner_text(self)
Derived types SHOULD implement this
source code
 
update_ui(self)
Derived types SHOULD implement this
source code
 
repaint_themed_widgets(self)
Derived types MAY implement this
source code
 
_update_banner_state_image(self)
Derived types MAY implement this
source code
 
handle_message_textview_mykey_press(self, widget, event_keyval, event_keymod)
Derives types SHOULD implement this, rather than connection to the even itself
source code
 
status_url_clicked(self, widget, url) source code
 
setup_seclabel(self, combo) source code
 
on_seclabels_ready(self) source code
 
__init__(self, type_id, parent_win, widget_name, contact, acct, resource=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
set_speller(self) source code
 
on_banner_label_populate_popup(self, label, menu)
Override the default context menu and add our own menutiems
source code
 
shutdown(self)
Derived classes MUST implement this
source code
 
on_msg_textview_populate_popup(self, textview, menu)
Override the default context menu and we prepend an option to switch languages
source code
 
on_quote(self, widget, text) source code
 
_on_banner_eventbox_button_press_event(self, widget, event)
If right-clicked, show popup
source code
 
_on_send_button_clicked(self, widget)
When send button is pressed: send the current message
source code
 
_paint_banner(self)
Repaint banner with theme color
source code
 
disconnect_style_event(self, widget) source code
 
connect_style_event(self, widget, set_fg=False, set_bg=False) source code
 
_on_style_set_event(self, widget, style, *opts)
opts[0] == True -> set fg color opts[1] == True -> set bg color
source code
 
_conv_textview_key_press_event(self, widget, event) source code
 
show_emoticons_menu(self) source code
 
_on_message_textview_key_press_event(self, widget, event) source code
 
_on_message_textview_mykeypress_event(self, widget, event_keyval, event_keymod)
When a key is pressed: if enter is pressed without the shift key, message (if not empty) is sent and printed in the conversation
source code
 
_on_drag_data_received(self, widget, context, x, y, selection, target_type, timestamp)
Derived types SHOULD implement this
source code
 
_on_drag_leave(self, widget, context, time) source code
 
_on_drag_motion(self, widget, context, x, y, time) source code
 
get_seclabel(self) source code
 
send_message(self, message, keyID='', type_='chat', chatstate=None, msg_id=None, composing_xep=None, resource=None, xhtml=None, callback=None, callback_args=[], process_commands=True)
Send the given message to the active tab.
source code
 
save_sent_message(self, message) source code
 
print_conversation_line(self, text, kind, name, tim, other_tags_for_name=[], other_tags_for_time=[], other_tags_for_text=[], count_as_new=True, subject=None, old_kind=None, xhtml=None, simple=False, xep0184_id=None, graphics=True, displaymarking=None)
Print 'chat' type messages
source code
 
toggle_emoticons(self)
Hide show emoticons_button and make sure emoticons_menu is always there when needed
source code
 
append_emoticon(self, str_) source code
 
on_emoticons_button_clicked(self, widget)
Popup emoticons menu
source code
 
on_formattings_button_clicked(self, widget)
Popup formattings menu
source code
 
on_color_menuitem_activale(self, widget) source code
 
on_font_menuitem_activale(self, widget) source code
 
on_actions_button_clicked(self, widget)
Popup action menu
source code
 
update_font(self)
Derived classes SHOULD implement this
source code
 
update_tags(self)
Derived classes SHOULD implement this
source code
 
clear(self, tv) source code
 
_on_history_menuitem_activate(self, widget=None, jid=None)
When history menuitem is pressed: call history window
source code
 
_on_send_file(self, gc_contact=None)
gc_contact can be set when we are in a groupchat control
source code
 
on_minimize_menuitem_toggled(self, widget)
When a grouchat is minimized, unparent the tab, put it in roster etc
source code
 
set_control_active(self, state)
Called when the control becomes active (state is True) or inactive (state is False)
source code
 
bring_scroll_to_end(self, textview, diff_y=0)
Scroll to the end of textview if end is not visible
source code
 
scroll_to_end_iter(self, textview) source code
 
size_request(self, msg_textview, requisition)
When message_textview changes its size: if the new height will enlarge the window, enable the scrollbar automatic policy.
source code
 
on_conversation_vadjustment_changed(self, adjustment) source code
 
on_conversation_vadjustment_value_changed(self, adjustment) source code
 
redraw_after_event_removed(self, jid)
We just removed a 'printed_*' event, redraw contact in roster or gc_roster and titles in roster and msg_win
source code
 
sent_messages_scroll(self, direction, conv_buf) source code
 
lighten_color(self, color) source code
 
widget_set_visible(self, widget, state)
Show or hide a widget
source code
 
chat_buttons_set_visible(self, state)
Toggle chat buttons
source code
 
got_connected(self) source code
 
got_disconnected(self) source code

Inherited from message_control.MessageControl: allow_shutdown, get_full_jid, get_specific_unread, get_tab_image, get_tab_label, minimizable, prepare_context_menu, safe_shutdown, 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]
  keymap = gtk.gdk.keymap_get_default()
  keycode_c = 54
  keycode_ins = 118

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]

make_href(self, match)

source code 

get_font_attrs(self)

source code 
Get pango font attributes for banner from theme settings

get_nb_unread(self)

source code 

draw_banner(self)

source code 

Draw the fat line at the top of the window that houses the icon, jid, etc

Derived types MAY implement this.

draw_banner_text(self)

source code 
Derived types SHOULD implement this

update_ui(self)

source code 
Derived types SHOULD implement this
Overrides: message_control.MessageControl.update_ui

repaint_themed_widgets(self)

source code 
Derived types MAY implement this
Overrides: message_control.MessageControl.repaint_themed_widgets

_update_banner_state_image(self)

source code 
Derived types MAY implement this

handle_message_textview_mykey_press(self, widget, event_keyval, event_keymod)

source code 
Derives types SHOULD implement this, rather than connection to the even itself

status_url_clicked(self, widget, url)

source code 

setup_seclabel(self, combo)

source code 

on_seclabels_ready(self)

source code 

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

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

set_speller(self)

source code 

on_banner_label_populate_popup(self, label, menu)

source code 
Override the default context menu and add our own menutiems

shutdown(self)

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

on_msg_textview_populate_popup(self, textview, menu)

source code 
Override the default context menu and we prepend an option to switch languages

on_quote(self, widget, text)

source code 

_on_banner_eventbox_button_press_event(self, widget, event)

source code 
If right-clicked, show popup

_on_send_button_clicked(self, widget)

source code 
When send button is pressed: send the current message

_paint_banner(self)

source code 
Repaint banner with theme color

disconnect_style_event(self, widget)

source code 

connect_style_event(self, widget, set_fg=False, set_bg=False)

source code 

_on_style_set_event(self, widget, style, *opts)

source code 
Set style of widget from style class *.Frame.Eventbox
opts[0] == True -> set fg color opts[1] == True -> set bg color

_conv_textview_key_press_event(self, widget, event)

source code 

show_emoticons_menu(self)

source code 

_on_message_textview_key_press_event(self, widget, event)

source code 

_on_message_textview_mykeypress_event(self, widget, event_keyval, event_keymod)

source code 
When a key is pressed: if enter is pressed without the shift key, message (if not empty) is sent and printed in the conversation

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

source code 
Derived types SHOULD implement this

_on_drag_leave(self, widget, context, time)

source code 

_on_drag_motion(self, widget, context, x, y, time)

source code 

get_seclabel(self)

source code 

send_message(self, message, keyID='', type_='chat', chatstate=None, msg_id=None, composing_xep=None, resource=None, xhtml=None, callback=None, callback_args=[], process_commands=True)

source code 
Send the given message to the active tab. Doesn't return None if error
Overrides: message_control.MessageControl.send_message

save_sent_message(self, message)

source code 

print_conversation_line(self, text, kind, name, tim, other_tags_for_name=[], other_tags_for_time=[], other_tags_for_text=[], count_as_new=True, subject=None, old_kind=None, xhtml=None, simple=False, xep0184_id=None, graphics=True, displaymarking=None)

source code 
Print 'chat' type messages

toggle_emoticons(self)

source code 
Hide show emoticons_button and make sure emoticons_menu is always there when needed
Overrides: message_control.MessageControl.toggle_emoticons

append_emoticon(self, str_)

source code 

on_emoticons_button_clicked(self, widget)

source code 
Popup emoticons menu

on_formattings_button_clicked(self, widget)

source code 
Popup formattings menu

on_color_menuitem_activale(self, widget)

source code 

on_font_menuitem_activale(self, widget)

source code 

on_actions_button_clicked(self, widget)

source code 
Popup action menu

update_font(self)

source code 
Derived classes SHOULD implement this
Overrides: message_control.MessageControl.update_font
(inherited documentation)

update_tags(self)

source code 
Derived classes SHOULD implement this
Overrides: message_control.MessageControl.update_tags
(inherited documentation)

clear(self, tv)

source code 

_on_history_menuitem_activate(self, widget=None, jid=None)

source code 
When history menuitem is pressed: call history window

_on_send_file(self, gc_contact=None)

source code 
gc_contact can be set when we are in a groupchat control

on_minimize_menuitem_toggled(self, widget)

source code 
When a grouchat is minimized, unparent the tab, put it in roster etc

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)

bring_scroll_to_end(self, textview, diff_y=0)

source code 
Scroll to the end of textview if end is not visible

scroll_to_end_iter(self, textview)

source code 

size_request(self, msg_textview, requisition)

source code 
When message_textview changes its size: if the new height will enlarge the window, enable the scrollbar automatic policy. Also enable scrollbar automatic policy for horizontal scrollbar if message we have in message_textview is too big

on_conversation_vadjustment_changed(self, adjustment)

source code 

on_conversation_vadjustment_value_changed(self, adjustment)

source code 

redraw_after_event_removed(self, jid)

source code 
We just removed a 'printed_*' event, redraw contact in roster or gc_roster and titles in roster and msg_win

sent_messages_scroll(self, direction, conv_buf)

source code 

lighten_color(self, color)

source code 

widget_set_visible(self, widget, state)

source code 
Show or hide a widget

chat_buttons_set_visible(self, state)

source code 
Toggle chat buttons
Overrides: message_control.MessageControl.chat_buttons_set_visible

got_connected(self)

source code 
Overrides: message_control.MessageControl.got_connected

got_disconnected(self)

source code 
Overrides: message_control.MessageControl.got_disconnected

Class Variable Details [hide private]

keymap

Value:
gtk.gdk.keymap_get_default()

keycode_c

Value:
54

keycode_ins

Value:
118