Salome HOME
refs #542: warning about changed objects order
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_OrderedListWidget.h
index 9664e98f651638f3772d7654a2976514663aa355..d0ac12626a2134e7c6d19c12fe5a69c01395aef8 100644 (file)
@@ -1,12 +1,8 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,7 +24,7 @@
 #include <QWidget>
 
 class QListView;
-class QToolButton;
+class QPushButton;
 
 /** 
  * \class HYDROGUI_OrderedListWidget
@@ -42,19 +38,31 @@ class HYDRO_EXPORT HYDROGUI_OrderedListWidget : public QWidget
   Q_OBJECT
 
 public:
-  HYDROGUI_OrderedListWidget( QWidget* theParent );
+  HYDROGUI_OrderedListWidget( QWidget* theParent, int theArrowIconSize = 32 );
   virtual ~HYDROGUI_OrderedListWidget();
 
   void setObjects( const HYDROGUI_ListModel::Object2VisibleList& theObjects );
   HYDROGUI_ListModel::ObjectList getObjects() const;
 
+  void addObject( const HYDROGUI_ListModel::Object2Visible& theObject );
+  void removeObjectByName( const QString& theObjectName );
+
   void setHiddenObjectsShown( const bool theIsToShow );
+  void setVisibilityIconShown( const bool theIsToShow );
+
+  void setOrderingEnabled( const bool theIsToEnable );
 
   QStringList getSelectedEntries() const;
   void setSelectedEntries( const QStringList& theEntries ) const;
 
+  QStringList getSelectedNames() const;
+  QStringList getAllNames() const;
+
+  void undoLastMove();
+
 signals:
   void selectionChanged();
+  void orderChanged();
 
 private slots:
   void onMove( int theType );
@@ -62,14 +70,17 @@ private slots:
 private:
   HYDROGUI_ListModel* getSourceModel() const;
 
+  QModelIndexList getSelectedIndexes() const;
+
 private:
   QListView*   myList;   ///< the list view
-  QToolButton* myTop;    ///< the move on top button
-  QToolButton* myUp;     ///< the move up button
-  QToolButton* myDown;   ///< the move down button
-  QToolButton* myBottom; ///< the move on bottom button
+  QPushButton* myTop;    ///< the move on top button
+  QPushButton* myUp;     ///< the move up button
+  QPushButton* myDown;   ///< the move down button
+  QPushButton* myBottom; ///< the move on bottom button
 
-  bool myIsHiddenObjectsShown; ///< the show hidden objects in the list indicator
+  bool myIsHiddenObjectsShown; ///< defines whether to include hidden objects in the list
+  bool myIsVisibilityIconShown; ///< defines whether to show visibility icon (eye icon)
 };
 
 #endif