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/ or email : webmaster.salome@opencascade.com
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>
31 #pragma warning ( disable : 4251 )
34 class SUIT_EXPORT SUIT_SelectionMgr : public QObject
39 SUIT_SelectionMgr( const bool = true, QObject* = 0 );
40 virtual ~SUIT_SelectionMgr();
43 virtual void selected( SUIT_DataOwnerPtrList&, const QString& = QString::null ) const;
44 virtual void setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
46 void selectors( QPtrList<SUIT_Selector>& ) const;
47 void selectors( const QString&, QPtrList<SUIT_Selector>& ) const;
50 void setEnabled( const bool, const QString& = QString::null );
53 bool hasSelectionMode( const int ) const;
54 void selectionModes( QValueList<int>& ) const;
56 void setSelectionModes( const int );
57 virtual void setSelectionModes( const QValueList<int>& );
59 void appendSelectionModes( const int );
60 virtual void appendSelectionModes( const QValueList<int>& );
62 void removeSelectionModes( const int );
63 virtual void removeSelectionModes( const QValueList<int>& );
66 bool isOk( const SUIT_DataOwner* ) const;
67 bool isOk( const SUIT_DataOwnerPtr& ) const;
69 bool hasFilter( SUIT_SelectionFilter* ) const;
71 virtual void installFilter( SUIT_SelectionFilter*, const bool = true );
72 virtual void removeFilter( SUIT_SelectionFilter* );
73 virtual void clearFilters();
75 bool autoDeleteFilter() const;
76 void setAutoDeleteFilter( const bool );
78 bool isSynchronizing() const;
81 void selectionChanged();
84 virtual void selectionChanged( SUIT_Selector* );
86 typedef QPtrListIterator<SUIT_Selector> SelectorListIterator;
88 virtual void installSelector( SUIT_Selector* );
89 virtual void removeSelector( SUIT_Selector* );
92 void filterOwners( const SUIT_DataOwnerPtrList&, SUIT_DataOwnerPtrList& ) const;
94 typedef QPtrList<SUIT_Selector> SelectorList;
95 typedef QPtrList<SUIT_SelectionFilter> SelFilterList;
96 typedef QPtrListIterator<SUIT_SelectionFilter> SelFilterListIterator;
99 SelectorList mySelectors;
102 SelFilterList myFilters;
103 QValueList<int> mySelModes;
105 bool myIsSelChangeEnabled;
107 friend class SUIT_Selector;
111 #pragma warning ( default : 4251 )