1 // File : QAD_ObjectBrowser.h
2 // Created : Thu Jun 14 15:40:24 2001
3 // Author : Nicolas REJNERI
6 // Copyright : Open CASCADE
9 #ifndef QAD_OBJECTBROWSER_H
10 #define QAD_OBJECTBROWSER_H
13 #include "QAD_Popup.h"
15 #include "SALOME_InteractiveObject.hxx"
21 #include <qtabwidget.h>
22 #include <qtoolbutton.h>
26 #include <SALOMEconfig.h>
27 #include CORBA_SERVER_HEADER(SALOMEDS)
28 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
32 class QAD_ObjectBrowserItem;
33 typedef QList<QAD_ObjectBrowserItem> ItemList;
34 typedef QMap<QString, ItemList> ItemMap;
36 class QAD_EXPORT QAD_ObjectBrowser : public QTabWidget, public QAD_PopupClientServer
41 QAD_ObjectBrowser( SALOMEDS::Study_var study, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
42 virtual ~QAD_ObjectBrowser();
44 bool eventFilter( QObject* o, QEvent* e );
47 /* popup management */
50 QListView* getListView() const;
51 QListView* getUseCaseView() const;
54 void UpdateUseCaseBrowser();
56 void unHighlightAll();
57 void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight );
58 bool getItems( const Handle(SALOME_InteractiveObject)& IObject,
59 QList<QAD_ObjectBrowserItem>& List);
60 bool getItems( SALOMEDS::SObject_ptr SO,
61 QList<QAD_ObjectBrowserItem>& List);
62 QAD_ObjectBrowserItem* getItem( const Handle(SALOME_InteractiveObject)& IObject );
63 QAD_ObjectBrowserItem* getItem( SALOMEDS::SObject_ptr SO );
64 QAD_ObjectBrowserItem* getUCItem( const Handle(SALOME_InteractiveObject)& IObject );
65 QAD_ObjectBrowserItem* getUCItem( SALOMEDS::SObject_ptr SO );
66 void rename( const Handle(SALOME_InteractiveObject)& IObject, QString newName );
68 void setShowIAPP( bool show );
69 void setShowInfoColumns( bool show );
70 void setShowValueColumn( bool show );
71 void setEnableChronoSort( bool enable );
74 void Update( SALOMEDS::SObject_ptr SO,
75 QAD_ObjectBrowserItem* theParentItem );
76 void UpdateUCItem( SALOMEDS::SObject_var UCObject,
77 QAD_ObjectBrowserItem* UCItem );
78 QAD_ObjectBrowserItem* AddItem( QListView* theView,
79 const QString& theName,
80 const QString& theEntry,
81 const QString& theIOR,
83 const QString& theValue,
84 QAD_ObjectBrowserItem* theAfter = 0 );
85 QAD_ObjectBrowserItem* AddItem( QAD_ObjectBrowserItem* theParentItem,
86 const QString& theName,
87 const QString& theEntry,
88 const QString& theIOR,
90 const QString& theRef,
91 const QString& theValue,
92 QAD_ObjectBrowserItem* theAfter = 0 );
93 QString getValueFromObject( SALOMEDS::SObject_ptr SO );
94 bool hasEditableAttribute( const Handle(SALOME_InteractiveObject)& object );
95 bool hasTable( const Handle(SALOME_InteractiveObject)& object );
98 void onSelectedItem();
99 void onUseCaseSelectedItem();
100 void onEditAttribute();
102 void showPopupMenu(QListViewItem*);
103 void showUseCasePopupMenu(QListViewItem*);
105 void onExpanded (QListViewItem*);
106 void onCollapsed(QListViewItem*);
107 void onUseCasePopupMenu( int );
112 ItemMap myListViewMap;
113 ItemMap myUseCaseMap;
114 QListView* myListView;
115 QListView* myUseCaseView;
116 QPopupMenu* myPopupMenu;
117 SALOMEDS::Study_ptr myStudy;
118 QToolButton* myNewBtn;
119 QToolButton* myAddBtn;
120 QToolButton* myDelBtn;
121 QToolButton* myCurrentBtn;
122 QToolButton* myRenameBtn;
123 QToolButton* myClearBtn;