Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CAM_ModuleObject Class Reference

CAM data model root object. More...

#include <CAM_DataObject.h>

Inheritance diagram for CAM_ModuleObject:
Inheritance graph

Public Member Functions

 CAM_ModuleObject (SUIT_DataObject *=0)
 Constructor. More...
 
 CAM_ModuleObject (CAM_DataModel *, SUIT_DataObject *=0)
 Constructor. More...
 
virtual ~CAM_ModuleObject ()
 Destructor. More...
 
virtual QString name () const
 Get root object name. More...
 
QPixmap icon (const int=NameId) const
 Get data object icon for the specified column. More...
 
QString toolTip (const int=NameId) const
 Get data object tooltip for the specified column. More...
 
virtual CAM_DataModeldataModel () const
 Get data model. More...
 
virtual void setDataModel (CAM_DataModel *)
 Set data model. More...
 
- Public Member Functions inherited from CAM_DataObject
 CAM_DataObject (SUIT_DataObject *=0)
 Constructor. More...
 
virtual ~CAM_DataObject ()
 Destructor. More...
 
CAM_Modulemodule () const
 Get CAM module. More...
 
- Public Member Functions inherited from SUIT_DataObject
 SUIT_DataObject (SUIT_DataObject *=0)
 Constructor. More...
 
virtual ~SUIT_DataObject ()
 Destructor. More...
 
SUIT_DataObjectroot () const
 Get the root object. More...
 
SUIT_DataObjectlastChild () const
 Get the last child object. More...
 
SUIT_DataObjectfirstChild () const
 Get the first child object. More...
 
int childCount () const
 Get the number of the child objects. More...
 
int childPos (const SUIT_DataObject *) const
 Get the index of the specified object in the child list. More...
 
void moveChildPos (SUIT_DataObject *, int)
 Moves the child position from current to new one. More...
 
SUIT_DataObjectchildObject (const int) const
 Get child object by the specified index. More...
 
int level () const
 Get the object level in the tree structure. More...
 
int position () const
 Get the position of the data object in its parent's children list. More...
 
void setPosition (int)
 Sets new position of the object in parent's list. More...
 
SUIT_DataObjectnextBrother () const
 Get the next sibling data object in the children list. More...
 
SUIT_DataObjectprevBrother () const
 Get the previous sibling data object in the children list. More...
 
bool autoDeleteChildren () const
 Get "auto-delete children" flag. More...
 
virtual void setAutoDeleteChildren (const bool)
 Set "auto-delete children" flag. More...
 
virtual void children (DataObjectList &, const bool=false) const
 Get all children. More...
 
virtual DataObjectList children (const bool=false)
 Get all children. . More...
 
void appendChild (SUIT_DataObject *)
 Add new child object to the end of the children list. More...
 
virtual void insertChild (SUIT_DataObject *, int)
 Insert new child object to the list of the children. More...
 
virtual void removeChild (SUIT_DataObject *, const bool=false)
 Remove the specified child object reference. More...
 
bool replaceChild (SUIT_DataObject *, SUIT_DataObject *, const bool=false)
 Replace the specified child object by another object. More...
 
void reparentChildren (const SUIT_DataObject *)
 Change the parent for all children from specified object to this one. More...
 
virtual SUIT_DataObjectparent () const
 Get the parent object. More...
 
virtual void setParent (SUIT_DataObject *)
 Change the parent object. More...
 
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). More...
 
bool modified ()
 
virtual void setModified (bool modified)
 Sets modification state of the object. More...
 
virtual QString text (const int=NameId) const
 Get object text data for the specified column. More...
 
virtual QColor color (const ColorRole, const int=NameId) const
 Get data object color for the specified column. More...
 
virtual QString statusTip (const int=NameId) const
 Get data object status tip for the specified column. More...
 
virtual QString whatsThis (const int=NameId) const
 Get data object "what's this" information for the specified column. More...
 
virtual QFont font (const int=NameId) const
 Get data object font for the specified column. More...
 
virtual int alignment (const int=NameId) const
 Get data object text alignment for the specified column. More...
 
virtual bool expandable () const
 
virtual bool isVisible () const
 Check if the object is visible. More...
 
virtual bool isDraggable () const
 Check if the object is draggable. More...
 
virtual bool isDropAccepted () const
 Check if the drop operation for this object is possible. More...
 
virtual bool isEnabled () const
 Check if this object is enabled. More...
 
virtual bool isSelectable () const
 Check if this object is selectable. More...
 
virtual bool isCheckable (const int=NameId) const
 Check if this object is checkable for the specified column. More...
 
virtual bool renameAllowed (const int=NameId) const
 Check if this object is can't be renamed in place. More...
 
virtual bool setName (const QString &name)
 Set name of the this object. More...
 
virtual bool isOn (const int=NameId) const
 Get the checked state of the object (if it is checkable) for the specified column. More...
 
virtual void setOn (const bool, const int=NameId)
 Set the checked state of the object (if it is checkable) for the specified column. More...
 
virtual bool isOpen () const
 Get the "opened" state of the object. More...
 
virtual void setOpen (const bool)
 Set the "opened" state of the object. More...
 
virtual void update ()
 Updates necessary internal fields of data object. More...
 
virtual bool customSorting (const int=NameId) const
 Check if the specified column supports custom sorting. More...
 
virtual bool compare (const QVariant &, const QVariant &, const int=NameId) const
 Compares data from two items for sorting purposes. More...
 
virtual SUIT_DataObjectKeykey () const
 Get the object unique indentification key. More...
 
virtual int groupId () const
 return unique group identificator More...
 
virtual QVariant customData (Qtx::CustomDataType)
 return custom data for data object. More...
 
void deleteLater ()
 Schedule this object for the late deleting. More...
 
void dump (const int indent=2) const
 Dump the object tree recursively to the standard output. More...
 

Private Attributes

CAM_DataModelmyDataModel
 

Additional Inherited Members

- Public Types inherited from SUIT_DataObject
enum  ColorRole {
  Text, Base, Foreground, Background,
  Highlight, HighlightedText
}
 Color role. More...
 
enum  { NameId, VisibilityId }
 Column id. More...
 
- Static Public Member Functions inherited from SUIT_DataObject
static Signalsignal ()
 Get global signal handler. More...
 
static bool connect (const char *, QObject *, const char *)
 Connect to the signal handlerx. More...
 
static bool disconnect (const char *, QObject *, const char *)
 Disconnect from the signal handler. More...
 

Detailed Description

This class is intended for optimized access to CAM_DataModel instance from CAM_DataObject instances.

To take advantage of this class in a specific application, custom data model root object class should be derived from both CAM_ModuleObject and application-specific DataObject implementation using virtual inheritance.

Constructor & Destructor Documentation

CAM_ModuleObject::CAM_ModuleObject ( SUIT_DataObject parent = 0)
Parameters
parentparent data object
CAM_ModuleObject::CAM_ModuleObject ( CAM_DataModel data,
SUIT_DataObject parent = 0 
)
Parameters
datadata model
parentparent data object
CAM_ModuleObject::~CAM_ModuleObject ( )
virtual

Does nothing.

Member Function Documentation

CAM_DataModel * CAM_ModuleObject::dataModel ( ) const
virtual
Returns
data model pointer or 0 if it is not set

Reimplemented from CAM_DataObject.

References myDataModel.

QPixmap CAM_ModuleObject::icon ( const int  id = NameId) const
virtual

The parameter id specifies the column identificator

Parameters
idcolumn id
Returns
object icon for the specified column

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_ModuleObject, and LightApp_ModuleObject.

References dataModel(), CAM_DataObject::module(), CAM_DataModel::module(), CAM_Module::moduleIcon(), SUIT_DataObject::NameId, and Qtx::scaleIcon().

QString CAM_ModuleObject::name ( ) const
virtual

If the data model is set, this method returns module name. Otherwise returns empty string.

Returns
root object name

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_ModuleObject, and LightApp_ModuleObject.

References CAM_DataModel::module(), CAM_Module::moduleName(), and myDataModel.

void CAM_ModuleObject::setDataModel ( CAM_DataModel dm)
virtual
Parameters
dmdata model

References myDataModel.

QString CAM_ModuleObject::toolTip ( const int  = NameId) const
virtual

The parameter id specifies the column identificator

Parameters
idcolumn id
Returns
object tooltip for the specified column

Reimplemented from SUIT_DataObject.

Reimplemented in SalomeApp_ModuleObject, and LightApp_ModuleObject.

References dataModel(), and CAM_DataObject::module().

Member Data Documentation

CAM_DataModel* CAM_ModuleObject::myDataModel
private

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