Salome HOME
refs #567: add "POLYLINES" partition and modified icon for Land Cover object.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_StricklerTableDlg.h
index 282648de9455229c1ba88c1c51f5f86c03f2ba2a..0fa872b2d18fd1e27e35e48b70b5af70031a28bd 100644 (file)
 
 #include "HYDROGUI_InputPanel.h"
 
+class HYDROData_StricklerTable;
+
 class QGroupBox;
 class QLineEdit;
 class QToolButton;
+class QTableWidget;
+class QtxFilePath;
 
 class HYDROGUI_StricklerTableDlg : public HYDROGUI_InputPanel
 {
-  Q_OBJECT
+    Q_OBJECT
 
 public:
-  HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModule, const QString& theTitle );
-  virtual ~HYDROGUI_StricklerTableDlg();
+    struct StricklerCoefficient
+    {
+        QString myType;
+        double  myCoefficient;
 
-  void                       setIsEdit( const bool theIsEdit );
-  void                       reset();
+        StricklerCoefficient(  const QString& theType,
+            double theCoefficient )
+            : myType( theType ), myCoefficient( theCoefficient ) {}
+    };
+    typedef QList<StricklerCoefficient> StricklerCoefficientList;
 
-  QString                    getFileName() const;
-  void                       setFileName( const QString& theName );
+    enum { Edit, Import, Export };
 
-  void                       setStricklerTableName( const QString& theName );
-  QString                    getStricklerTableName() const;
+public:
+    HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModule, const QString& theTitle, int theType );
+    virtual ~HYDROGUI_StricklerTableDlg();
 
-protected slots:
-  void                       onBrowse();
+    void                       reset();
 
-signals:
-  void                       fileSelected( const QString& theFileName );
+    QString                    getFileName() const;
+    void                       setFileName( const QString& theName );
 
-private:
-  QGroupBox*                 myFileNameGroup;    //!< The group for the source Strickler table file selection
-  QLineEdit*                 myFileName;         //!< Source Strickler table file name input field
-  QToolButton*               myBrowseBtn;
+    void                       setTableName( const QString& theName );
+    QString                    getTableName() const;
+
+    bool                       isTableNameReadOnly() const;
+    void                       setTableNameReadOnly( bool );
+
+    StricklerCoefficientList   getData() const;
+    void                       setData(const StricklerCoefficientList& theData);
 
-  QGroupBox*                 myNameGroup;   //!< The group for the Strickler table name input field
-  QLineEdit*                 myName;        //!< The Strickler table name input field
+protected:
+    void                       updateControls();
+    void                       removeRows( const QList<int> theRows );
 
+protected Q_SLOTS:
+    void                       onBrowse();
+
+    void                       onAddCoefficient();
+    void                       onRemoveCoefficient();
+    void                       onClearCoefficients();
+
+    void                       onSelectionChanged();
+
+Q_SIGNALS:
+    void                       fileSelected( const QString& theFileName );
+
+private:
+    int                        myType;
+    QLineEdit*                 myFileName;   //!< Source Strickler table file name input field
+    QLineEdit*                 myName;       //!< The Strickler table name input field
+    QTableWidget*              myTable;      //!< The table of Strickler coefficients
+    QToolButton*               myAddBtn;     //!< The add Strickler coefficient button
+    QToolButton*               myRemoveBtn;  //!< The remove Strickler coefficient button
+    QToolButton*               myClearBtn;   //!< The clear all Strickler coefficients button
 };
 
 #endif