IAEX::InputCell Class Reference

Describes how an inputcell works. More...

Inheritance diagram for IAEX::InputCell:

IAEX::Cell List of all members.

Public Slots

void eval ()
 Sends the content of the inputcell to the evaluator. Displays the result in a outputcell.
void command ()
 Get/Insert the command that match the last word in the input editor.
void nextCommand ()
 Get/Insert the next command that match the last word in the input editor.
void nextField ()
 Select the next field in the command, if any exists.
void clickEvent ()
void clickEventOutput ()
void contentChanged ()
void setText (QString text)
 Set text to the cell.
void setTextHtml (QString html)
 Sets the visible text using html code.
virtual void setTextOutput (QString output)
 Set text to the output part of the cell.
virtual void setTextOutputHtml (QString html)
 Sets the output text using html code.
void setStyle (const QString &stylename)
 Set cell style.
void setStyle (CellStyle style)
 Set cell style.
void setChapterCounter (QString number)
 set the chapter counter
QString ChapterCounter ()
 return the value of the chapter counter, as plain text. Returns null if the counter is empty
QString ChapterCounterHtml ()
 return the value of the chapter counter, as html code. Returns null if the counter is empty
void setReadOnly (const bool readonly)
void setEvaluated (const bool evaluated)
void setClosed (const bool closed)
virtual void setFocus (const bool focus)
virtual void setFocusOutput (const bool focus)

Public Member Functions

 InputCell (Document *doc, QWidget *parent=0)
 The class constructor.
virtual ~InputCell ()
 The class destructor.
QString text ()
 Returns the text (as plain text) fromthe cell.
QString textHtml ()
 Return the text inside the cell as Html code.
virtual QString textOutput ()
 Return the text inside the output part of the cell as plain text.
virtual QString textOutputHtml ()
 Return the text inside the output part of the cell as html code.
virtual QTextCursor textCursor ()
 Return the text cursor to the QTextEdit that make up the inputpart of the inputcell.
virtual QTextEdit * textEdit ()
 Return the input texteditor.
virtual QTextEdit * textEditOutput ()
 Return the output texteditor.
virtual void addCellWidgets ()
 Do not use this member.
void setDelegate (InputCellDelegate *d)
 Sets the evaulator delegate.
virtual void accept (Visitor &v)
 Implements visitor acceptability.
virtual bool isClosed ()
 Returns true if inputcell is closed, otherwise the method returns false.
virtual bool isEditable ()
 Function for telling if the user is allowed to change the text settings for the text inside the cell. User isn't allowed to change the text settings for inputcell so this function always return false.
virtual bool isEvaluated ()
 Returns true if inputcell is evaluated, returns false if inputcell haven't been evaluated.
virtual bool isPlot (QString text=QString::null)
 Returns true if the expression in the text is a plot command, returns false otherwise. If no text is sent to the method it will test the text in the input part of the cell.

Protected Member Functions

void resizeEvent (QResizeEvent *event)
void clear ()
 resets the input cell. Removes all output data and restores the initial state.

Detailed Description

Describes how an inputcell works.

Author:
Ingemar Axelsson and Anders Fernström
Input cells is places where the user can do input. To evaluate the content of an inputcell just press shift+enter. It will throw an exception if it cant find OMC. Start OMC with following commandline:

# omc +d=interactiveCorba

Todo:
Make it possiblee to add and change syntax coloring of code.(Ingemar Axelsson)


Constructor & Destructor Documentation

IAEX::InputCell::InputCell Document doc,
QWidget *  parent = 0
 

The class constructor.

Author:
Ingemar Axelsson and Anders Fernström
Date:
2005-11-23 (update)
2005-10-27 AF, updated the method due to porting from Q3Support to pure QT4 classes. 2005-11-23 AF, added document to the constructor, because need the document to insert images to the output part if ploting.

IAEX::InputCell::~InputCell  )  [virtual]
 

The class destructor.

Author:
Ingemar Axelsson and Anders Fernström


Member Function Documentation

void IAEX::InputCell::addCellWidgets  )  [virtual]
 

Do not use this member.

This is an ugly part of the cell structure.

Reimplemented from IAEX::Cell.

QString IAEX::InputCell::ChapterCounter  )  [slot]
 

return the value of the chapter counter, as plain text. Returns null if the counter is empty

Author:
Anders Fernström
Date:
2006-03-02

QString IAEX::InputCell::ChapterCounterHtml  )  [slot]
 

return the value of the chapter counter, as html code. Returns null if the counter is empty

Author:
Anders Fernström
Date:
2006-03-03

void IAEX::InputCell::clickEvent  )  [slot]
 

Author:
Ingemar Axelsson and Anders Fernström

void IAEX::InputCell::clickEventOutput  )  [slot]
 

Author:
Anders Fernström

void IAEX::InputCell::command  )  [slot]
 

Get/Insert the command that match the last word in the input editor.

Author:
Anders Fernström
Date:
2005-12-15

void IAEX::InputCell::contentChanged  )  [slot]
 

Author:
Anders Fernström and Ingemar Axelsson
Date:
2006-04-10 (update)
Recalculates height.

2005-10-31 AF, Large part of this function was changes due to porting to QT4 (changes from Q3TextBrowser to QTextBrowser). 2006-04-10 AF, emits heightChanged if the height changes

void IAEX::InputCell::eval  )  [slot]
 

Sends the content of the inputcell to the evaluator. Displays the result in a outputcell.

Author:
Ingemar Axelsson and Anders Fernström
Date:
2006-04-18 (update)
2005-11-01 AF, updated so the text that is sent to be evaled isn't in html code. 2005-11-17 AF, added a check if the result if empty, if so add some default text 2005-11-23 AF, added support for inserting image to output 2006-04-18 AF, uses environment variable to find the plot

Removes whitespaces and tags from the content string. Then sends the content to the delegate object for evaluation. The result is printed in a output cell. No indentation and syntax highlightning is used in the output cell.

bool IAEX::InputCell::isClosed  )  [virtual]
 

Returns true if inputcell is closed, otherwise the method returns false.

Author:
Anders Fernström
Date:
2006-01-17
Returns:
State of inputcell (closed or not)

bool IAEX::InputCell::isEditable  )  [virtual]
 

Function for telling if the user is allowed to change the text settings for the text inside the cell. User isn't allowed to change the text settings for inputcell so this function always return false.

Author:
Anders Fernström
Date:
2005-10-27
Returns:
False

Implements IAEX::Cell.

bool IAEX::InputCell::isEvaluated  )  [virtual]
 

Returns true if inputcell is evaluated, returns false if inputcell haven't been evaluated.

Author:
Anders Fernström
Date:
2005-11-23
Returns:
State of inputcell (evaluated or not)

bool IAEX::InputCell::isPlot QString  text = QString::null  )  [virtual]
 

Returns true if the expression in the text is a plot command, returns false otherwise. If no text is sent to the method it will test the text in the input part of the cell.

Author:
Anders Fernström
Date:
2005-11-23
Parameters:
text The text that should be tested, if no text the inputpart of the cell will be tested.
Returns:
If plot command or not

void IAEX::InputCell::nextCommand  )  [slot]
 

Get/Insert the next command that match the last word in the input editor.

Author:
Anders Fernström
Date:
2005-12-15

void IAEX::InputCell::nextField  )  [slot]
 

Select the next field in the command, if any exists.

Author:
Anders Fernström
Date:
2005-12-15

void IAEX::InputCell::resizeEvent QResizeEvent *  event  )  [protected]
 

Resize textcell when the mainwindow is resized. This because the cellcontent should always be visible.

Added by AF, copied from textcell.cpp

Reimplemented from IAEX::Cell.

void IAEX::InputCell::setChapterCounter QString  number  )  [slot]
 

set the chapter counter

Author:
Anders Fernström
Date:
2006-03-02

void IAEX::InputCell::setClosed const bool  closed  )  [virtual, slot]
 

Author:
Ingemar Axelsson (and Anders Fernström)
Date:
2005-11-01 (update)
Set if the output part of the cell shoud be closed(hidden) or not.

2005-11-01 AF, Made some small changes to how the function calculate the new height, to reflect the changes made when porting from Q3TextEdit to QTextEdit.

Reimplemented from IAEX::Cell.

void IAEX::InputCell::setEvaluated const bool  evaluated  )  [slot]
 

Author:
Anders Fernström
Date:
2006-01-16
Set evaluated value on the texteditor

Parameters:
evaluated The boolean value of evaluated property

void IAEX::InputCell::setFocus const bool  focus  )  [virtual, slot]
 

Author:
Ingemar Axelsson and Anders Fernström

Implements IAEX::Cell.

void IAEX::InputCell::setFocusOutput const bool  focus  )  [virtual, slot]
 

Author:
Anders Fernström

void IAEX::InputCell::setReadOnly const bool  readonly  )  [virtual, slot]
 

Author:
Anders Fernström
Date:
2005-11-01

2006-03-02 (update)

Set readonly value on the texteditor

Parameters:
readonly The boolean value of readonly property
2006-03-02 AF, clear text selection in chapter counter

Reimplemented from IAEX::Cell.

void IAEX::InputCell::setStyle CellStyle  style  )  [virtual, slot]
 

Set cell style.

Author:
Anders Fernström
Date:
2005-10-27

2006-03-02 (update)

IMPORTANT: User shouldn't be able to change style on inputcells so this function always use "Input" as style.

2005-11-03 AF, updated so the text is selected when the style is changed, after the text is unselected. 2006-03-02 AF, set chapter style

Parameters:
style The cell style that is to be applyed to the cell

Reimplemented from IAEX::Cell.

void IAEX::InputCell::setStyle const QString &  stylename  )  [virtual, slot]
 

Set cell style.

Author:
Anders Fernström
Date:
2005-10-28
IMPORTANT: User shouldn't be able to change style on inputcells so this function always use "Input" as style.

Parameters:
stylename The style name of the style that is to be applyed to the cell

Reimplemented from IAEX::Cell.

void IAEX::InputCell::setText QString  text  )  [virtual, slot]
 

Set text to the cell.

Author:
Ingemar Axelsson and Anders Fernström
Date:
2005-12-16 (update)
Parameters:
text The text that should be placed inside the cell
2005-10-04 AF, added some code for removing/replacing some text 2005-10-27 AF, updated the function due to porting from qt3 to qt4 2005-12-08 AF, added code that removed any <span style tags added in the parser. 2005-12-16 AF, block signlas so syntax highligher isn't done more than once.

Reimplemented from IAEX::Cell.

void IAEX::InputCell::setTextHtml QString  html  )  [virtual, slot]
 

Sets the visible text using html code.

Author:
Anders Fernström
Date:
2005-11-01
Sets the text that should be visible using html code. Can change the cellheight if the text is very long.

Parameters:
html Html code that should be visible as normal text inside the cell mainarea.

Reimplemented from IAEX::Cell.

void IAEX::InputCell::setTextOutput QString  text  )  [virtual, slot]
 

Set text to the output part of the cell.

Author:
Anders Fernström
Date:
2005-11-23
Parameters:
text The text that should be placed inside the output part

void IAEX::InputCell::setTextOutputHtml QString  html  )  [virtual, slot]
 

Sets the output text using html code.

Author:
Anders Fernström
Date:
2005-11-23
Sets the text that should be visible in the output part of the cell using html code. Can change the cellheight if the text is very long.

Parameters:
html Html code that should be visible as normal text inside the cell mainarea.

QString IAEX::InputCell::text  )  [virtual]
 

Returns the text (as plain text) fromthe cell.

Author:
Anders Fernström
Date:
2005-10-27
Returns:
The text, as plain text

Implements IAEX::Cell.

QTextCursor IAEX::InputCell::textCursor  )  [virtual]
 

Return the text cursor to the QTextEdit that make up the inputpart of the inputcell.

Author:
Anders Fernström
Date:
2005-10-27
Returns:
Text cursor to the cell

Reimplemented from IAEX::Cell.

QTextEdit * IAEX::InputCell::textEdit  )  [virtual]
 

Return the input texteditor.

Author:
Anders Fernström
Date:
2006-01-05
Returns:
Texteditor for the inputpart of the inputcell

Reimplemented from IAEX::Cell.

QTextEdit * IAEX::InputCell::textEditOutput  )  [virtual]
 

Return the output texteditor.

Author:
Anders Fernström
Date:
2006-02-03
Returns:
Texteditor for the output part of the inputcell

QString IAEX::InputCell::textHtml  )  [virtual]
 

Return the text inside the cell as Html code.

Author:
Anders Fernström
Date:
2005-10-27
Returns:
Html code

Reimplemented from IAEX::Cell.

QString IAEX::InputCell::textOutput  )  [virtual]
 

Return the text inside the output part of the cell as plain text.

Author:
Anders Fernström
Date:
2005-11-23
Returns:
output text

QString IAEX::InputCell::textOutputHtml  )  [virtual]
 

Return the text inside the output part of the cell as html code.

Author:
Anders Fernström
Date:
2005-11-23
Returns:
html code


The documentation for this class was generated from the following files:
Generated on Mon May 15 11:07:42 2006 for OMNotebook by  doxygen 1.4.6-NO