1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROGUI_OPERATION_H
20 #define HYDROGUI_OPERATION_H
22 #include <LightApp_Operation.h>
24 class HYDROGUI_Module;
25 class HYDROGUI_InputPanel;
28 class SUIT_SelectionMgr;
29 class OCCViewer_ViewManager;
31 class Handle_HYDROData_Document;
32 class Handle_HYDROData_Object;
34 class HYDROGUI_Operation : public LightApp_Operation
40 HYDROGUI_Operation( HYDROGUI_Module* theModule );
41 virtual ~HYDROGUI_Operation();
45 void setName( const QString& theName );
46 const QString& getName() const;
48 HYDROGUI_InputPanel* inputPanel() const;
49 SUIT_SelectionMgr* selectionMgr() const;
50 HYDROGUI_Module* module() const;
52 int getPreviewZLayer() const;
53 virtual void updatePreviewZLayer( int theLayer );
56 void helpContextModule( const QString&,
61 virtual void startOperation();
62 virtual void abortOperation();
63 virtual void commitOperation();
64 virtual void stopOperation();
65 virtual void setDialogActive( const bool );
67 virtual HYDROGUI_InputPanel* createInputPanel() const;
68 virtual void closeInputPanel();
70 virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
71 QStringList& theBrowseObjectsEntries );
72 virtual void processCancel();
74 void startDocOperation();
75 void abortDocOperation();
76 void commitDocOperation();
78 Handle_HYDROData_Document doc() const;
80 virtual bool isToAbortOnApply() const { return true; }
82 void printErrorMessage( const QString& theErrorMsg );
83 void setPrintErrorMessage( const bool theIsPrint );
85 void browseObjects( const QStringList& theBrowseObjectsEntries );
89 virtual void onApply();
90 virtual void onCancel();
91 virtual void onHelp();
95 QString getHelpComponent() const;
96 QString getHelpFile() const;
97 QString getHelpContext() const;
99 virtual void setPreviewZLayer( int theLayer );
100 virtual HYDROGUI_Shape* getPreviewShape() const;
101 OCCViewer_ViewManager* getPreviewManager();
102 void setPreviewManager( OCCViewer_ViewManager* theManager );
106 HYDROGUI_Module* myModule;
107 HYDROGUI_InputPanel* myPanel;
108 OCCViewer_ViewManager* myPreviewManager;
110 bool myIsPrintErrorMessage;
111 bool myIsTransactionOpened;