Back to index

salome-gui  6.5.0
LightApp_Selection.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  LightApp_Selection
00024 //  File   : LightApp_Selection.h
00025 //  Author : Alexander SOLOVYOV
00026 
00027 #ifndef LIGHTAPP_SELECTION_HeaderFile
00028 #define LIGHTAPP_SELECTION_HeaderFile
00029 
00030 #include "LightApp.h"
00031 #include <QtxPopupMgr.h>
00032 
00033 class LightApp_SelectionMgr;
00034 class LightApp_DataOwner;
00035 class LightApp_Study;
00036 class SUIT_ViewWindow;
00037 
00045 class LIGHTAPP_EXPORT LightApp_Selection : public QtxPopupSelection
00046 {
00047 protected:
00048   typedef enum { OI_Entry, OI_Reference, OI_User } ObjectInformation;
00049 
00050 public:
00051   LightApp_Selection();
00052   virtual ~LightApp_Selection();
00053 
00054   virtual void                    init( const QString&, LightApp_SelectionMgr* );
00055   virtual bool                    processOwner( const LightApp_DataOwner* );
00056 
00057   virtual int                     count() const;
00058   virtual QVariant                parameter( const QString& ) const;
00059   virtual QVariant                parameter( const int, const QString& ) const;
00060   void                            setModuleName( const QString );
00061 
00062 protected:
00063   //  virtual QVariant                contextParameter( const QString& ) const;
00064   //  virtual QVariant                objectParameter( const int, const QString& ) const;
00065 
00066   QString                         entry( const int ) const;
00067   bool                            isReference( const int ) const;
00068 
00070   LightApp_Study*                 study() const { return myStudy; }
00071   QString                         activeViewType() const;
00072   SUIT_ViewWindow*                activeVW() const;
00073   virtual QString                 referencedToEntry( const QString& ) const;
00074 
00075   QVariant                        objectInfo( const int, const int ) const;
00076   void                            setObjectInfo( const int, const int, const QVariant& );
00077 
00078 private:
00079   typedef QMap<int, QVariant>     ObjectInfo;
00080   typedef QVector<ObjectInfo>     ObjectInfoVector;
00081   /*
00082   typedef QMap<QString, QVariant> ParameterMap;
00083   typedef QVector<ParameterMap>   ObjectParamVector;
00084   */
00085 private:
00086   LightApp_Study*                 myStudy;
00087   QString                         myContext;
00088  
00089   ObjectInfoVector                myObjects;
00090   /*
00091   ParameterMap                    myContextParams;
00092   ObjectParamVector               myObjectsParams;
00093   */
00094 };
00095 
00096 #endif