1 // Copyright (C) 2007-2014 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, or (at your option) any later version.
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
23 #ifndef SUIT_SELECTIONMGR_H
24 #define SUIT_SELECTIONMGR_H
26 #include "SUIT_DataOwner.h"
32 class SUIT_SelectionFilter;
35 #pragma warning ( disable : 4251 )
38 class SUIT_EXPORT SUIT_SelectionMgr : public QObject
43 SUIT_SelectionMgr( const bool = true, QObject* = 0 );
44 virtual ~SUIT_SelectionMgr();
47 virtual void selected( SUIT_DataOwnerPtrList&, const QString& = QString() ) const;
48 virtual void setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
50 void selectors( QList<SUIT_Selector*>& ) const;
51 void selectors( const QString&, QList<SUIT_Selector*>& ) const;
54 void setEnabled( const bool, const QString& = QString() );
57 bool hasSelectionMode( const int ) const;
58 void selectionModes( QList<int>& ) const;
60 void setSelectionModes( const int );
61 virtual void setSelectionModes( const QList<int>& );
63 void appendSelectionModes( const int );
64 virtual void appendSelectionModes( const QList<int>& );
66 void removeSelectionModes( const int );
67 virtual void removeSelectionModes( const QList<int>& );
70 bool isOk( const SUIT_DataOwner* ) const;
71 bool isOk( const SUIT_DataOwnerPtr& ) const;
73 bool hasFilter( SUIT_SelectionFilter* ) const;
75 virtual void installFilter( SUIT_SelectionFilter*, const bool = true );
76 virtual void removeFilter( SUIT_SelectionFilter* );
77 virtual void clearFilters();
79 bool autoDeleteFilter() const;
80 void setAutoDeleteFilter( const bool );
82 bool isSynchronizing() const;
85 void selectionChanged();
88 virtual void selectionChanged( SUIT_Selector* );
90 virtual void installSelector( SUIT_Selector* );
91 virtual void removeSelector( SUIT_Selector* );
94 void filterOwners( const SUIT_DataOwnerPtrList&, SUIT_DataOwnerPtrList& ) const;
96 typedef QList<SUIT_Selector*> SelectorList;
97 typedef QList<SUIT_SelectionFilter*> SelFilterList;
100 SelFilterList myFilters;
101 QList<int> mySelModes;
102 SelectorList mySelectors;
104 bool myAutoDelFilter;
105 bool myIsSelChangeEnabled;
107 friend class SUIT_Selector;
111 #pragma warning ( default : 4251 )