]> SALOME platform Git repositories - samples/light.git/blobdiff - src/LIGHTGUI/LIGHTGUI.h
Salome HOME
Merge from BR_V5_DEV 17Feb09
[samples/light.git] / src / LIGHTGUI / LIGHTGUI.h
index 0064ca9870f0bd661bef6657041ee2da6d6e74cf..a69b2337da855eace9e52853a5993f58714c8180 100644 (file)
@@ -1,7 +1,4 @@
-//  LIGHT : sample (no-corba-engine) SALOME module
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//  Copyright (C) 2005-2008  OPEN CASCADE
 //
 //  This library is free software; you can redistribute it and/or
 //  modify it under the terms 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
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// LIGHT : sample (no-corba-engine) SALOME module
+// File   : LIGHTGUI.h
+// Author : Julia DOROVSKIKH
 //
-//  Author : Julia DOROVSKIKH
-//  Date   : 01/01/2005
-//  $Header$
-
 #ifndef LIGHTGUI_H
 #define LIGHTGUI_H
 
 #include <LightApp_Module.h>
 
+class QMenu;
+class LightApp_Selection;
+class LightApp_SelectionMgr;
+
 class LIGHTGUI: public LightApp_Module
 {
   Q_OBJECT
-  enum { lgLoadFile = 931, lgSaveFile, lgDisplayLine, lgEditLine, lgAddLine, lgDelLine, lgClear };
+   
+  //! Menu actions
+  enum { 
+    lgLoadFile = 931,   //!< load text file
+    lgSaveFile,         //!< save text file
+    lgDisplayLine,      //!< display selected line
+    lgEraseLine,        //!< erase selected line
+    lgEditLine,         //!< edit selected line
+    lgAddLine,          //!< insert new line
+    lgDelLine,          //!< delete selected line
+    lgClear             //!< clear all contents
+  };
 
 public:
   LIGHTGUI();
+  ~LIGHTGUI();
+
+  void                   initialize( CAM_Application* );
 
-  virtual void           initialize ( CAM_Application* );
-  virtual QString        iconName() const;
+  void                   windows( QMap<int, int>& ) const;
 
-  virtual void           contextMenuPopup ( const QString&, QPopupMenu*, QString& );
-  virtual void           windows ( QMap<int, int>& ) const;
+  LightApp_Selection*    createSelection() const;
 
 protected:
-  virtual CAM_DataModel* createDataModel();
+  CAM_DataModel*         createDataModel();
   int                    selectedLine();
 
+  void                   displayLine( const int, const bool = false, const bool = true );
+  void                   eraseLine( const int, const bool = false, const bool = true );
+  void                   updateLine( const int, const bool = false, const bool = true );
+  void                   eraseLines( const QList<int>&, const bool = false );
+  void                   updateLines( const QList<int>&, const bool = false );
+
 public slots:
-  virtual bool           activateModule   ( SUIT_Study* );
-  virtual bool           deactivateModule ( SUIT_Study* );
+  bool                   activateModule( SUIT_Study* );
+  bool                   deactivateModule( SUIT_Study* );
 
 private slots:
-  void onLoadFile();
-  void onSaveFile();
-  void onDisplayLine();
-  void onEditLine();
-  void onAddLine ();
-  void onDelLine ();
-  void onClear   ();
+  void                   onLoadFile();
+  void                   onSaveFile();
+  void                   onDisplayLine();
+  void                   onEraseLine();
+  void                   onEditLine();
+  void                   onAddLine();
+  void                   onDelLine();
+  void                   onClear();
 };
 
 #endif // LIGHTGUI_H