1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #ifndef SUIT_SELECTIONMGR_H
20 #define SUIT_SELECTIONMGR_H
22 #include "SUIT_Selector.h"
23 #include "SUIT_DataOwner.h"
24 #include "SUIT_SelectionFilter.h"
28 #include <qvaluelist.h>
30 class SUIT_EXPORT SUIT_SelectionMgr : public QObject
35 SUIT_SelectionMgr( const bool = true );
36 virtual ~SUIT_SelectionMgr();
39 virtual void selected( SUIT_DataOwnerPtrList&, const QString& = QString::null ) const;
40 virtual void setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
42 void selectors( QPtrList<SUIT_Selector>& ) const;
43 void selectors( const QString&, QPtrList<SUIT_Selector>& ) const;
46 void setEnabled( const bool, const QString& = QString::null );
49 bool hasSelectionMode( const int ) const;
50 void selectionModes( QValueList<int>& ) const;
52 void setSelectionModes( const int );
53 virtual void setSelectionModes( const QValueList<int>& );
55 void appendSelectionModes( const int );
56 virtual void appendSelectionModes( const QValueList<int>& );
58 void removeSelectionModes( const int );
59 virtual void removeSelectionModes( const QValueList<int>& );
62 bool isOk( const SUIT_DataOwner* ) const;
63 bool isOk( const SUIT_DataOwnerPtr& ) const;
65 bool hasFilter( SUIT_SelectionFilter* ) const;
67 virtual void installFilter( SUIT_SelectionFilter*, const bool = true );
68 virtual void removeFilter( SUIT_SelectionFilter* );
69 virtual void clearFilters();
71 bool autoDeleteFilter() const;
72 void setAutoDeleteFilter( const bool );
75 void selectionChanged();
78 virtual void selectionChanged( SUIT_Selector* );
80 typedef QPtrListIterator<SUIT_Selector> SelectorListIterator;
82 virtual void installSelector( SUIT_Selector* );
83 virtual void removeSelector( SUIT_Selector* );
86 void filterOwners( const SUIT_DataOwnerPtrList&, SUIT_DataOwnerPtrList& ) const;
88 typedef QPtrList<SUIT_Selector> SelectorList;
89 typedef QPtrList<SUIT_SelectionFilter> SelFilterList;
90 typedef QPtrListIterator<SUIT_SelectionFilter> SelFilterListIterator;
93 SelectorList mySelectors;
96 SelFilterList myFilters;
97 QValueList<int> mySelModes;
99 bool myIsSelChangeEnabled;
101 friend class SUIT_Selector;