+
+//================================================================
+// Function : GetListOfFiles
+/*! Purpose : to be used by CORBAless modules*/
+//================================================================
+std::vector<std::string> SalomeApp_Study::GetListOfFiles( const char* theModuleName ) const
+{
+ SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance();
+ if (aDefaultEngine)
+ return aDefaultEngine->GetListOfFiles(id(), theModuleName);
+
+ std::vector<std::string> aListOfFiles;
+ return aListOfFiles;
+}
+
+//================================================================
+// Function : SetListOfFiles
+/*! Purpose : to be used by CORBAless modules*/
+//================================================================
+void SalomeApp_Study::SetListOfFiles ( const char* theModuleName,
+ const std::vector<std::string> theListOfFiles )
+{
+ SalomeApp_Engine_i* aDefaultEngine = SalomeApp_Engine_i::GetInstance();
+ if (aDefaultEngine)
+ aDefaultEngine->SetListOfFiles(theListOfFiles, id(), theModuleName);
+}
+
+//================================================================
+// Function : GetTmpDir
+/*! Purpose : to be used by CORBAless modules*/
+//================================================================
+std::string SalomeApp_Study::GetTmpDir ( const char* theURL, const bool isMultiFile )
+{
+ std::string anURLDir = SALOMEDS_Tool::GetDirFromPath(theURL);
+ std::string aTmpDir = isMultiFile ? anURLDir : SALOMEDS_Tool::GetTmpDir();
+ return aTmpDir;
+}
+
+//================================================================
+// Function : RemoveTemporaryFiles
+/*! Purpose : to be used by CORBAless modules*/
+//================================================================
+void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, const bool isMultiFile ) const
+{
+ if (isMultiFile)
+ return;
+
+ std::vector<std::string> aListOfFiles = GetListOfFiles( theModuleName );
+ if (aListOfFiles.size() > 0) {
+ std::string aTmpDir = aListOfFiles[0];
+
+ const int n = aListOfFiles.size() - 1;
+ SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
+ aSeq->length(n);
+ for (int i = 0; i < n; i++)
+ aSeq[i] = CORBA::string_dup(aListOfFiles[i + 1].c_str());
+
+ SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
+ }
+}
+
+// END: methods to be used by CORBAless modules
+
+void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj )
+{
+ _PTR(StudyBuilder) sb = studyDS()->NewBuilder();
+ std::vector<_PTR(SObject)> aRefs = studyDS()->FindDependances( obj );
+ for( int i=0, n=aRefs.size(); i<n; i++ )
+ {
+ _PTR( SObject ) o = aRefs[i];
+ if( o->GetFatherComponent()->ComponentDataType()==obj->GetFatherComponent()->ComponentDataType() )
+ {
+ sb->RemoveReference( o );
+ sb->RemoveObjectWithChildren( o );
+ }
+ }
+}
+
+//================================================================
+// Function : referencedToEntry
+/*! Purpose : Return referenced entry from entry*/
+//================================================================
+QString SalomeApp_Study::referencedToEntry( const QString& entry ) const
+{
+ _PTR(SObject) obj = studyDS()->FindObjectID( entry.latin1() );
+ _PTR(SObject) refobj;
+
+ if( obj && obj->ReferencedObject( refobj ) )
+ return refobj->GetID().c_str();
+ return LightApp_Study::referencedToEntry( entry );
+}
+
+//================================================================
+// Function : componentDataType
+/*! Purpose : Return component data type from entry*/
+//================================================================
+QString SalomeApp_Study::componentDataType( const QString& entry ) const
+{
+ _PTR(SObject) obj( studyDS()->FindObjectID( entry.latin1() ) );
+ if ( !obj )
+ return LightApp_Study::componentDataType( entry );
+ return obj->GetFatherComponent()->ComponentDataType().c_str();
+}
+
+//================================================================
+// Function : componentDataType
+/*! Purpose : Return component data type from entry*/
+//================================================================
+bool SalomeApp_Study::isComponent( const QString& entry ) const
+{
+ _PTR(SObject) obj( studyDS()->FindObjectID( entry.latin1() ) );
+ return obj && QString( obj->GetID().c_str() ) == obj->GetFatherComponent()->GetID().c_str();
+}
+
+//================================================================
+// Function : children
+/*! Purpose : Return entries of children of object*/
+//================================================================
+void SalomeApp_Study::children( const QString& entry, QStringList& child_entries ) const
+{
+ _PTR(SObject) SO = studyDS()->FindObjectID( entry.latin1() );
+ _PTR(ChildIterator) anIter ( studyDS()->NewChildIterator( SO ) );
+ anIter->InitEx( true );
+ while( anIter->More() )
+ {
+ _PTR(SObject) val( anIter->Value() );
+ child_entries.append( val->GetID() );
+ anIter->Next();
+ }
+}
+
+void SalomeApp_Study::components( QStringList& comps ) const
+{
+ for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() )
+ {
+ _PTR(SComponent) aComponent ( it->Value() );
+ if( aComponent && aComponent->ComponentDataType() == "Interface Applicative" )
+ continue; // skip the magic "Interface Applicative" component
+ comps.append( aComponent->ComponentDataType() );
+ }
+}