Salome HOME
Merge from V6_main_20120808 08Aug12
[samples/hello.git] / src / HELLOGUI / HELLOGUI.h
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  HELLOGUI : HELLO component GUI implemetation
24
25 #ifndef _HELLOGUI_H_
26 #define _HELLOGUI_H_
27
28 #include <SalomeApp_Module.h>
29
30 #include <SALOMEconfig.h>
31 #include CORBA_CLIENT_HEADER(HELLO_Gen)
32
33 class SalomeApp_Application;
34
35 class HELLOGUI: public SalomeApp_Module
36 {
37   Q_OBJECT
38
39   //! operations
40   enum { 
41     OpTestMe  = 190,   //!< Test me
42     OpHello   = 901,   //!< Hello
43     OpGoodbye = 902,   //!< Goodbye
44   };
45
46 public:
47   HELLOGUI();
48   ~HELLOGUI();
49
50   static HELLO_ORB::HELLO_Gen_var engine();
51
52   virtual void                    initialize( CAM_Application* app );
53   virtual QString                 engineIOR() const;
54
55   virtual QPixmap                 moduleIcon() const;
56   virtual QString                 iconName() const;
57
58   virtual void                    windows( QMap<int, int>& theMap ) const;
59   virtual void                    viewManagers( QStringList& theList ) const;
60
61   virtual LightApp_Selection*     createSelection() const;
62   virtual LightApp_Displayer*     displayer();
63
64   virtual void                    contextMenuPopup( const QString& type, QMenu* menu, QString& title );
65
66   virtual void                    createPreferences();
67   virtual void                    preferencesChanged( const QString& section, const QString& parameter );
68
69   virtual void                    storeVisualParameters( int savePoint );
70   virtual void                    restoreVisualParameters( int savePoint );
71
72   virtual void                    studyActivated();
73
74   virtual bool                    canCopy() const;
75   virtual bool                    canPaste() const;
76   virtual void                    copy();
77   virtual void                    paste();
78
79   virtual bool                    isDraggable( const SUIT_DataObject* what ) const;
80   virtual bool                    isDropAccepted( const SUIT_DataObject* where ) const;
81   virtual void                    dropObjects( const DataObjectList& what, SUIT_DataObject* where,
82                                                const int row, Qt::DropAction action );
83
84 public slots:
85   virtual bool                    activateModule( SUIT_Study* theStudy );
86   virtual bool                    deactivateModule( SUIT_Study* theStudy );
87
88 protected:
89   virtual LightApp_Operation*     createOperation( const int id ) const;
90
91 protected slots:
92   void                            testMe();
93   void                            hello();
94   void                            goodbye();
95
96 private:
97   static void                     init();
98
99 private:
100   static HELLO_ORB::HELLO_Gen_var myEngine;
101 };
102
103 #endif // _HELLOGUI_H_