+
+/*!
+ \return data model group id used for custom columns creation
+*/
+int LightApp_DataModel::groupId() const
+{
+ return myGroupId;
+}
+
+/*!
+ Register custom column in the object browser
+ \param browser - object browser where new column should be created
+ \param name - translated column name
+ \param custom_id - custom column identificator passed into data object's methods text(), icon() etc
+*/
+void LightApp_DataModel::registerColumn( SUIT_DataBrowser* browser, const QString& name, const int custom_id )
+{
+ SUIT_AbstractModel* m = dynamic_cast<SUIT_AbstractModel*>( browser ? browser->model() : 0 );
+ if( m )
+ m->registerColumn( groupId(), name, custom_id );
+}
+
+/*!
+ Remove registered custom column from the object browser
+ \param browser - object browser where new column should be created
+ \param name - translated column name
+*/
+void LightApp_DataModel::unregisterColumn( SUIT_DataBrowser* browser, const QString& name )
+{
+ SUIT_AbstractModel* m = dynamic_cast<SUIT_AbstractModel*>( browser ? browser->model() : 0 );
+ if( m )
+ m->unregisterColumn( groupId(), name );
+}
+
+/*!
+ Creates the data model's root (module object) using the study services.
+ This is important because different study classes use different moduel object classes.
+ Therefore creation of the module object cannot be done at the data model level
+ where the type of the current study instance should not be known.
+ The module object returned by this method should be then passed to the model's setRoot().
+ \return the module object instance corresponding to the study type
+ \sa CAM_DataModel class
+*/
+CAM_ModuleObject* LightApp_DataModel::createModuleObject( SUIT_DataObject* theRoot ) const
+{
+ LightApp_RootObject* aStudyRoot = dynamic_cast<LightApp_RootObject*>( theRoot );
+ if ( !aStudyRoot )
+ return 0;
+
+ LightApp_Study* aStudy = aStudyRoot->study();
+ if ( aStudy )
+ return aStudy->createModuleObject( const_cast<LightApp_DataModel*>( this ),
+ theRoot );
+ return 0;
+}