IAEX::TextCell Class Reference

A concrete cellclass using QTextEdit as mainwidget. More...

Inheritance diagram for IAEX::TextCell:

IAEX::Cell List of all members.

Public Slots

void clickEvent ()
void setText (QString text)
 Sets the visible text.
void setText (QString text, QTextCharFormat format)
 Sets the visible text, given an specific text format.
void setTextHtml (QString html)
 Sets the visible 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)
virtual void setFocus (const bool focus)

Public Member Functions

 TextCell (QWidget *parent=0)
 The class constructor.
virtual ~TextCell ()
 The class destructor.
QString text ()
 Returns the text (as plain text) from the mainarea.
QString textHtml ()
 Return the text inside the cell as Html code.
QTextCursor textCursor ()
 Return the text cursor to the QTextBrowser that make up mainarea of the cell.
QTextEdit * textEdit ()
 Return the text editor that make up the cell.
virtual void accept (Visitor &v)
 Implements visitor acceptability.
virtual bool isEditable ()
 Function for telling if the user is allowed to change the text settings for the text inside the cell. User is allowed to change the text settings for textcell so this function always return true.
virtual void viewExpression (const bool expr)

Protected Slots

void contentChanged ()
void hoverOverLink (const QUrl &link)
void openLinkInternal (const QUrl *url)
void textChangedInternal ()
void charFormatChanged (const QTextCharFormat &)

Protected Member Functions

void resizeEvent (QResizeEvent *event)

Detailed Description

A concrete cellclass using QTextEdit as mainwidget.

Author:
Ingemar Axelsson and Anders Fernström
TextCell is a class that fulfills the Cell interface. It has the behavior of both QTextEdit and Cell. It is used to display texts in a cell. It supports simple undo, redo, cut, copy, paste. The text can be edited if the setReadOnly flag is set to false. Otherwise text is just selectable. The later is the default.

Todo:
Add members to fulfill the QTextEdit interface. This is very nice when it is needed.(Ingemar Axelsson)
Bug:
Set so tab focuses on next cell.


Constructor & Destructor Documentation

IAEX::TextCell::TextCell QWidget *  parent = 0  ) 
 

The class constructor.

Author:
Ingemar Axelsson (and Anders Fernström)
Date:
2005-10-31 (update)

IAEX::TextCell::~TextCell  )  [virtual]
 

The class destructor.

Author:
Ingemar Axelsson


Member Function Documentation

QString IAEX::TextCell::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::TextCell::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::TextCell::charFormatChanged const QTextCharFormat &   )  [protected, slot]
 

Author:
Anders Fernström
Date:
2006-01-17
set the correct style if the charFormat is changed and the cell is empty. This is done because otherwise the style is lost if all text is removed inside a cell.

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

Author:
Ingemar Axelsson and Anders Fernström
send a clicked signal if the user clicks on the cell

void IAEX::TextCell::contentChanged  )  [protected, 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::TextCell::hoverOverLink const QUrl &  link  )  [protected, slot]
 

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

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

Function for telling if the user is allowed to change the text settings for the text inside the cell. User is allowed to change the text settings for textcell so this function always return true.

Author:
Anders Fernström
Date:
2005-10-28
Returns:
True

Implements IAEX::Cell.

void IAEX::TextCell::openLinkInternal const QUrl *  url  )  [protected, slot]
 

Author:
Ingemar Axelsson
Bug:
The link is removed if the sourcefile does not exists. This is strange.

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

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

Reimplemented from IAEX::Cell.

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

set the chapter counter

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

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

Author:
Ingemar Axelsson

Implements IAEX::Cell.

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

Author:
Ingemar Axelsson and Anders Fernström
Date:
2006-03-02 (update)
Set readonly value on the texteditor

2005-10-31 AF, removed the change in framstyle, looks better now 2005-11-01 AF, clear text selection when text edit is set to readonly 2006-03-02 AF, clear text selection in chapter counter

Parameters:
readonly The boolean value of readonly property

Reimplemented from IAEX::Cell.

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

Set cell style.

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

2006-03-02 (update)

Parameters:
style The cell style that is to be applyed to the cell
2005-11-03 AF, updated so the text is selected when the style is changed, after the text is unselected. 2005-11-15 AF, added trick to make sure that links are displayed correctly 2006-01-17 AF, removed trick to make sure the links are displaed correctly 2006-03-02 AF, set chapter style

Todo:
right now all the text inside the cell is changed, when changing style. Text that have been changed from the cells style (for example words made bold) should be uneffected by the change in cellstyle. Right now this function is used when the user sets text to change the hole text to the cellstyle. /AF

Reimplemented from IAEX::Cell.

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

Set cell style.

Author:
Anders Fernström
Date:
2005-10-28
Parameters:
stylename The style name of the style that is to be applyed to the cell

Reimplemented from IAEX::Cell.

void IAEX::TextCell::setText QString  text,
QTextCharFormat  format
[virtual, slot]
 

Sets the visible text, given an specific text format.

Author:
Anders Fernström
Date:
2005-10-28
Sets the text that should be visible and uses the text format that's sent to the function. Can change the cellheight if the text is very long.

Parameters:
text Text that should be visible inside the cell mainarea.
format Text format that should be used on the text

Reimplemented from IAEX::Cell.

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

Sets the visible text.

Author:
Ingemar Axelsson and Anders Fernström
Date:
2005-11-03 (update)
Sets the text that should be visible. Can change the cellheight if the text is very long.

2005-11-02 AF, Ported the project to QT4, so I needed to add a check if the text is html code. If it's html code, just the correkt set function in QTextEdit. 2005-11-03 AF, Updated the html check

Parameters:
text Text that should be visible inside the cell mainarea.

Reimplemented from IAEX::Cell.

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

Sets the visible text using html code.

Author:
Anders Fernström
Date:
2005-10-28
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.

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

Returns the text (as plain text) from the mainarea.

Author:
Anders Fernström
Date:
2005-10-28
Returns:
The text inside the cell., as plain text

Implements IAEX::Cell.

void IAEX::TextCell::textChangedInternal  )  [protected, slot]
 

Author:
Anders Fernström

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

Return the text cursor to the QTextBrowser that make up mainarea of the cell.

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

Reimplemented from IAEX::Cell.

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

Return the text editor that make up the cell.

Author:
Anders Fernström
Date:
2005-10-28
Returns:
The text editor inside the cell

Reimplemented from IAEX::Cell.

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

Return the text inside the cell as Html code.

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

Reimplemented from IAEX::Cell.

void IAEX::TextCell::viewExpression const bool  expr  )  [virtual]
 

Author:
Ingemar Axelsson and Anders Fernström
Date:
2005-11-01 (update)
toggle between showing the html code in the cell and normal plain text.

2005-11-01 AF, Remade the function to reflect the new QTextEdit

Reimplemented from IAEX::Cell.


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