CAM-based implementation of the data object. More...
#include <CAM_DataObject.h>

Public Types | |
| enum | ColorRole { Text, Base, Foreground, Background, Highlight, HighlightedText } |
Color role. More... | |
| enum | { NameId, VisibilityId } |
Column id. More... | |
Public Member Functions | |
| CAM_DataObject (SUIT_DataObject *=0) | |
| Constructor. | |
| virtual | ~CAM_DataObject () |
| Destructor. | |
| CAM_Module * | module () const |
| Get CAM module. | |
| virtual CAM_DataModel * | dataModel () const |
| Get CAM data model. | |
| SUIT_DataObject * | root () const |
| Get the root object. | |
| SUIT_DataObject * | lastChild () const |
| Get the last child object. | |
| SUIT_DataObject * | firstChild () const |
| Get the first child object. | |
| int | childCount () const |
| Get the number of the child objects. | |
| int | childPos (const SUIT_DataObject *) const |
| Get the index of the specified object in the child list. | |
| SUIT_DataObject * | childObject (const int) const |
| Get child object by the specified index. | |
| int | level () const |
| Get the object level in the tree structure. | |
| int | position () const |
| Get the position of the data object in its parent's children list. | |
| SUIT_DataObject * | nextBrother () const |
| Get the next sibling data object in the children list. | |
| SUIT_DataObject * | prevBrother () const |
| Get the previous sibling data object in the children list. | |
| bool | autoDeleteChildren () const |
| Get "auto-delete children" flag. | |
| virtual void | setAutoDeleteChildren (const bool) |
| Set "auto-delete children" flag. | |
| virtual void | children (DataObjectList &, const bool=false) const |
| Get all children. | |
| virtual DataObjectList | children (const bool=false) |
| Get all children. . | |
| void | appendChild (SUIT_DataObject *) |
| Add new child object to the end of the children list. | |
| virtual void | insertChild (SUIT_DataObject *, int) |
| Insert new child object to the list of the children. | |
| virtual void | removeChild (SUIT_DataObject *, const bool=false) |
| Remove the specified child object reference. | |
| bool | replaceChild (SUIT_DataObject *, SUIT_DataObject *, const bool=false) |
| Replace the specified child object by another object. | |
| void | reparentChildren (const SUIT_DataObject *) |
| Change the parent for all children from specified object to this one. | |
| virtual SUIT_DataObject * | parent () const |
| Get the parent object. | |
| virtual void | setParent (SUIT_DataObject *) |
| Change the parent object. | |
| virtual void | assignParent (SUIT_DataObject *) |
| void | insertChildAtPos (SUIT_DataObject *obj, int position) |
| Insert new child object into the list of the children (faster version of insertChild without signal). | |
| bool | modified () |
| void | setModified (bool modified) |
| virtual QString | name () const |
| Get data object name. | |
| virtual QString | text (const int=NameId) const |
| Get object text data for the specified column. | |
| virtual QPixmap | icon (const int=NameId) const |
| Get data object icon for the specified column. | |
| virtual QColor | color (const ColorRole, const int=NameId) const |
| Get data object color for the specified column. | |
| virtual QString | toolTip (const int=NameId) const |
| Get data object tooltip for the specified column. | |
| virtual QString | statusTip (const int=NameId) const |
| Get data object status tip for the specified column. | |
| virtual QString | whatsThis (const int=NameId) const |
| Get data object "what's this" information for the specified column. | |
| virtual QFont | font (const int=NameId) const |
| Get data object font for the specified column. | |
| virtual int | alignment (const int=NameId) const |
| Get data object text alignment for the specified column. | |
| virtual bool | expandable () const |
| virtual bool | isVisible () const |
| Check if the object is visible. | |
| virtual bool | isDragable () const |
| Check if the object is draggable. | |
| virtual bool | isDropAccepted (SUIT_DataObject *obj) |
| Check if the drop operation fo this object is possible. | |
| virtual bool | isEnabled () const |
| Check if this object is enabled. | |
| virtual bool | isSelectable () const |
| Check if this object is selectable. | |
| virtual bool | isCheckable (const int=NameId) const |
| Check if this object is checkable for the specified column. | |
| virtual bool | renameAllowed (const int=NameId) const |
| Check if this object is can't be renamed in place. | |
| virtual bool | setName (const QString &name) |
| Set name of the this object. | |
| virtual bool | isOn (const int=NameId) const |
| Get the checked state of the object (if it is checkable) for the specified column. | |
| virtual void | setOn (const bool, const int=NameId) |
| Set the checked state of the object (if it is checkable) for the specified column. | |
| virtual bool | isOpen () const |
| Get the "opened" state of the object. | |
| virtual void | setOpen (const bool) |
| Set the "opened" state of the object. | |
| virtual void | update () |
| Updates necessary internal fields of data object. | |
| virtual bool | customSorting (const int=NameId) const |
| Check if the specified column supports custom sorting. | |
| virtual bool | compare (const QVariant &, const QVariant &, const int=NameId) const |
| Compares data from two items for sorting purposes. | |
| virtual SUIT_DataObjectKey * | key () const |
| Get the object unique indentification key. | |
| virtual int | groupId () const |
| return unique group identificator | |
| virtual QVariant | customData (Qtx::CustomDataType) |
| return custom data for data object. | |
| void | deleteLater () |
| Schedule this object for the late deleting. | |
| void | dump (const int indent=2) const |
| Dump the object tree recursively to the standard output. | |
Static Public Member Functions | |
| static Signal * | signal () |
| Get global signal handler. | |
| static bool | connect (const char *, QObject *, const char *) |
| Connect to the signal handlerx. | |
| static bool | disconnect (const char *, QObject *, const char *) |
| Disconnect from the signal handler. | |
Friends | |
| class | SUIT_DataObject::Signal |
In addition to base implementation provides integration with CAM_DataModel.
enum SUIT_DataObject::ColorRole [inherited] |
| CAM_DataObject::CAM_DataObject | ( | SUIT_DataObject * | parent = 0 | ) |
| parent | parent data object |
| CAM_DataObject::~CAM_DataObject | ( | ) | [virtual] |
Does nothing.
| CAM_Module * CAM_DataObject::module | ( | ) | const |
References dataModel(), and CAM_DataModel.module().
| CAM_DataModel * CAM_DataObject::dataModel | ( | ) | const [virtual] |
Reimplemented in CAM_ModuleObject.
References dataModel(), and SUIT_DataObject.parent().
| SUIT_DataObject * SUIT_DataObject::root | ( | ) | const [inherited] |
References SUIT_DataObject.parent(), and SUIT_DataObject.root().
| SUIT_DataObject * SUIT_DataObject::lastChild | ( | ) | const [inherited] |
References SUIT_DataObject.myChildren.
| SUIT_DataObject * SUIT_DataObject::firstChild | ( | ) | const [inherited] |
References SUIT_DataObject.myChildren.
| int SUIT_DataObject::childCount | ( | ) | const [inherited] |
References SUIT_DataObject.myChildren.
| int SUIT_DataObject::childPos | ( | const SUIT_DataObject * | obj | ) | const [inherited] |
| obj | child object |
References SUIT_DataObject.myChildren.
| SUIT_DataObject * SUIT_DataObject::childObject | ( | const int | idx | ) | const [inherited] |
| idx | child object index |
References SUIT_DataObject.myChildren.
| int SUIT_DataObject::level | ( | ) | const [inherited] |
| int SUIT_DataObject::position | ( | ) | const [inherited] |
References SUIT_DataObject.childPos(), and SUIT_DataObject.myParent.
| SUIT_DataObject * SUIT_DataObject::nextBrother | ( | ) | const [inherited] |
References SUIT_DataObject.childObject(), SUIT_DataObject.childPos(), and SUIT_DataObject.myParent.
| SUIT_DataObject * SUIT_DataObject::prevBrother | ( | ) | const [inherited] |
References SUIT_DataObject.childObject(), SUIT_DataObject.childPos(), and SUIT_DataObject.myParent.
| bool SUIT_DataObject::autoDeleteChildren | ( | ) | const [inherited] |
true if the object should delete all its children on destroying References SUIT_DataObject.myAutoDel.
| void SUIT_DataObject::setAutoDeleteChildren | ( | const bool | on | ) | [virtual, inherited] |
If this flag is on (default), the object will delete all its children on destroying.
| on | new flag value |
References SUIT_DataObject.myAutoDel.
| void SUIT_DataObject::children | ( | DataObjectList & | lst, |
| const bool | rec = false |
||
| ) | const [virtual, inherited] |
If parameter rec is true then function collects all the children recursively.
| lst | returning list of children |
| rec | if true collect all children recursively |
References SUIT_DataObject.myChildren.
| DataObjectList SUIT_DataObject::children | ( | const bool | rec = false | ) | [virtual, inherited] |
If parameter rec is true then function collects all the children recursively.
| rec | if true collect all children recursively |
References SUIT_DataObject.children().
| void SUIT_DataObject::appendChild | ( | SUIT_DataObject * | obj | ) | [inherited] |
| obj | child object being added |
References SUIT_DataObject.insertChild(), and SUIT_DataObject.myChildren.
| void SUIT_DataObject::insertChild | ( | SUIT_DataObject * | obj, |
| int | position | ||
| ) | [virtual, inherited] |
| obj | child object being added |
| position | child position |
Reimplemented in LightApp_ModuleObject.
References SUIT_DataObject.Signal.emitInserted(), SUIT_DataObject.myChildren, SUIT_DataObject.position(), SUIT_DataObject.setParent(), and SUIT_DataObject.signal().
| void SUIT_DataObject::removeChild | ( | SUIT_DataObject * | obj, |
| const bool | del = false |
||
| ) | [virtual, inherited] |
| obj | child object being removed |
| del | if true, the child object is destroyed |
References SUIT_DataObject.deleteLater(), SUIT_DataObject.Signal.emitRemoved(), SUIT_DataObject.myChildren, SUIT_DataObject.setParent(), and SUIT_DataObject.signal().
| bool SUIT_DataObject::replaceChild | ( | SUIT_DataObject * | src, |
| SUIT_DataObject * | trg, | ||
| const bool | del = false |
||
| ) | [inherited] |
| src | child object being replaced |
| trg | new child object |
| del | if true, the previous object is destroyed |
true if the object has been replaced References SUIT_DataObject.childPos(), SUIT_DataObject.deleteLater(), SUIT_DataObject.insertChild(), and SUIT_DataObject.removeChild().
| void SUIT_DataObject::reparentChildren | ( | const SUIT_DataObject * | obj | ) | [inherited] |
| obj | object which children to be reparented |
References SUIT_DataObject.children().
| SUIT_DataObject * SUIT_DataObject::parent | ( | ) | const [virtual, inherited] |
References SUIT_DataObject.myParent.
| void SUIT_DataObject::setParent | ( | SUIT_DataObject * | p | ) | [virtual, inherited] |
| p | new parent object |
References SUIT_DataObject.appendChild(), SUIT_DataObject.myParent, SUIT_DataObject.parent(), and SUIT_DataObject.removeChild().
| void SUIT_DataObject::assignParent | ( | SUIT_DataObject * | p | ) | [virtual, inherited] |
References SUIT_DataObject.myParent.
| void SUIT_DataObject::insertChildAtPos | ( | SUIT_DataObject * | obj, |
| int | position | ||
| ) | [inherited] |
| obj | child object being added |
| position | child position |
References SUIT_DataObject.assignParent(), SUIT_DataObject.myChildren, and SUIT_DataObject.position().
| bool SUIT_DataObject.modified | ( | ) | [inherited] |
| void SUIT_DataObject.setModified | ( | bool | modified | ) | [inherited] |
| QString SUIT_DataObject::name | ( | ) | const [virtual, inherited] |
This method should be re-implemented in the subclasses. Default implementation returns null string.
Reimplemented in CAM_ModuleObject, LightApp_ModuleObject, SALOME_PYQT_DataObjectLight, SalomeApp_DataObject, SalomeApp_ModuleObject, SalomeApp_RootObject, SalomeApp_SavePointObject, and SalomeApp_SavePointRootObject.
| QString SUIT_DataObject::text | ( | const int | id = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns null string.
Column with id = 0 (NameId) is supposed to be used to get the object name (as it does the default implementation).
| id | column id |
Reimplemented in LightApp_DataObject, SalomeApp_DataObject, and SalomeApp_RootObject.
References SUIT_DataObject.name(), and SUIT_DataObject.NameId.
| QPixmap SUIT_DataObject::icon | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns null pixmap.
The parameter id specifies the column identificator
| id | column id |
Reimplemented in CAM_ModuleObject, LightApp_ModuleObject, SALOME_PYQT_DataObjectLight, SalomeApp_DataObject, SalomeApp_ModuleObject, SalomeApp_RootObject, and SalomeApp_SavePointObject.
| QColor SUIT_DataObject::color | ( | const ColorRole | , |
| const int | = NameId |
||
| ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns null color.
The parameter id specifies the column identificator
| role | color role |
| id | column id |
Reimplemented in SalomeApp_DataObject, and SalomeApp_RootObject.
| QString SUIT_DataObject::toolTip | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns null string.
The parameter id specifies the column identificator (to display, for example, in the tree view widget).
| id | column id |
Reimplemented in CAM_ModuleObject, LightApp_ModuleObject, SALOME_PYQT_DataObjectLight, SalomeApp_DataObject, SalomeApp_ModuleObject, SalomeApp_RootObject, SalomeApp_SavePointObject, and SalomeApp_SavePointRootObject.
| QString SUIT_DataObject::statusTip | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns null string.
The parameter id specifies the column identificator
| id | column id |
| QString SUIT_DataObject::whatsThis | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns null string.
The parameter id specifies the column identificator
| id | column id |
| QFont SUIT_DataObject::font | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns application default font.
The parameter id specifies the column identificator
| id | column id |
Reimplemented in SalomeApp_DataObject.
| int SUIT_DataObject::alignment | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns default alignment which is Qt:AlignLeft.
The parameter id specifies the column identificator (to display, for example, in the tree view widget).
| id | column id |
| bool SUIT_DataObject::expandable | ( | ) | const [virtual, inherited] |
Reimplemented in SalomeApp_DataObject.
| bool SUIT_DataObject::isVisible | ( | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns true (all objects are visible by default).
true if this object is displayable or false otherwise Reimplemented in LightApp_DataObject, and SalomeApp_DataObject.
| bool SUIT_DataObject::isDragable | ( | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns false (all objects could not be dragged).
true if it is possible to drag this object | bool SUIT_DataObject::isDropAccepted | ( | SUIT_DataObject * | obj | ) | [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns false (drop operation is not allowed).
| obj | object being dropped |
true if it is possible to drop an object obj to this object | bool SUIT_DataObject::isEnabled | ( | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns true (all objects are enabled).
true if the user can interact with the item | bool SUIT_DataObject::isSelectable | ( | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns true (all objects are selectable).
true if the item can be selected | bool SUIT_DataObject::isCheckable | ( | const int | = NameId | ) | const [virtual, inherited] |
| bool SUIT_DataObject::renameAllowed | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns false (all objects can not be renamed).
| id | column id |
true if the item can be renamed by the user in place (e.g. in the Object browser) Reimplemented in LightApp_DataObject.
| bool SUIT_DataObject::setName | ( | const QString & | name | ) | [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns false.
true if rename operation finished successfully, false otherwise. Reimplemented in LightApp_DataObject, and SALOME_PYQT_DataObjectLight.
| bool SUIT_DataObject::isOn | ( | const int | id = NameId | ) | const [virtual, inherited] |
Default implementation supports the checked state for the first ("Name") column only.
| id | column id |
References SUIT_DataObject.myCheck, and SUIT_DataObject.NameId.
| void SUIT_DataObject::setOn | ( | const bool | on, |
| const int | id = NameId |
||
| ) | [virtual, inherited] |
Default implementation supports the checked state for the first ("Name") column only.
| on | new checked state of the object for the specified column |
| id | column id |
References SUIT_DataObject.myCheck, and SUIT_DataObject.NameId.
| bool SUIT_DataObject::isOpen | ( | ) | const [virtual, inherited] |
| void SUIT_DataObject::setOpen | ( | const bool | on | ) | [virtual, inherited] |
| void SUIT_DataObject::update | ( | ) | [virtual, inherited] |
| bool SUIT_DataObject::customSorting | ( | const int | = NameId | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns false ("Name" column does not require custom sorting).
| id | column id |
true if column sorting should be customized Reimplemented in LightApp_DataObject, and SalomeApp_DataObject.
| bool SUIT_DataObject::compare | ( | const QVariant & | , |
| const QVariant & | , | ||
| const int | = NameId |
||
| ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns false ("Name" column does not require custom sorting).
This method is called only for those columns for which customSorting() method returns true.
| left | first data to compare |
| right | second data to compare |
| id | column id |
Reimplemented in LightApp_DataObject, and SalomeApp_DataObject.
| SUIT_DataObjectKey * SUIT_DataObject::key | ( | ) | const [virtual, inherited] |
This method can be re-implemented in the subclasses. Default implementation returns 0.
Reimplemented in LightApp_DataObject.
| int SUIT_DataObject::groupId | ( | ) | const [virtual, inherited] |
Groups of data objects are used for column information search. Each column of data model has one or several registered group id If object has the same group id as one of registered, the information will be shown; the custom id of column will be passed into data() method in order to identify column from point of view of data object
Reimplemented in LightApp_DataObject.
| QVariant SUIT_DataObject::customData | ( | Qtx::CustomDataType | ) | [virtual, inherited] |
Reimplemented in LightApp_DataObject.
| SUIT_DataObject::Signal * SUIT_DataObject::signal | ( | ) | [static, inherited] |
References SUIT_DataObject.mySignal.
| bool SUIT_DataObject::connect | ( | const char * | sig, |
| QObject * | reciever, | ||
| const char * | slot | ||
| ) | [static, inherited] |
| sig | signal name |
| reciever | signal receiver object |
| slot | slot name |
true if connection is successfull References SUIT_DataObject.signal().
| bool SUIT_DataObject::disconnect | ( | const char * | sig, |
| QObject * | reciever, | ||
| const char * | slot | ||
| ) | [static, inherited] |
| sig | signal name |
| reciever | signal receiver object |
| slot | slot name |
true if disconnection is successfull References SUIT_DataObject.signal().
| void SUIT_DataObject::deleteLater | ( | ) | [inherited] |
The object will be deleted when control returns to the event loop. Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called.
References SUIT_DataObject.Signal.deleteLater(), SUIT_DataObject.parent(), SUIT_DataObject.removeChild(), and SUIT_DataObject.signal().
| void SUIT_DataObject::dump | ( | const int | indent = 2 | ) | const [inherited] |
| indent | current indentation level |
References SUIT_DataObject.myChildren, and SUIT_DataObject.name().
friend class SUIT_DataObject::Signal [friend, inherited] |