Salome HOME
Copyright update 2022
[modules/gui.git] / src / LightApp / LightApp_Selection.h
index 846699f3b5c413c33be073889e17c2c5efb9665b..64491dcb263202dfb55ece88d49afd9913459e00 100644 (file)
@@ -1,30 +1,28 @@
-//  LightApp_Selection
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-//
-//
+
+//  LightApp_Selection
 //  File   : LightApp_Selection.h
 //  Author : Alexander SOLOVYOV
-//  Module : GUI
-//  $Header$
 
 #ifndef LIGHTAPP_SELECTION_HeaderFile
 #define LIGHTAPP_SELECTION_HeaderFile
@@ -44,33 +42,55 @@ class SUIT_ViewWindow;
   It is able to return values of standard object properties
   (isVisible,isComponent,canBeDisplayed,isReference, etc)
 */
-class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupMgr::Selection
+class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupSelection
 {
+protected:
+  typedef enum { OI_Entry, OI_Reference, OI_RefEntry, OI_User } ObjectInformation;
+
 public:
   LightApp_Selection();
   virtual ~LightApp_Selection();
 
-  virtual void                   init( const QString&, LightApp_SelectionMgr* );
-  virtual void                   processOwner( const LightApp_DataOwner* );
+  virtual void                    init( const QString&, LightApp_SelectionMgr* );
+  virtual bool                    processOwner( const LightApp_DataOwner* );
 
-  virtual int                    count() const;
-  virtual QtxValue               param( const int, const QString& ) const;
-  virtual QtxValue               globalParam( const QString& ) const;
-  void                           setModuleName( const QString );
+  virtual int                     count() const;
+  virtual QVariant                parameter( const QString& ) const;
+  virtual QVariant                parameter( const int, const QString& ) const;
+  void                            setModuleName( const QString );
 
 protected:
-  QString                        entry( const int ) const;
-  bool                           isReference( const int ) const;
+  //  virtual QVariant                contextParameter( const QString& ) const;
+  //  virtual QVariant                objectParameter( const int, const QString& ) const;
+
+  QString                         entry( const int ) const;
+  bool                            isReference( const int ) const;
+
   /*!Gets study.*/
-  LightApp_Study*                study() const { return myStudy; }
-  QString                        activeViewType() const;
-  SUIT_ViewWindow*               activeVW() const;
+  LightApp_Study*                 study() const { return myStudy; }
+  QString                         activeViewType() const;
+  SUIT_ViewWindow*                activeVW() const;
+  virtual QString                 referencedToEntry( const QString& ) const;
 
+  QVariant                        objectInfo( const int, const int ) const;
+  void                            setObjectInfo( const int, const int, const QVariant& );
+
+private:
+  typedef QMap<int, QVariant>     ObjectInfo;
+  typedef QVector<ObjectInfo>     ObjectInfoVector;
+  /*
+  typedef QMap<QString, QVariant> ParameterMap;
+  typedef QVector<ParameterMap>   ObjectParamVector;
+  */
 private:
-  QString                        myPopupClient;
-  QMap<int,QString>              myEntries; // entries of selected objects
-  QMap<int,bool>                 myIsReferences; // whether i-th selected object was a reference
-  LightApp_Study*                myStudy;
+  LightApp_Study*                 myStudy;
+  QString                         myContext;
+  ObjectInfoVector                myObjects;
+  /*
+  ParameterMap                    myContextParams;
+  ObjectParamVector               myObjectsParams;
+  */
 };
 
 #endif