Salome HOME
Fix for bug 10438: Crash during Explode on Blocks operation (Global selection on...
[modules/gui.git] / src / SUIT / SUIT_Desktop.h
1 #ifndef SUIT_DESKTOP_H
2 #define SUIT_DESKTOP_H
3
4 #include "SUIT.h"
5
6 #include <qmap.h>
7 #include <QtxMainWindow.h>
8
9 class QPopupMenu;
10 class SUIT_ViewWindow;
11 class QtxActionMenuMgr;
12 class QtxActionToolMgr;
13
14 class SUIT_EXPORT SUIT_Desktop : public QtxMainWindow
15 {
16   Q_OBJECT
17
18   class LogoManager
19   {
20   public:
21     LogoManager( SUIT_Desktop* );
22     void                   addLogo( const QString&, const QPixmap& );
23     void                   removeLogo( const QString& );
24     void                   clearLogo();
25
26   private:
27     void                   generateLogo();
28     
29   private:
30     SUIT_Desktop*          myDesktop;
31     QMap<QString, QPixmap> myLogoMap;
32     int                    myId;
33   };
34
35 public:
36   SUIT_Desktop();
37   virtual ~SUIT_Desktop();
38
39   QtxActionMenuMgr*        menuMgr() const;
40   QtxActionToolMgr*        toolMgr() const;
41
42   virtual SUIT_ViewWindow* activeWindow() const = 0;
43   virtual QPtrList<SUIT_ViewWindow> windows() const = 0;
44
45   void                     addLogo( const QString&, const QPixmap& );
46   void                     removeLogo( const QString& );
47   void                     clearLogo();
48
49 signals:
50   void                     activated();
51   void                     deactivated();
52   void                     windowActivated( SUIT_ViewWindow* );
53   void                     closing( SUIT_Desktop*, QCloseEvent* );
54
55 protected:
56   virtual bool             event( QEvent* );
57   virtual void             closeEvent( QCloseEvent* );
58   virtual void             childEvent( QChildEvent* );
59
60   virtual QWidget*         parentArea() const = 0;
61
62 private:
63   QtxActionMenuMgr*        myMenuMgr;
64   QtxActionToolMgr*        myToolMgr;
65   LogoManager              myLogoMan;
66 };
67
68 #endif