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_ORDEREDLISTWIDGET_H
20 #define HYDROGUI_ORDEREDLISTWIDGET_H
22 #include "HYDROGUI_ListModel.h"
30 * \class HYDROGUI_OrderedListWidget
31 * \brief The class representing widget for managing list of objects.
33 * The widget represents a list and a set of buttons (top, up, down and bottom)
34 * providing the possibility to change the list items order.
36 class HYDRO_EXPORT HYDROGUI_OrderedListWidget : public QWidget
41 HYDROGUI_OrderedListWidget( QWidget* theParent, int theArrowIconSize = 32 );
42 virtual ~HYDROGUI_OrderedListWidget();
44 void setObjects( const HYDROGUI_ListModel::Object2VisibleList& theObjects );
45 HYDROGUI_ListModel::ObjectList getObjects() const;
47 void addObject( const HYDROGUI_ListModel::Object2Visible& theObject );
48 void removeObjectByName( const QString& theObjectName );
50 void setHiddenObjectsShown( const bool theIsToShow );
51 void setVisibilityIconShown( const bool theIsToShow );
53 void setOrderingEnabled( const bool theIsToEnable );
55 QStringList getSelectedEntries() const;
56 void setSelectedEntries( const QStringList& theEntries ) const;
58 QStringList getSelectedNames() const;
59 QStringList getAllNames() const;
61 void setBackgroundColor (int theInd, QColor theColor);
62 QColor getBackgroundColor (int theInd) const;
63 void clearAllBackgroundColors ();
68 void selectionChanged();
72 void onMove( int theType );
75 HYDROGUI_ListModel* getSourceModel() const;
77 QModelIndexList getSelectedIndexes() const;
80 QListView* myList; ///< the list view
81 QPushButton* myTop; ///< the move on top button
82 QPushButton* myUp; ///< the move up button
83 QPushButton* myDown; ///< the move down button
84 QPushButton* myBottom; ///< the move on bottom button
86 bool myIsHiddenObjectsShown; ///< defines whether to include hidden objects in the list
87 bool myIsVisibilityIconShown; ///< defines whether to show visibility icon (eye icon)