+
+/*!
+ virtual SLOT: called on view manager adding
+*/
+void LightApp_Module::onViewManagerAdded( SUIT_ViewManager* )
+{
+}
+
+/*!
+ virtual SLOT: called on view manager removing
+*/
+void LightApp_Module::onViewManagerRemoved( SUIT_ViewManager* )
+{
+}
+
+/*!
+ \brief Returns instance of operation by its id; if there is no operation
+ corresponding to this id, null pointer is returned
+ \param id - operation id
+ \return operation instance
+*/
+LightApp_Operation* LightApp_Module::operation( const int id ) const
+{
+ return myOperations.contains( id ) ? myOperations[id] : 0;
+}
+
+/*!
+ virtual method called to manage the same operations
+*/
+bool LightApp_Module::reusableOperation( const int id )
+{
+ return true;
+}
+
+/*!
+ virtual method
+ \return true if module can copy the current selection
+*/
+bool LightApp_Module::canCopy() const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \return true if module can paste previously copied data
+*/
+bool LightApp_Module::canPaste() const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \brief Copies the current selection into clipboard
+*/
+void LightApp_Module::copy()
+{
+}
+
+/*!
+ virtual method
+ \brief Pastes the current data in the clipboard
+*/
+void LightApp_Module::paste()
+{
+}
+
+/*!
+ virtual method
+ \return true if module allows dragging the given object
+*/
+bool LightApp_Module::isDraggable( const SUIT_DataObject* /*what*/ ) const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \return true if module allows dropping one or more objects (currently selected) on the object \c where
+*/
+bool LightApp_Module::isDropAccepted( const SUIT_DataObject* /*where*/ ) const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ Complete drag-n-drop operation by processing objects \a what being dragged, dropped to the line \a row
+ within the object \a where. The drop action being performed is specified by \a action.
+*/
+void LightApp_Module::dropObjects( const DataObjectList& /*what*/, SUIT_DataObject* /*where*/,
+ const int /*row*/, Qt::DropAction /*action*/ )
+{
+}
+
+/*!
+ \brief Return \c true if object can be renamed
+*/
+bool LightApp_Module::renameAllowed( const QString& /*entry*/ ) const
+{
+ return false;
+}
+
+/*!
+ Rename object by entry.
+ \param entry entry of the object
+ \param name new name of the object
+ \brief Return \c true if rename operation finished successfully, \c false otherwise.
+*/
+bool LightApp_Module::renameObject( const QString& /*entry*/, const QString& /*name*/ )
+{
+ return false;
+}
+
+/*!
+ Update visibility state for data objects
+*/
+void LightApp_Module::updateModuleVisibilityState()
+{
+ // update visibility state of objects
+ LightApp_Application* app = dynamic_cast<LightApp_Application*>(SUIT_Session::session()->activeApplication());
+ if ( !app ) return;
+
+ SUIT_DataBrowser* ob = app->objectBrowser();
+ if ( !ob || !ob->model() ) return;
+
+ // connect to click on item
+ connect( ob->model(), SIGNAL( clicked( SUIT_DataObject*, int ) ),
+ this, SLOT( onObjectClicked( SUIT_DataObject*, int ) ), Qt::UniqueConnection );
+
+ SUIT_DataObject* rootObj = ob->root();
+ if ( !rootObj ) return;
+
+ DataObjectList listObj = rootObj->children( true );
+
+ SUIT_ViewModel* vmod = 0;
+ if ( SUIT_ViewManager* vman = app->activeViewManager() )
+ vmod = vman->getViewModel();
+ app->updateVisibilityState( listObj, vmod );
+}
+
+/*!
+ * \brief Virtual public slot
+ *
+ * This method is called after the object inserted into data view to update their visibility state
+ * This is default implementation
+ */
+void LightApp_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn )
+{
+ if ( !isActiveModule() ) return;
+
+ // change visibility of object
+ if ( !theObject || theColumn != SUIT_DataObject::VisibilityId ) return;
+
+ LightApp_Study* study = dynamic_cast<LightApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if ( !study ) return;
+
+ LightApp_DataObject* lo = dynamic_cast<LightApp_DataObject*>( theObject );
+ if ( !lo ) return;
+
+ // detect action index (from LightApp level)
+ int id = -1;
+
+ if ( study->visibilityState( lo->entry() ) == Qtx::ShownState )
+ id = myErase;
+ else if ( study->visibilityState( lo->entry() ) == Qtx::HiddenState )
+ id = myDisplay;
+
+ if ( id != -1 )
+ startOperation( id );
+}