pDockToolBarManager.sip 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*!
  2. \file pDockToolBarManager.h
  3. \date 2008-01-14T00:27:41
  4. \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com>
  5. \brief This class manage a set of pDockToolBar ( left, top, right and bottom ) of a QMainWindow
  6. */
  7. /*!
  8. \brief This class manage a set of pDockToolBar ( left, top, right and bottom ) of a QMainWindow
  9. \details It provide usefull member ( bar() ) to directly create a unique pDockToolBar for the corresponding area.
  10. \details It allow to save/restore state of pDockToolBar using a pSettings class.
  11. */
  12. class pDockToolBarManager : QObject
  13. {
  14. %TypeHeaderCode
  15. #include <gui/dockmanager/pDockToolBarManager.h>
  16. %End
  17. public:
  18. enum Mode {
  19. Invalid = -1,
  20. Classic,
  21. Modern
  22. };
  23. pDockToolBarManager( pMainWindow* window );
  24. virtual bool eventFilter( QObject* object, QEvent* event );
  25. bool isRestoring() const;
  26. void setRestoring( bool restoring );
  27. pDockToolBarManager::Mode mode() const;
  28. void setMode( pDockToolBarManager::Mode mode );
  29. pMainWindow* mainWindow() const;
  30. Qt::ToolBarArea toolBarArea( pDockToolBar* toolBar ) const;
  31. QList<pDockToolBar*> dockToolBars() const;
  32. pDockToolBar* dockToolBar( Qt::ToolBarArea area ) const;
  33. pDockToolBar* dockToolBar( Qt::DockWidgetArea area ) const;
  34. pDockToolBar* dockToolBar( QDockWidget* dockWidget ) const;
  35. QToolBar* modernToolBar() const;
  36. static Qt::ToolBarArea dockWidgetAreaToToolBarArea( Qt::DockWidgetArea area );
  37. static Qt::DockWidgetArea toolBarAreaToDockWidgetArea( Qt::ToolBarArea area );
  38. static QBoxLayout::Direction toolBarAreaToBoxLayoutDirection( Qt::ToolBarArea area );
  39. public slots:
  40. virtual void restoreState( pDockToolBar* dockToolBar = 0 );
  41. virtual void saveState( pDockToolBar* dockToolBar = 0 );
  42. protected slots:
  43. void dockWidget_allowedAreasChanged( Qt::DockWidgetAreas allowedAreas );
  44. void dockWidget_dockLocationChanged( Qt::DockWidgetArea area );
  45. void dockWidget_featuresChanged( QDockWidget::DockWidgetFeatures features );
  46. void dockWidget_topLevelChanged( bool topLevel );
  47. void dockWidget_visibilityChanged( bool visible );
  48. signals:
  49. void modeChanged( pDockToolBarManager::Mode mode );
  50. };