Salome HOME
Copyright update: 2016
[samples/hello.git] / src / HELLOGUI / HELLOGUI.h
1 // Copyright (C) 2007-2016  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, or (at your option) any later version.
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
29 #ifdef WIN32
30 # if defined HELLO_EXPORTS || defined Hello_EXPORTS
31 #  define HELLO_EXPORT __declspec( dllexport )
32 # else
33 #  define HELLO_EXPORT __declspec( dllimport )
34 # endif
35 #else
36 # define HELLO_EXPORT
37 #endif
38
39 #include <SalomeApp_Module.h>
40
41 #include <SALOMEconfig.h>
42 #include CORBA_CLIENT_HEADER(HELLO_Gen)
43
44 class SalomeApp_Application;
45
46 class HELLO_EXPORT HELLOGUI: public SalomeApp_Module
47 {
48   Q_OBJECT
49
50   //! operations
51   enum { 
52     OpTestMe  = 190,   //!< Test me
53     OpHello   = 901,   //!< Hello
54     OpGoodbye = 902,   //!< Goodbye
55   };
56
57 public:
58   HELLOGUI();
59   ~HELLOGUI();
60
61   static HELLO_ORB::HELLO_Gen_var engine();
62
63   virtual void                    initialize( CAM_Application* app );
64   virtual QString                 engineIOR() const;
65
66   virtual QPixmap                 moduleIcon() const;
67   virtual QString                 iconName() const;
68
69   virtual void                    windows( QMap<int, int>& theMap ) const;
70   virtual void                    viewManagers( QStringList& theList ) const;
71
72   virtual LightApp_Selection*     createSelection() const;
73   virtual LightApp_Displayer*     displayer();
74
75   virtual void                    contextMenuPopup( const QString& type, QMenu* menu, QString& title );
76
77   virtual void                    createPreferences();
78   virtual void                    preferencesChanged( const QString& section, const QString& parameter );
79
80   virtual void                    storeVisualParameters( int savePoint );
81   virtual void                    restoreVisualParameters( int savePoint );
82
83   virtual void                    studyActivated();
84
85   virtual bool                    canCopy() const;
86   virtual bool                    canPaste() const;
87   virtual void                    copy();
88   virtual void                    paste();
89
90   virtual bool                    isDraggable( const SUIT_DataObject* what ) const;
91   virtual bool                    isDropAccepted( const SUIT_DataObject* where ) const;
92   virtual void                    dropObjects( const DataObjectList& what, SUIT_DataObject* where,
93                                                const int row, Qt::DropAction action );
94
95 public slots:
96   virtual bool                    activateModule( SUIT_Study* theStudy );
97   virtual bool                    deactivateModule( SUIT_Study* theStudy );
98
99 protected:
100   virtual LightApp_Operation*     createOperation( const int id ) const;
101
102 protected slots:
103   void                            testMe();
104   void                            hello();
105   void                            goodbye();
106
107 private:
108   static void                     init();
109
110 private:
111   static HELLO_ORB::HELLO_Gen_var myEngine;
112 };
113
114 #endif // _HELLOGUI_H_