SciDAVis  1.D4
Public Slots | Public Member Functions | Private Attributes
AbstractPart Class Reference

Base class of Aspects with MDI windows as views. More...

#include <AbstractPart.h>

Inheritance diagram for AbstractPart:
AbstractAspect future::Matrix future::Table

List of all members.

Public Slots

virtual void copy ()
 Copy current selection.
virtual void cut ()
 Cut current selection.
virtual void paste ()
 Paste at the current location or into the current selection.
- Public Slots inherited from AbstractAspect
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.

Public Member Functions

 AbstractPart (const QString &name)
 Constructor.
virtual QMenu * createContextMenu () const
 Return AbstractAspect::createContextMenu() plus operations on the primary view.
virtual bool fillProjectMenu (QMenu *menu)
 Fill the part specific menu for the main window including setting the title.
virtual bool fillProjectToolBar (QToolBar *bar)
 Fill the part specific tool bar for the main window including setting the title.
PartMdiViewmdiSubWindow ()
 Wrap the view() into a PartMdiView.
virtual QWidget * view ()=0
 Construct a primary view on me.
- Public Member Functions inherited from AbstractAspect
 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
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 ()
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.
virtual void save (QXmlStreamWriter *) const
 Save as XML.
virtual bool load (XmlStreamReader *)
 Load from XML.

Private Attributes

PartMdiViewd_mdi_window
 The MDI sub-window that is wrapped around my primary view.

Additional Inherited Members

- Signals inherited from AbstractAspect
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.
- Static Public Member Functions inherited from AbstractAspect
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 inherited from AbstractAspect
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.
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 Aspects with MDI windows as views.

SciDAVis's Parts are somewhat similar to KDE's KParts in that they are independent application components running on top of a kernel (a bit like KOffice's shell).


Constructor & Destructor Documentation

AbstractPart::AbstractPart ( const QString &  name)
inline

Constructor.


Member Function Documentation

virtual void AbstractPart::copy ( )
inlinevirtualslot

Copy current selection.

Referenced by future::Matrix::importImageDialog().

QMenu * AbstractPart::createContextMenu ( ) const
virtual

Return AbstractAspect::createContextMenu() plus operations on the primary view.

Reimplemented from AbstractAspect.

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

References d_mdi_window.

Referenced by PartMdiView::contextMenuEvent().

virtual void AbstractPart::cut ( )
inlinevirtualslot

Cut current selection.

virtual bool AbstractPart::fillProjectMenu ( QMenu *  menu)
inlinevirtual

Fill the part specific menu for the main window including setting the title.

Returns:
true on success, otherwise false (e.g. part has no actions).

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

virtual bool AbstractPart::fillProjectToolBar ( QToolBar *  bar)
inlinevirtual

Fill the part specific tool bar for the main window including setting the title.

Returns:
true on success, otherwise false (e.g. part has no actions to be shown in a toolbar).

Reimplemented in future::Table.

PartMdiView * AbstractPart::mdiSubWindow ( )

Wrap the view() into a PartMdiView.

A new view is only created the first time this method is called; after that, a pointer to the pre-existing view is returned.

References d_mdi_window, and view().

virtual void AbstractPart::paste ( )
inlinevirtualslot

Paste at the current location or into the current selection.

virtual QWidget* AbstractPart::view ( )
pure virtual

Construct a primary view on me.

The caller recieves ownership of the view.

This method may be called multiple times during the life time of a Part, or it might not get called at all. Parts must not depend on the existence of a view for their operation.

Implemented in future::Table, and future::Matrix.

Referenced by mdiSubWindow().


Member Data Documentation

PartMdiView* AbstractPart::d_mdi_window
private

The MDI sub-window that is wrapped around my primary view.

Referenced by createContextMenu(), and mdiSubWindow().


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