Salome HOME
Issue #1428: Find referenced feature by parameters recursive
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_WidgetParamsMgr.h
index aba839b9ff68d673d3c350ba878899b7d1a7c39e..9f9fda3b06b4b7270c47dee2311ef5783322d431 100644 (file)
@@ -14,6 +14,8 @@
 class QTreeWidget;
 class QTreeWidgetItem;
 class ParametersPlugin_ItemDelegate;
+class QPushButton;
+class QToolButton;
 
 /*!
  * \ingroup GUI
@@ -36,7 +38,7 @@ public:
 protected:
   /// Saves the internal parameters to the given feature
   /// \return True in success
-  virtual bool storeValueCustom() const;
+  virtual bool storeValueCustom();
 
   /// Restore value from attribute data to the widget's control
   virtual bool restoreValueCustom();
@@ -45,10 +47,56 @@ protected:
   virtual void activateCustom();
 
 private slots:
-  void onDoubleClick(const QModelIndex&);
+  /// Slot for reaction on double click in the table (start editing)
+  /// \param theIndex the clicked index
+  void onDoubleClick(const QModelIndex& theIndex);
+
+  /// Slot for reaction on end of cell editing
+  /// \param theEditor the editor widget
+  /// \param theHint end of edit type
   void onCloseEditor(QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint);
 
+  /// Slot for reaction on add parameter
+  void onAdd();
+
+  /// Slot for reaction on insert parameter
+  void onInsert();
+
+  /// Slot for reaction on remove parameter
+  void onRemove();
+
+  /// Slot for reaction on shift up
+  void onUp();
+
+  /// Slot for reaction on shift down
+  void onDown();
+
+  /// Slot to show message on closing of editor
+  void sendWarning();
+
+  /// Slot for reaction on selection in the table
+  void onSelectionChanged();
+
 private:
+  /// Creates a new parameter feature
+  FeaturePtr createParameter() const;
+
+  /// Creates a new item
+  QTreeWidgetItem* createNewItem() const;
+
+  /// Returns currently selected item
+  QTreeWidgetItem* selectedItem() const;
+
+  /// Select the given Item and scroll the table to make it visible
+  void selectItemScroll(QTreeWidgetItem* aItem);
+
+  /// Update values in features part
+  void updateFeaturesPart();
+
+  /// Returns true if parameter with the given name already exists
+  bool hasName(const QString& theName) const;
+
+  QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures) const;
 
   QTreeWidget* myTable;
   QTreeWidgetItem* myFeatures;
@@ -56,7 +104,15 @@ private:
   ParametersPlugin_ItemDelegate* myDelegate;
   QModelIndex myEditingIndex;
 
-  QList<FeaturePtr> myFeatureList;
+  QList<FeaturePtr> myParametersList;
+
+  QString myMessage;
+
+  QPushButton* myAddBtn;
+  QPushButton* myInsertBtn;
+  QPushButton* myRemoveBtn;
+  QToolButton* myUpBtn;
+  QToolButton* myDownBtn;
 };