Salome HOME
updated copyright message
[samples/light.git] / src / LIGHTGUI / LIGHTGUI.h
1 // Copyright (C) 2005-2023  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, or (at your option) any later version.
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 // File   : LIGHTGUI.h
20 // Author : Julia DOROVSKIKH
21
22 #ifndef LIGHTGUI_H
23 #define LIGHTGUI_H
24
25 #include "LIGHTGUI_Exports.h"
26
27 #include <LightApp_Module.h>
28
29 class LIGHT_EXPORT LIGHTGUI: public LightApp_Module
30 {
31   Q_OBJECT
32    
33   //! Menu actions
34   enum { 
35     lgLoadFile = 931,   //!< load text file
36     lgSaveFile,         //!< save text file
37     lgDisplayLine,      //!< display selected line
38     lgEraseLine,        //!< erase selected line
39     lgEditLine,         //!< edit selected line
40     lgAddLine,          //!< insert new line
41     lgDelLine,          //!< delete selected line
42     lgClear             //!< clear all contents
43   };
44
45 public:
46   LIGHTGUI();
47   ~LIGHTGUI();
48
49   void                   initialize( CAM_Application* );
50
51   void                   windows( QMap<int, int>& ) const;
52
53   LightApp_Selection*    createSelection() const;
54
55   bool                   renameObject( const QString&, const QString& );
56   bool                   renameAllowed( const QString& ) const;
57
58 protected:
59   CAM_DataModel*         createDataModel();
60   int                    selectedLine();
61
62   void                   displayLine( const int, const bool = false, const bool = true );
63   void                   eraseLine( const int, const bool = false, const bool = true );
64   void                   updateLine( const int, const bool = false, const bool = true );
65   void                   eraseLines( const QList<int>&, const bool = false );
66   void                   updateLines( const QList<int>&, const bool = false );
67
68 public slots:
69   bool                   activateModule( SUIT_Study* );
70   bool                   deactivateModule( SUIT_Study* );
71
72 private slots:
73   void                   onLoadFile();
74   void                   onSaveFile();
75   void                   onDisplayLine();
76   void                   onEraseLine();
77   void                   onEditLine();
78   void                   onAddLine();
79   void                   onDelLine();
80   void                   onClear();
81 };
82
83 #endif // LIGHTGUI_H