1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef FILTERGUI_Utils_HeaderFile
20 #define FILTERGUI_Utils_HeaderFile
24 #include "SALOMEDSClient_definitions.hxx"
25 #include "SALOME_InteractiveObject.hxx"
26 #include "LightApp_DataOwner.h"
30 class SUIT_ViewWindow;
33 class SUIT_ResourceMgr;
37 class SALOMEDSClient_Study;
38 class SALOMEDSClient_SObject;
40 class SalomeApp_Study;
41 class SalomeApp_Module;
42 class LightApp_SelectionMgr;
47 GetDesktop(const CAM_Module* theModule);
49 LightApp_SelectionMgr*
50 GetSelectionMgr(const SalomeApp_Module* theModule);
53 GetAppStudy(const CAM_Module* theModule);
56 GetResourceMgr( const SalomeApp_Module* );
59 GetCStudy(const SalomeApp_Study* theStudy);
61 CORBA::Object_var DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner);
63 template<class TInterface> typename TInterface::_var_type
64 DataOwnerToInterface(const LightApp_DataOwnerPtr& theDataOwner)
66 CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
67 if(!CORBA::is_nil(anObj))
68 return TInterface::_narrow(anObj);
69 return TInterface::_nil();
73 SUIT_Study* GetActiveStudy();
75 SUIT_ViewWindow* GetActiveWindow();
77 _PTR(Study) GetActiveStudyDocument();
79 _PTR(SObject) FindSObject(CORBA::Object_ptr theObject);
81 void SetName (_PTR(SObject) theSObject, const char* theName);
82 void SetValue (_PTR(SObject) theSObject, const char* theValue);
83 void setFileType (_PTR(SObject) theSObject, const char* theValue);
84 void setFileName (_PTR(SObject) theSObject, const char* theValue);
86 CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
87 _PTR(Study) theStudy);
89 CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject);
91 template<class TInterface> typename TInterface::_var_type
92 SObjectToInterface(_PTR(SObject) theSObject)
94 CORBA::Object_var anObj = SObjectToObject(theSObject);
95 if(!CORBA::is_nil(anObj))
96 return TInterface::_narrow(anObj);
97 return TInterface::_nil();
100 CORBA::Object_var IObjectToObject(const Handle(SALOME_InteractiveObject)& theIO);
102 template<class TInterface> typename TInterface::_var_type
103 IObjectToInterface(const Handle(SALOME_InteractiveObject)& theIO)
105 CORBA::Object_var anObj = IObjectToObject(theIO);
106 if(!CORBA::is_nil(anObj))
107 return TInterface::_narrow(anObj);
108 return TInterface::_nil();
111 CORBA::Object_var IORToObject(const char* theIOR);
113 template<class TInterface> typename TInterface::_var_type
114 IORToInterface(const char* theIOR)
116 CORBA::Object_var anObj = IORToObject(theIOR);
117 if(!CORBA::is_nil(anObj))
118 return TInterface::_narrow(anObj);
119 return TInterface::_nil();
122 int GetNameOfSelectedIObjects (LightApp_SelectionMgr*, QString& theName);
124 // void UpdateObjBrowser (bool);