- Main Page
- Classes
- Files
- Related Pages
- Examples

- Class List
- Class Hierarchy
- Class Members

# IAEX::Cell Class Reference

Cellinterface contains all functionality required to be a cell. More...

Inheritance diagram for IAEX::Cell:

List of all members.

## Public Slots
virtual void | addRule (Rule *r)
| Adds a rule to the cell.
virtual void | setStyle (const QString &stylename)
| Set cell style.
virtual void | setStyle (CellStyle style)
| Set the current cell style.
void | setCellTag (QString tagname)
| Set cells tag name.
virtual void | setBackgroundColor (const QColor color)
| Set the cells background color.
virtual void | setSelected (const bool selected)
| Set the value for selectec_ to true if the cell is selected.
virtual void | setHeight (const int height)
| Sets the height of the cell.
void | hideTreeView (const bool hidden)
## Public Member Functions
| Cell (QWidget *parent=0)
| The class constructor.
virtual | ~Cell ()
| The class destructor.
virtual QTextCursor | textCursor ()
| return the cells text cursor. if the cell don't have a cursor that have been created by the default constructor and is a null cursor.
virtual void | accept (Visitor &v)
| Implements visitor acceptability.
const bool | isSelected () const
const bool | isTreeViewVisible () const
const bool | isViewExpression () const
| Function for telling if the function viewExpression is activated or not.
const QColor | backgroundColor () const
| get the current backgroundcolor.
virtual CellStyle * | style ()
| Get the current cell style.
QString | cellTag ()
| Get the cell tag name.
QWidget * | mainWidget ()
## Protected Slots
void | setTreeWidget (TreeView *newTreeWidget)
| Add a treeview widget to the cell.
void | setMainWidget (QWidget *newWidget)
| Set the cells mainwidget.
void | addChapterCounter (QWidget *counter)
| Update the cell layout with a chapter counter.
## Protected Member Functions
void | mouseReleaseEvent (QMouseEvent *event)
| Describes what will happen if a mousebutton is released when the mouse is over the treeview widget.
void | mouseMoveEvent (QMouseEvent *event)
| Mouse move event is triggered when the mouse is moved.
void | applyRulesToStyle ()
| Apply any rules to the current cellstyle.

## Detailed Description

Cellinterface contains all functionality required to be a cell.

Author:
  Ingemar Axelsson and Anders Ferström

It implements the cells core functionality. Objects of this class should never be created. Instead tailored objects from subclasses such as TextCell, InputCell, CellGroup or ImageCell should be used.

To extend the Qt Notebook application with new type of cells subclass this class. Then subclass or reimplement a CellFactory so it creates the new type of cell. Examples of adding new cell look at InputCell and ImageCell.

Cells contains of two parts, a mainwidget containing the cells data, and the treewidget containing the treeview at the right side of the cell.

Todo:
  Implement a widgetstack for the treeview. This to make it possible to implement other treeview structures. (Ingemar Axelsson)

## Constructor & Destructor Documentation

IAEX::Cell::Cell | ( | QWidget * | parent = `0` | ) |

| The class constructor. Author: Ingemar Axelsson

IAEX::Cell::~Cell | ( |  | ) | `[virtual]`

| The class destructor. Author: Ingemar Axelsson

## Member Function Documentation

void IAEX::Cell::addChapterCounter | ( | QWidget * | counter | ) | `[protected, slot]`

| Update the cell layout with a chapter counter. Author: Anders Fernström Date: 2006-03-02

void IAEX::Cell::addRule | ( | Rule * | r | ) | `[virtual, slot]`

  | Adds a rule to the cell. Author: Ingemar Axelsson and Anders Fernström Date: 2006-02-09 (update) 2006-02-03 AF, check and see if rule already existes, if it dose only replace the value 2006-02-09 AF, ignore some types of rules Parameters:
  | r | The rule that will be added
Todo: Implement functionality for 'InitializationCell': inputcells should be evaled from the start if the value is true. (Anders Fernström)

void IAEX::Cell::applyRulesToStyle | ( |  | ) | `[protected]`

| Apply any rules to the current cellstyle. Author: Anders Fernström Date: 2005-10-27 Todo: Implement functionality for 'TextJustification'.

const QColor IAEX::Cell::backgroundColor | ( |  | ) | const

| get the current backgroundcolor. Author: Ingemar Axelsson Returns: current background color.

QString IAEX::Cell::cellTag | ( |  | ) |

| Get the cell tag name. Author: Anders Fernström Date: 2006-01-16 Returns: cell tag name

void IAEX::Cell::hideTreeView | ( | const bool | hidden | ) | `[slot]`

| Todo: The treewidget should not only be hidden, the mainwidget should be resized.(Ingemar Axelsson) Todo: test if repaint is needed here. (Ingemar Axelsson)

const bool IAEX::Cell::isSelected | ( |  | ) | const

| Returns: true if cell is selected, false otherwise.

const bool IAEX::Cell::isTreeViewVisible | ( |  | ) | const

| Returns: TRUE if treeview is hidden. Otherwise FALSE.

const bool IAEX::Cell::isViewExpression | ( |  | ) | const

| Function for telling if the function viewExpression is activated or not. Author: Anders Fernström Date: 2005-11-02 Returns: boolean, that tells if the cell is set to view expression

QWidget * IAEX::Cell::mainWidget | ( |  | ) |

| Author: Ingemar Axelsson Returns: A pointer to the mainwidget for the cell.

void IAEX::Cell::mouseMoveEvent | ( | QMouseEvent * | event | ) | `[protected]`

  | Mouse move event is triggered when the mouse is moved. This method must be implemented when adding support for drag and drop. Also look at the QT manual for more information about drag and drop. Parameters:
  | event | QMouseEvent sent from widgets parent.
Todo: Needs a cursor->moveBefore member. (Ingemar Axelsson)

void IAEX::Cell::mouseReleaseEvent | ( | QMouseEvent * | event | ) | `[protected]`

| Describes what will happen if a mousebutton is released when the mouse is over the treeview widget. Author: Ingemar Axelsson Bug: Should be done in the TreeView instead. Then a signal could be emitted.

void IAEX::Cell::setBackgroundColor | ( | const QColor | color | ) | `[virtual, slot]`

  | Set the cells background color. Author: Ingemar Axelsson Sets cells backgroundcolor. Also propagates the background color to the cells child widgets. Parameters:
  | color | new color.

void IAEX::Cell::setCellTag | ( | QString | tagname | ) | `[slot]`

| Set cells tag name. Author: Anders Fernström Date: 2006-01-16

void IAEX::Cell::setHeight | ( | const int | height | ) | `[virtual, slot]`

  | Sets the height of the cell. Author: Ingemar Axelsson Parameters:
  | height | New height for cell.
Bug: Implement Cell::setHeight() in a correct way. Does not work for widgets larger than 32767. (qt limitation)

void IAEX::Cell::setMainWidget | ( | QWidget * | newWidget | ) | `[protected, slot]`

  | Set the cells mainwidget. Todo: Delete old widget. (Ingemar Axelsson) Parameters:
  | newWidget | A pointer to the cells new mainwidget.

void IAEX::Cell::setSelected | ( | const bool | sel | ) | `[virtual, slot]`

  | Set the value for selectec_ to true if the cell is selected. Author: Ingemar Axelsson This slot is used to change the state of the cell. Todo: Tell the treeview that the cell has changed state. Should the cell be responsible to decide if it has been selected or should the treeview decide? Probably better if the cell decides. (Ingemar Axelsson) Parameters:
  | selected | true if cell should be selected, false otherwise

void IAEX::Cell::setStyle | ( | CellStyle | style | ) | `[virtual, slot]`

  | Set the current cell style. Author: Anders Fernström Date: 2005-10-27 Parameters:
  | style | The cell style that is to be applyed to the cell
Reimplemented in IAEX::CellGroup, IAEX::InputCell, and IAEX::TextCell.

void IAEX::Cell::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 in IAEX::InputCell, and IAEX::TextCell.

CellStyle * IAEX::Cell::style | ( |  | ) | `[virtual]`

| Get the current cell style. Author: Anders Fernström Date: 2005-10-27 Returns: current cell style Reimplemented in IAEX::CellGroup.

QTextCursor IAEX::Cell::textCursor | ( |  | ) | `[virtual]`

| return the cells text cursor. if the cell don't have a cursor that have been created by the default constructor and is a null cursor. Author: Anders Fernström Date: 2005-10-27 Returns: The cells text cursor Reimplemented in IAEX::InputCell, and IAEX::TextCell.

The documentation for this class was generated from the following files:

- C:/OpenModelica/OMNotebookQT4 v2/OMNotebookQT4/cell.h
- C:/OpenModelica/OMNotebookQT4 v2/OMNotebookQT4/cell.cpp
- C:/OpenModelica/OMNotebookQT4 v2/OMNotebookQT4/moc_cell.cpp