pMainWindow.sip 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*!
  2. \file pMainWindow.h
  3. \date 2008-01-14T00:27:46
  4. \author Filipe AZEVEDO aka Nox P\@sNox <pasnox@gmail.com>
  5. \brief An extended QMainWindow
  6. */
  7. /*!
  8. \brief An extended QMainWindow.
  9. \details This extended mainwindow contains some usefull features :
  10. \details a pMenuBar as menu bar, a pDockToolBarManager for tabbed management of docked widgets
  11. \details and a pSettings object for storing/reading your settings.
  12. \details There is also a confortable dockToolBar() member.
  13. */
  14. class pMainWindow : QMainWindow
  15. {
  16. %TypeHeaderCode
  17. #include <gui/pMainWindow.h>
  18. %End
  19. public:
  20. /*!
  21. Create an instance of the main window having \a parent as parent and window flags \a windowFlags.
  22. */
  23. pMainWindow( QWidget* parent = 0, Qt::WindowFlags windowFlags = 0 );
  24. /*!
  25. Reimplemented.
  26. */
  27. virtual ~pMainWindow();
  28. /*!
  29. Reimplemented.
  30. */
  31. virtual QMenu* createPopupMenu();
  32. /*!
  33. Return the settings object used by this main window.
  34. */
  35. virtual pSettings* settings() const;
  36. /*!
  37. Return the menu bar object.
  38. */
  39. virtual pActionsNodeMenuBar* menuBar() const;
  40. /*!
  41. Add \a dockWidget in \a area having \a orientation.
  42. */
  43. void addDockManagerWidget( Qt::ToolBarArea area, QDockWidget* dockWidget, Qt::Orientation orientation = Qt::Horizontal );
  44. /*!
  45. Seth the dock toolbar in \a area to be exclusive according to \a exclusive.
  46. */
  47. void setDockManagerAreaExclusive( Qt::ToolBarArea area, bool exclusive );
  48. /*!
  49. Set the dock manager presentation mode to \a mode.
  50. */
  51. void setDockManagerMode( pDockToolBarManager::Mode mode );
  52. /*!
  53. Append a queued \a message in the message toolbar with an auto close defined to \a milliSeconds.
  54. \sa pQueuedMessageToolBar::appendMessage( const QString&, int ).
  55. */
  56. void appendMessage( const QString& message, int milliSeconds = -1 );
  57. /*!
  58. Append a queued \a message in the message toolbar.
  59. \sa pQueuedMessageToolBar::appendMessage( const pQueuedMessage& ).
  60. */
  61. void appendMessage( const pQueuedMessage& message );
  62. protected:
  63. /*!
  64. Reimplemented.
  65. */
  66. virtual void showEvent( QShowEvent* event );
  67. /*!
  68. Reimplemented.
  69. */
  70. virtual void closeEvent( QCloseEvent* event );
  71. /*!
  72. Return the queued message toolbar object.
  73. */
  74. virtual pQueuedMessageToolBar* queuedMessageToolBar() const;
  75. /*!
  76. Return the dock widget toolbar manager object.
  77. */
  78. virtual pDockToolBarManager* dockToolBarManager() const;
  79. /*!
  80. Return the dock toolbar manager for \a area.
  81. */
  82. pDockToolBar* dockToolBar( Qt::ToolBarArea area ) const;
  83. public slots:
  84. /*!
  85. Save the state of the main window.
  86. \sa QMainWindow::saveState().
  87. */
  88. virtual void saveState();
  89. /*!
  90. Restore the state of the main window.
  91. \sa QMainWindow::restoreState().
  92. */
  93. virtual void restoreState();
  94. };