1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROGUI_OPERATION_H
24 #define HYDROGUI_OPERATION_H
26 #include <LightApp_Operation.h>
30 class HYDROGUI_Module;
31 class HYDROGUI_InputPanel;
34 class SUIT_SelectionMgr;
35 class OCCViewer_ViewManager;
37 class Handle_HYDROData_Document;
38 class Handle_HYDROData_Object;
40 class HYDROGUI_Operation : public LightApp_Operation
46 HYDROGUI_Operation( HYDROGUI_Module* theModule );
47 virtual ~HYDROGUI_Operation();
51 void setName( const QString& theName );
52 const QString& getName() const;
54 HYDROGUI_InputPanel* inputPanel() const;
55 SUIT_SelectionMgr* selectionMgr() const;
56 HYDROGUI_Module* module() const;
58 int getPreviewZLayer() const;
59 virtual void updatePreviewZLayer( int theLayer );
62 void helpContextModule( const QString&,
67 virtual void startOperation();
68 virtual void abortOperation();
69 virtual void commitOperation();
70 virtual void stopOperation();
71 virtual void setDialogActive( const bool );
73 virtual HYDROGUI_InputPanel* createInputPanel() const;
74 virtual void closeInputPanel();
76 virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
77 QStringList& theBrowseObjectsEntries );
78 virtual void processCancel();
80 void startDocOperation();
81 void abortDocOperation();
82 void commitDocOperation();
84 Handle_HYDROData_Document doc() const;
86 virtual bool isToAbortOnApply() const { return true; }
88 void printErrorMessage( const QString& theErrorMsg );
89 void setPrintErrorMessage( const bool theIsPrint );
91 void browseObjects( const QStringList& theBrowseObjectsEntries );
95 virtual void onApply();
96 virtual void onCancel();
97 virtual void onHelp();
101 QString getHelpComponent() const;
102 QString getHelpFile() const;
103 QString getHelpContext() const;
105 virtual void setPreviewZLayer( int theLayer );
106 virtual HYDROGUI_Shape* getPreviewShape() const;
107 OCCViewer_ViewManager* getPreviewManager();
108 void setPreviewManager( OCCViewer_ViewManager* theManager );
111 * Set specific cursor chosen in preferences for edition operations.
113 virtual void setCursor();
115 * Restore the default cursor.
117 virtual void restoreCursor();
121 HYDROGUI_Module* myModule;
122 HYDROGUI_InputPanel* myPanel;
123 OCCViewer_ViewManager* myPreviewManager;
125 bool myIsPrintErrorMessage;
126 bool myIsTransactionOpened;