SciDAVis  1.D4
Classes | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends
AbstractAspect Class Reference

Base class of all persistent objects in a Project. More...

#include <AbstractAspect.h>

Inheritance diagram for AbstractAspect:
AbstractColumn AbstractFilter AbstractPart future::Folder Column ColumnStringIO SimpleFilterColumn AbstractSimpleFilter future::Matrix future::Table Project DateTime2DoubleFilter DateTime2StringFilter DayOfWeek2DoubleFilter Double2DateTimeFilter Double2DayOfWeekFilter Double2MonthFilter Double2StringFilter Month2DoubleFilter SimpleCopyThroughFilter String2DateTimeFilter String2DayOfWeekFilter String2DoubleFilter String2MonthFilter

List of all members.

Classes

class  Private
 Private data managed by AbstractAspect. More...

Public Slots

virtual void remove ()
 Remove me from my parent's list of children.
void setCaptionSpec (const QString &value)
 Set the specification string used for constructing the caption().
void setComment (const QString &value)
void setName (const QString &value)
QString uniqueNameFor (const QString &current_name) const
 Make the specified name unique among my children by incrementing a trailing number.

Signals

void aspectAboutToBeAdded (const AbstractAspect *parent, int index)
 Emit this when a parent aspect is about to get a new child inserted.
void aspectAboutToBeRemoved (const AbstractAspect *aspect)
 Emit this from an aspect about to be removed from its parent's children.
void aspectAboutToBeRemoved (const AbstractAspect *parent, int index)
 Emit this from a parent before removing its child.
void aspectAdded (const AbstractAspect *aspect)
 Emit this from a newly added aspect.
void aspectAdded (const AbstractAspect *parent, int index)
 Emit this from a parent after adding a new child to it.
void aspectDescriptionAboutToChange (const AbstractAspect *aspect)
 Emit this before the name, comment or caption spec is changed.
void aspectDescriptionChanged (const AbstractAspect *aspect)
 Emit this when the name, comment or caption spec changed.
void aspectRemoved (const AbstractAspect *parent, int index)
 Emit this from the parent after removing a child.
void statusInfo (const QString &text)
 Emit this to give status information to the user.

Public Member Functions

 AbstractAspect (const QString &name)
void addChild (AbstractAspect *child)
 Add the given Aspect to my list of children.
QString caption () const
QString captionSpec () const
 Return the specification string used for constructing the caption().
AbstractAspectchild (int index) const
 Get a child by its position in my list of children.
int childCount () const
 Return the number of child Aspects.
QString comment () const
virtual QMenu * createContextMenu () const
 Return a new context menu.
QDateTime creationTime () const
QList< AbstractAspect * > descendantsThatInherit (const char *class_name)
 Get all descendents that inherit the given class.
future::Folderfolder ()
 Return the folder the Aspect is contained in or 0 if not.
virtual QIcon icon () const
 Return an icon to be used for decorating my views.
void importV0x0001XXCreationTime (const QString &str)
int index () const
 Return my position in my parent's list of children.
int indexOfChild (const AbstractAspect *child) const
 Return the position of child in my list of children.
void insertChild (AbstractAspect *child, int index)
 Insert the given Aspect at a specific position in my list of children.
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect.
void moveChild (int from, int to)
 Change the positon of a child in my list of children.
QString name () const
AbstractAspectparentAspect () const
 Return my parent Aspect or 0 if I currently don't have one.
virtual QString path () const
 Return the path that leads from the top-most Aspect (usually a Project) to me.
virtual const Projectproject () const
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
virtual Projectproject ()
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
virtual void removeAllChildAspects ()
 Remove all child aspects.
void removeChild (AbstractAspect *child, bool detach=false)
 Remove the given Aspect from my list of children.
void removeChild (int index)
 Remove the Aspect at the given index from my list of children.
void reparentChild (AbstractAspect *new_parent, AbstractAspect *child, int d_new_index)
 Move a child to another aspect and transfer ownership.
void reparentChild (AbstractAspect *new_parent, AbstractAspect *child)
 Move a child to another aspect and transfer ownership.
virtual ~AbstractAspect ()
undo related
virtual QUndoStack * undoStack () const
 Return the undo stack of the Project, or 0 if this Aspect is not part of a Project.
void exec (QUndoCommand *command)
 Execute the given command, pushing it on the undoStack() if available.
void beginMacro (const QString &text)
 Begin an undo stack macro (series of commands)
void endMacro ()
 End the undo stack macro.

Static Public Member Functions

static QVariant global (const QString &key)
 Retrieve a global setting.
static void setGlobal (const QString &key, const QVariant &value)
 Update a global setting.
static void setGlobalDefault (const QString &key, const QVariant &value)
 Set default value for a global setting.

Protected Member Functions

virtual void completeAspectInsertion (AbstractAspect *aspect, int index)
 Called after a new child has been inserted or added.
void info (const QString &text)
 Implementations should call this whenever status information should be given to the user.
virtual void prepareAspectRemoval (AbstractAspect *aspect)
 Called before a child is removed.
void setCreationTime (const QDateTime &time)
 Set the creation time.

Private Attributes

Privated_aspect_private

Friends

class Private

serialize/deserialize

virtual void save (QXmlStreamWriter *) const
 Save as XML.
virtual bool load (XmlStreamReader *)
 Load from XML.
bool readBasicAttributes (XmlStreamReader *reader)
 Load name, creation time and caption spec from XML.
void writeBasicAttributes (QXmlStreamWriter *writer) const
 Save name, creation time and caption spec to XML.
void writeCommentElement (QXmlStreamWriter *writer) const
 Save the comment to XML.
bool readCommentElement (XmlStreamReader *reader)
 Load comment from an XML element.

Detailed Description

Base class of all persistent objects in a Project.

Before going into the details, it's useful to understand the ideas behind the Aspect Framework.

Aspects organize themselves into trees, where a parent takes ownership of its children. Usually, though not necessarily, a Project instance will sit at the root of the tree (without a Project ancestor, project() will return 0 and undo does not work). Children are organized using addChild(), removeChild(), child(), indexOfChild() and childCount() on the parent's side as well as the equivalent convenience methods index() and remove() on the child's side.

AbstractAspect manages for every Aspect the properties name, comment, #caption_spec and #creation_time. All of these translate into the caption() as described in the documentation of setCaptionSpec().

If an undoStack() can be found (usually it is managed by Project), changes to the properties as well as adding/removing children support multi-level undo/redo. In order to support undo/redo for problem-specific data in derived classes, make sure that all changes to your data are done by handing appropriate commands to exec().

Optionally, you can supply an icon() to be used by different views (including the ProjectExplorer) and/or reimplement createContextMenu() for a custom context menu of views.

The private data of AbstractAspect is contained in a separate class AbstractAspect::Private. The write access to AbstractAspect::Private should always be done using aspect commands to allow undo/redo.


Constructor & Destructor Documentation

AbstractAspect::AbstractAspect ( const QString &  name)
AbstractAspect::~AbstractAspect ( )
virtual

References d_aspect_private.


Member Function Documentation

void AbstractAspect::addChild ( AbstractAspect child)
void AbstractAspect::aspectAboutToBeAdded ( const AbstractAspect parent,
int  index 
)
signal

Emit this when a parent aspect is about to get a new child inserted.

Referenced by AbstractAspect::Private::insertChild().

void AbstractAspect::aspectAboutToBeRemoved ( const AbstractAspect aspect)
signal

Emit this from an aspect about to be removed from its parent's children.

Referenced by AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().

void AbstractAspect::aspectAboutToBeRemoved ( const AbstractAspect parent,
int  index 
)
signal

Emit this from a parent before removing its child.

void AbstractAspect::aspectAdded ( const AbstractAspect aspect)
signal

Emit this from a newly added aspect.

Referenced by AbstractAspect::Private::insertChild().

void AbstractAspect::aspectAdded ( const AbstractAspect parent,
int  index 
)
signal

Emit this from a parent after adding a new child to it.

void AbstractAspect::aspectDescriptionAboutToChange ( const AbstractAspect aspect)
signal

Emit this before the name, comment or caption spec is changed.

Referenced by AbstractFilter::input(), and AbstractAspect::Private::insertChild().

void AbstractAspect::aspectDescriptionChanged ( const AbstractAspect aspect)
signal

Emit this when the name, comment or caption spec changed.

Referenced by future::Table::connectColumn(), AbstractFilter::input(), AbstractAspect::Private::insertChild(), and Column::notifyDisplayChange().

void AbstractAspect::aspectRemoved ( const AbstractAspect parent,
int  index 
)
signal

Emit this from the parent after removing a child.

Referenced by AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().

void AbstractAspect::beginMacro ( const QString &  text)

Begin an undo stack macro (series of commands)

References undoStack().

Referenced by addChild(), future::Table::addColumn(), future::Table::addColumns(), future::Matrix::addColumns(), future::Table::addRows(), future::Matrix::addRows(), Table::applyFormula(), Matrix::applyFormula(), TableView::applyType(), future::Matrix::clear(), future::Table::clear(), future::Table::clearMasks(), future::Matrix::clearSelectedCells(), future::Table::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Table::clearSelectedColumns(), future::Matrix::clearSelectedRows(), future::Matrix::copy(), future::Table::copy(), future::Matrix::cutSelection(), future::Table::cutSelection(), future::Table::fillSelectedCellsWithRandomNumbers(), future::Table::fillSelectedCellsWithRowNumbers(), insertChild(), future::Table::insertColumns(), future::Matrix::insertColumns(), future::Matrix::insertEmptyColumns(), future::Table::insertEmptyColumns(), future::Matrix::insertEmptyRows(), future::Table::insertEmptyRows(), future::Matrix::insertRows(), future::Table::insertRows(), future::Table::maskSelection(), future::Table::moveColumn(), future::Table::normalizeColumns(), future::Table::normalizeSelection(), future::Matrix::pasteIntoSelection(), future::Table::pasteIntoSelection(), future::Table::recalculateSelectedCells(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), reparentChild(), Column::setColumnMode(), future::Matrix::setDimensions(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::sortColumns(), and future::Table::unmaskSelection().

QString AbstractAspect::caption ( ) const
QString AbstractAspect::captionSpec ( ) const

Return the specification string used for constructing the caption().

See setCaptionSpec() for format.

References AbstractAspect::Private::captionSpec(), and d_aspect_private.

Referenced by future::Table::copy(), and writeBasicAttributes().

AbstractAspect * AbstractAspect::child ( int  index) const
int AbstractAspect::childCount ( ) const
QString AbstractAspect::comment ( ) const
virtual void AbstractAspect::completeAspectInsertion ( AbstractAspect aspect,
int  index 
)
inlineprotectedvirtual

Called after a new child has been inserted or added.

Unlike the aspectAdded() signals, this method does not get called inside undo/redo actions; allowing subclasses to execute undo commands of their own.

Reimplemented in future::Table.

Referenced by addChild(), insertChild(), and reparentChild().

QMenu * AbstractAspect::createContextMenu ( ) const
virtual

Return a new context menu.

The caller takes ownership of the menu.

Reimplemented in future::Table, future::Matrix, Project, AbstractPart, and future::Folder.

QDateTime AbstractAspect::creationTime ( ) const
QList< AbstractAspect * > AbstractAspect::descendantsThatInherit ( const char *  class_name)

Get all descendents that inherit the given class.

References child(), childCount(), and descendantsThatInherit().

Referenced by descendantsThatInherit(), and ApplicationWindow::tableWindows().

void AbstractAspect::endMacro ( )

End the undo stack macro.

References undoStack().

Referenced by addChild(), future::Table::addColumn(), future::Table::addColumns(), future::Matrix::addColumns(), future::Table::addRows(), future::Matrix::addRows(), Table::applyFormula(), Matrix::applyFormula(), TableView::applyType(), future::Matrix::clear(), future::Table::clear(), future::Table::clearMasks(), future::Matrix::clearSelectedCells(), future::Table::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Table::clearSelectedColumns(), future::Matrix::clearSelectedRows(), future::Matrix::copy(), future::Table::copy(), future::Matrix::cutSelection(), future::Table::cutSelection(), future::Table::fillSelectedCellsWithRandomNumbers(), future::Table::fillSelectedCellsWithRowNumbers(), insertChild(), future::Table::insertColumns(), future::Matrix::insertColumns(), future::Matrix::insertEmptyColumns(), future::Table::insertEmptyColumns(), future::Matrix::insertEmptyRows(), future::Table::insertEmptyRows(), future::Matrix::insertRows(), future::Table::insertRows(), future::Table::maskSelection(), future::Table::moveColumn(), future::Table::normalizeColumns(), future::Table::normalizeSelection(), future::Matrix::pasteIntoSelection(), future::Table::pasteIntoSelection(), future::Table::recalculateSelectedCells(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), reparentChild(), Column::setColumnMode(), future::Matrix::setDimensions(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::sortColumns(), and future::Table::unmaskSelection().

void AbstractAspect::exec ( QUndoCommand *  command)

Execute the given command, pushing it on the undoStack() if available.

References undoStack().

Referenced by addChild(), future::Matrix::addColumns(), future::Table::addRows(), future::Matrix::addRows(), Column::clear(), future::Matrix::clear(), Column::clearFormulas(), Column::clearMasks(), future::Matrix::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Matrix::clearSelectedRows(), Column::clearValidity(), future::Table::completeAspectInsertion(), Column::copy(), insertChild(), future::Matrix::insertColumns(), future::Matrix::insertRows(), Column::insertRows(), future::Matrix::mirrorHorizontally(), future::Matrix::mirrorVertically(), moveChild(), future::Table::moveColumn(), future::Table::prepareAspectRemoval(), removeChild(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), Column::removeRows(), reparentChild(), Column::replaceDateTimes(), Column::replaceTexts(), Column::replaceValues(), setCaptionSpec(), future::Matrix::setCell(), future::Matrix::setColumnCells(), Column::setColumnMode(), setComment(), future::Matrix::setCoordinates(), setCreationTime(), Column::setDateTimeAt(), future::Matrix::setDimensions(), future::Matrix::setDisplayedDigits(), DateTime2StringFilter::setFormat(), String2DateTimeFilter::setFormat(), future::Matrix::setFormula(), Column::setFormula(), Column::setInvalid(), Column::setMasked(), setName(), Double2StringFilter::setNumDigits(), Double2StringFilter::setNumericFormat(), future::Matrix::setNumericFormat(), Column::setPlotDesignation(), future::Matrix::setRowCells(), future::Table::setRowCount(), Column::setTextAt(), Column::setValueAt(), future::Matrix::setXEnd(), future::Matrix::setXStart(), future::Matrix::setYEnd(), future::Matrix::setYStart(), and future::Matrix::transpose().

future::Folder * AbstractAspect::folder ( )

Return the folder the Aspect is contained in or 0 if not.

The returned folder may be the aspect itself if it inherits Folder.

References parentAspect().

Referenced by future::Matrix::duplicate(), and future::Folder::readChildAspectElement().

QVariant AbstractAspect::global ( const QString &  key)
static
QIcon AbstractAspect::icon ( ) const
virtual

Return an icon to be used for decorating my views.

Reimplemented in future::Table, Column, future::Matrix, and future::Folder.

Referenced by PartMdiView::PartMdiView().

void AbstractAspect::importV0x0001XXCreationTime ( const QString &  str)
inline
int AbstractAspect::index ( ) const
inline
int AbstractAspect::indexOfChild ( const AbstractAspect child) const
void AbstractAspect::info ( const QString &  text)
inlineprotected

Implementations should call this whenever status information should be given to the user.

This will cause statusInfo() to be emitted. Typically, this will cause the specified string to be displayed in a status bar, a log window or some similar non-blocking way so as not to disturb the workflow.

References statusInfo().

Referenced by addChild(), insertChild(), reparentChild(), and setName().

void AbstractAspect::insertChild ( AbstractAspect child,
int  index 
)
bool AbstractAspect::isDescendantOf ( AbstractAspect other)

Return whether the there is a path upwards to the given aspect.

This also returns true if other==this.

References parentAspect().

virtual bool AbstractAspect::load ( XmlStreamReader )
inlinevirtual

Load from XML.

XmlStreamReader supports errors as well as warnings. If only warnings (non-critial errors) occur, this function must return the reader at the end element corresponding to the current element at the time the function was called.

This function is normally intended to be called directly after the ctor. If you want to call load on an aspect that has been altered, you must make sure beforehand that it is in the same state as after creation, e.g., remove all its child aspects.

Returns:
false on error

Reimplemented in Column, AbstractSimpleFilter, future::Table, future::Matrix, DateTime2StringFilter, Project, Double2StringFilter, String2DateTimeFilter, and future::Folder.

void AbstractAspect::moveChild ( int  from,
int  to 
)

Change the positon of a child in my list of children.

References childCount(), d_aspect_private, and exec().

Referenced by future::Table::moveColumn().

QString AbstractAspect::name ( ) const

References d_aspect_private, and AbstractAspect::Private::name().

Referenced by addChild(), future::Table::addColumn(), future::Table::addColumns(), future::Matrix::addColumns(), Filter::addResultCurve(), future::Table::addRows(), future::Matrix::addRows(), TableView::applyType(), AspectChildAddCmd::AspectChildAddCmd(), AspectChildRemoveCmd::AspectChildRemoveCmd(), AspectChildReparentCmd::AspectChildReparentCmd(), future::Matrix::clear(), future::Table::clear(), future::Table::clearMasks(), future::Matrix::clearSelectedCells(), future::Table::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Table::clearSelectedColumns(), future::Matrix::clearSelectedRows(), Table::colLabel(), Table::colNames(), future::Table::column(), Table::columnsList(), future::Matrix::copy(), future::Table::copy(), future::Matrix::cutSelection(), future::Table::cutSelection(), DateTime2StringFilterSetFormatCmd::DateTime2StringFilterSetFormatCmd(), ApplicationWindow::defineErrorBars(), Double2StringFilterSetDigitsCmd::Double2StringFilterSetDigitsCmd(), Double2StringFilterSetFormatCmd::Double2StringFilterSetFormatCmd(), Table::drawableColumnSelection(), future::Matrix::duplicate(), future::Table::export_to_TeX(), future::Table::fillSelectedCellsWithRandomNumbers(), future::Table::fillSelectedCellsWithRowNumbers(), TableView::handleAspectAdded(), Table::handleAspectDescriptionAboutToChange(), Table::handleAspectDescriptionChange(), Matrix::handleAspectDescriptionChange(), TableView::handleAspectDescriptionChanged(), Table::importASCII(), ApplicationWindow::importASCII(), insertChild(), future::Table::insertColumns(), future::Matrix::insertColumns(), future::Matrix::insertEmptyColumns(), future::Table::insertEmptyColumns(), future::Matrix::insertEmptyRows(), future::Table::insertEmptyRows(), future::Matrix::insertRows(), future::Table::insertRows(), future::Table::maskSelection(), future::Table::moveColumn(), Matrix::name(), Table::name(), future::Matrix::Private::name(), future::Table::Private::name(), future::Table::normalizeColumns(), future::Table::normalizeSelection(), Differentiation::output(), future::Matrix::pasteIntoSelection(), future::Table::pasteIntoSelection(), path(), readBasicAttributes(), future::Table::recalculateSelectedCells(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), reparentChild(), Table::selectedColumns(), Table::selectedErrColumns(), Table::selectedYColumns(), TableView::setColumnForControlTabs(), Column::setColumnMode(), future::Matrix::setDimensions(), Graph::setLabelsTextFormat(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::showTeXTableExportDialog(), future::Table::sortColumns(), String2DateTimeFilterSetFormatCmd::String2DateTimeFilterSetFormatCmd(), TableMoveColumnCmd::TableMoveColumnCmd(), ApplicationWindow::tableWindows(), AbstractAspect::Private::uniqueNameFor(), future::Table::unmaskSelection(), writeBasicAttributes(), and Table::YColumns().

AbstractAspect * AbstractAspect::parentAspect ( ) const
virtual QString AbstractAspect::path ( ) const
inlinevirtual

Return the path that leads from the top-most Aspect (usually a Project) to me.

Reimplemented in Project.

References name(), parentAspect(), and path().

Referenced by path(), and MuParserScript::resolveColumnPath().

virtual void AbstractAspect::prepareAspectRemoval ( AbstractAspect aspect)
inlineprotectedvirtual

Called before a child is removed.

Unlike the aspectAboutToBeRemoved() signals, this method does not get called inside undo/redo actions; allowing subclasses to execute undo commands of their own.

Reimplemented in future::Table.

Referenced by removeChild(), and reparentChild().

virtual const Project* AbstractAspect::project ( ) const
inlinevirtual

Return the Project this Aspect belongs to, or 0 if it is currently not part of one.

Reimplemented in Project.

References parentAspect(), and project().

Referenced by future::Folder::createContextMenu(), and project().

virtual Project* AbstractAspect::project ( )
inlinevirtual

Return the Project this Aspect belongs to, or 0 if it is currently not part of one.

Reimplemented in Project.

References parentAspect(), and project().

bool AbstractAspect::readBasicAttributes ( XmlStreamReader reader)
protected

Load name, creation time and caption spec from XML.

Returns:
false on error

References name(), XmlStreamReader::raiseWarning(), setCaptionSpec(), setCreationTime(), and setName().

Referenced by future::Folder::load(), future::Matrix::load(), future::Table::load(), AbstractSimpleFilter::load(), and Column::load().

bool AbstractAspect::readCommentElement ( XmlStreamReader reader)
protected
virtual void AbstractAspect::remove ( )
inlinevirtualslot

Remove me from my parent's list of children.

References indexOfChild(), parentAspect(), and removeChild().

Referenced by PartMdiView::closeEvent(), Table::closeEvent(), Matrix::closeEvent(), and Table::importASCII().

void AbstractAspect::removeAllChildAspects ( )
virtual

Remove all child aspects.

References beginMacro(), childCount(), endMacro(), name(), and removeChild().

Referenced by future::Folder::load().

void AbstractAspect::removeChild ( AbstractAspect child,
bool  detach = false 
)

Remove the given Aspect from my list of children.

Usually, the ownership of the child is transfered to the undo command, i.e., the aspect is deleted by the undo command. But by setting detach to true, you can remove a child from the Aspect tree without deleting it. Of course, that means whovere detaches an Aspect in responsible for deleting it (or re-attaching it somewhere in the tree).

See also:
reparentChild()

References beginMacro(), d_aspect_private, endMacro(), exec(), indexOfChild(), name(), and prepareAspectRemoval().

Referenced by Table::importV0x0001XXHeader(), remove(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), ApplicationWindow::removeDependentTableStatistics(), Column::setColumnMode(), and Table::setHeader().

void AbstractAspect::removeChild ( int  index)

Remove the Aspect at the given index from my list of children.

The ownership of the child is transfered to the undo command, i.e., the aspect is deleted by the undo command.

See also:
reparentChild()

References AbstractAspect::Private::child(), childCount(), d_aspect_private, and removeChild().

void AbstractAspect::reparentChild ( AbstractAspect new_parent,
AbstractAspect child,
int  d_new_index 
)
void AbstractAspect::reparentChild ( AbstractAspect new_parent,
AbstractAspect child 
)

Move a child to another aspect and transfer ownership.

References childCount(), and reparentChild().

virtual void AbstractAspect::save ( QXmlStreamWriter *  ) const
inlinevirtual
void AbstractAspect::setCaptionSpec ( const QString &  value)
slot

Set the specification string used for constructing the caption().

The caption is constructed by substituting some magic tokens in the specification:

Additionally, you can use the construct C{<text>}. <text> is only shown in the caption if comment() is not empty (name and creation time should never be empty).

The default caption specification is "%n%C{ - }%c".

References AbstractAspect::Private::captionSpec(), d_aspect_private, and exec().

Referenced by future::Table::copy(), readBasicAttributes(), Matrix::setCaptionPolicy(), and Table::setCaptionPolicy().

void AbstractAspect::setComment ( const QString &  value)
slot
void AbstractAspect::setCreationTime ( const QDateTime &  time)
protected

Set the creation time.

The creation time will automatically be set when the aspect object is created. This function is usually only needed when the aspect is loaded from a file.

References AbstractAspect::Private::creationTime(), d_aspect_private, and exec().

Referenced by importV0x0001XXCreationTime(), and readBasicAttributes().

void AbstractAspect::setGlobal ( const QString &  key,
const QVariant &  value 
)
static
void AbstractAspect::setGlobalDefault ( const QString &  key,
const QVariant &  value 
)
static

Set default value for a global setting.

References AbstractAspect::Private::g_defaults.

void AbstractAspect::setName ( const QString &  value)
slot
void AbstractAspect::statusInfo ( const QString &  text)
signal

Emit this to give status information to the user.

Referenced by info(), and AbstractAspect::Private::insertChild().

virtual QUndoStack* AbstractAspect::undoStack ( ) const
inlinevirtual

Return the undo stack of the Project, or 0 if this Aspect is not part of a Project.

It's also possible to construct undo-enabled Aspect trees without Project. The only requirement is that the root Aspect reimplements undoStack() to get the undo stack from somewhere (the default implementation just delegates to parentAspect()).

Reimplemented in Project.

References parentAspect(), and undoStack().

Referenced by beginMacro(), endMacro(), exec(), and undoStack().

QString AbstractAspect::uniqueNameFor ( const QString &  current_name) const
slot

Make the specified name unique among my children by incrementing a trailing number.

References d_aspect_private, and AbstractAspect::Private::uniqueNameFor().

Referenced by setName().

void AbstractAspect::writeBasicAttributes ( QXmlStreamWriter *  writer) const
protected

Save name, creation time and caption spec to XML.

References captionSpec(), creationTime(), and name().

Referenced by future::Folder::save(), future::Matrix::save(), future::Table::save(), AbstractSimpleFilter::save(), and Column::save().

void AbstractAspect::writeCommentElement ( QXmlStreamWriter *  writer) const
protected

Friends And Related Function Documentation

friend class Private
friend

Reimplemented in future::Table, future::Matrix, and Column.


Member Data Documentation

Private* AbstractAspect::d_aspect_private
private

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