1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef SUIT_SELECTIONMGR_H
23 #define SUIT_SELECTIONMGR_H
25 #include "SUIT_DataOwner.h"
31 class SUIT_SelectionFilter;
34 #pragma warning ( disable : 4251 )
37 class SUIT_EXPORT SUIT_SelectionMgr : public QObject
42 SUIT_SelectionMgr( const bool = true, QObject* = 0 );
43 virtual ~SUIT_SelectionMgr();
46 virtual void selected( SUIT_DataOwnerPtrList&, const QString& = QString() ) const;
47 virtual void setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
49 void selectors( QList<SUIT_Selector*>& ) const;
50 void selectors( const QString&, QList<SUIT_Selector*>& ) const;
53 void setEnabled( const bool, const QString& = QString() );
56 bool hasSelectionMode( const int ) const;
57 void selectionModes( QList<int>& ) const;
59 void setSelectionModes( const int );
60 virtual void setSelectionModes( const QList<int>& );
62 void appendSelectionModes( const int );
63 virtual void appendSelectionModes( const QList<int>& );
65 void removeSelectionModes( const int );
66 virtual void removeSelectionModes( const QList<int>& );
69 bool isOk( const SUIT_DataOwner* ) const;
70 bool isOk( const SUIT_DataOwnerPtr& ) const;
72 bool hasFilter( SUIT_SelectionFilter* ) const;
74 virtual void installFilter( SUIT_SelectionFilter*, const bool = true );
75 virtual void removeFilter( SUIT_SelectionFilter* );
76 virtual void clearFilters();
78 bool autoDeleteFilter() const;
79 void setAutoDeleteFilter( const bool );
81 bool isSynchronizing() const;
84 void selectionChanged();
87 virtual void selectionChanged( SUIT_Selector* );
89 virtual void installSelector( SUIT_Selector* );
90 virtual void removeSelector( SUIT_Selector* );
93 void filterOwners( const SUIT_DataOwnerPtrList&, SUIT_DataOwnerPtrList& ) const;
95 typedef QList<SUIT_Selector*> SelectorList;
96 typedef QList<SUIT_SelectionFilter*> SelFilterList;
99 SelFilterList myFilters;
100 QList<int> mySelModes;
101 SelectorList mySelectors;
103 bool myAutoDelFilter;
104 bool myIsSelChangeEnabled;
106 friend class SUIT_Selector;
110 #pragma warning ( default : 4251 )