24 #ifndef OST_GUI_PYTHON_SHELL_WIDGET_HH
25 #define OST_GUI_PYTHON_SHELL_WIDGET_HH
36 #include <QPlainTextEdit>
38 namespace ost {
namespace gui {
42 class PythonCompleter;
48 typedef QHash<unsigned int,QTextBlock> OutputBlockList;
54 void SetTabWidth(
int width);
55 int GetTabWidth()
const;
57 QTextBlock GetEditStartBlock();
62 void Execute(
const QString& command);
63 void RequestCompletion(
const QRect& rect,
bool inline_completion);
64 void SetCompletionPrefix(
const QString& prefix);
65 void RequestPathCompletion(
const QRect& rect,
bool inline_completion);
66 void SetPathCompletionPrefix(
const QString& prefix);
69 void InsertCompletion(
const QString& completion);
70 void InsertPathCompletion(
const QString& completion);
71 void AppendOutput(
unsigned int id,
const QString& output);
72 void AppendError(
unsigned int id,
const QString& output);
73 void OutputFinished(
unsigned int id,
bool error);
74 void Complete(
bool inline_completion=
true);
75 void Recomplete(
const QString& completion);
77 void OnSingleLineStateEntered();
78 void OnMultiLineActiveStateEntered();
79 void OnMultiLineInactiveStateEntered();
80 void OnHistoryUpStateEntered();
81 void OnHistoryDownStateEntered();
82 void OnExecuteStateEntered();
84 void NewLineAtCursor();
85 void OnReadonlyEntered();
86 void OnReadwriteEntered();
87 void OnMixedToReadwrite();
89 void handle_completion_();
90 void handle_output_toggle_();
91 void handle_wrap_to_function_();
92 void handle_select_all_();
93 void handle_select_all_rw_();
94 void handle_delete_();
95 void handle_backspace_();
96 void handle_clear_all_();
99 virtual void resizeEvent(QResizeEvent* event);
100 virtual void showEvent(QShowEvent* event);
101 virtual void insertFromMimeData(
const QMimeData * source );
102 void set_output_visible_(
bool flag=
true);
103 void setup_readonly_state_machine_();
104 void setup_state_machine_();
105 void wrap_into_function_(
const QString& command);
106 void set_command_(
const QString& command);
109 void set_block_type_(
const QTextBlock& start,
const QTextBlock&
end,
BlockType type);