]> SALOME platform Git repositories - samples/light.git/blob - src/LIGHTGUI/LIGHTGUI.h
Salome HOME
Set dev tag back to 1
[samples/light.git] / src / LIGHTGUI / LIGHTGUI.h
1 // Copyright (C) 2005-2012  OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // LIGHT : sample (no-corba-engine) SALOME module
21 // File   : LIGHTGUI.h
22 // Author : Julia DOROVSKIKH
23 //
24 #ifndef LIGHTGUI_H
25 #define LIGHTGUI_H
26
27 #include <LightApp_Module.h>
28
29 class QMenu;
30 class LightApp_Selection;
31 class LightApp_SelectionMgr;
32
33 class LIGHTGUI: public LightApp_Module
34 {
35   Q_OBJECT
36    
37   //! Menu actions
38   enum { 
39     lgLoadFile = 931,   //!< load text file
40     lgSaveFile,         //!< save text file
41     lgDisplayLine,      //!< display selected line
42     lgEraseLine,        //!< erase selected line
43     lgEditLine,         //!< edit selected line
44     lgAddLine,          //!< insert new line
45     lgDelLine,          //!< delete selected line
46     lgClear             //!< clear all contents
47   };
48
49 public:
50   LIGHTGUI();
51   ~LIGHTGUI();
52
53   void                   initialize( CAM_Application* );
54
55   void                   windows( QMap<int, int>& ) const;
56
57   LightApp_Selection*    createSelection() const;
58
59 protected:
60   CAM_DataModel*         createDataModel();
61   int                    selectedLine();
62
63   void                   displayLine( const int, const bool = false, const bool = true );
64   void                   eraseLine( const int, const bool = false, const bool = true );
65   void                   updateLine( const int, const bool = false, const bool = true );
66   void                   eraseLines( const QList<int>&, const bool = false );
67   void                   updateLines( const QList<int>&, const bool = false );
68
69 public slots:
70   bool                   activateModule( SUIT_Study* );
71   bool                   deactivateModule( SUIT_Study* );
72
73 private slots:
74   void                   onLoadFile();
75   void                   onSaveFile();
76   void                   onDisplayLine();
77   void                   onEraseLine();
78   void                   onEditLine();
79   void                   onAddLine();
80   void                   onDelLine();
81   void                   onClear();
82 };
83
84 #endif // LIGHTGUI_H