Salome HOME
add necessary include <qpixmap.h>
[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 <qpixmap.h>
8 #include <QtxMainWindow.h>
9
10 class QPopupMenu;
11 class SUIT_ViewWindow;
12 class QtxActionMenuMgr;
13 class QtxActionToolMgr;
14
15 class SUIT_EXPORT SUIT_Desktop : public QtxMainWindow
16 {
17   Q_OBJECT
18
19   class LogoManager
20   {
21   public:
22     LogoManager( SUIT_Desktop* );
23     void                   addLogo( const QString&, const QPixmap& );
24     void                   removeLogo( const QString& );
25     void                   clearLogo();
26
27   private:
28     void                   generateLogo();
29     
30   private:
31     SUIT_Desktop*          myDesktop;
32     QMap<QString, QPixmap> myLogoMap;
33     int                    myId;
34   };
35
36 public:
37   SUIT_Desktop();
38   virtual ~SUIT_Desktop();
39
40   QtxActionMenuMgr*        menuMgr() const;
41   QtxActionToolMgr*        toolMgr() const;
42
43   virtual SUIT_ViewWindow* activeWindow() const = 0;
44   virtual QPtrList<SUIT_ViewWindow> windows() const = 0;
45
46   void                     addLogo( const QString&, const QPixmap& );
47   void                     removeLogo( const QString& );
48   void                     clearLogo();
49
50 signals:
51   void                     activated();
52   void                     deactivated();
53   void                     windowActivated( SUIT_ViewWindow* );
54   void                     closing( SUIT_Desktop*, QCloseEvent* );
55
56 protected:
57   virtual bool             event( QEvent* );
58   virtual void             closeEvent( QCloseEvent* );
59   virtual void             childEvent( QChildEvent* );
60
61   virtual QWidget*         parentArea() const = 0;
62
63 private:
64   QtxActionMenuMgr*        myMenuMgr;
65   QtxActionToolMgr*        myToolMgr;
66   LogoManager              myLogoMan;
67 };
68
69 #endif