pActionsNodeMenuBar.sip 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*!
  2. \file pActionsNodeMenuBar.h
  3. \brief The pActionsNodeMenuBar class is a QMenuBar where the hierarchy and actions are exposed by a pActionsNodeModel.
  4. \author Filipe Azevedo aka Nox P\@sNox <pasnox@gmail.com>
  5. */
  6. /*!
  7. \ingroup Gui
  8. \class pActionsNodeMenuBar
  9. \brief The pActionsNodeMenuBar class is a QMenuBar where the hierarchy and actions are exposed by a pActionsNodeModel.
  10. */
  11. class pActionsNodeMenuBar : QMenuBar
  12. {
  13. %TypeHeaderCode
  14. #include <gui/actionmanager/pActionsNodeMenuBar.h>
  15. %End
  16. public:
  17. /*!
  18. Create a pActionsNodeMenuBar having parent \a parent.
  19. */
  20. pActionsNodeMenuBar( QWidget* parent = 0 );
  21. /*!
  22. Destroys the menu bar.
  23. */
  24. ~pActionsNodeMenuBar();
  25. /*!
  26. Set the model associated with this menu bar.
  27. */
  28. void setModel( pActionsNodeModel* model );
  29. /*!
  30. Return the model associated with this menu bar.
  31. */
  32. pActionsNodeModel* model() const;
  33. /*!
  34. Add the action \a action at the given \a path.
  35. Return true on success else false.
  36. */
  37. bool addAction( const QString& path, QAction* action );
  38. /*!
  39. Add a new action at the given \a path having text \a text and icon \a icon.
  40. Return the new action on success else 0.
  41. */
  42. QAction* addAction( const QString& path, const QString& text, const QIcon& icon = QIcon() );
  43. /*!
  44. Add a new menu at the given path \a path and return the pActionsNode associated with this menu.
  45. */
  46. pActionsNode addMenu( const QString& path );
  47. /*!
  48. Remove the action at the given path \a path.
  49. */
  50. bool removeAction( const QString& path );
  51. /*!
  52. Remove the given action \a action.
  53. */
  54. bool removeAction( QAction* action );
  55. /*!
  56. Remove the menu at the given path \a path.
  57. Any child menus and actions are destroyed.
  58. */
  59. bool removeMenu( const QString& path );
  60. /*!
  61. Return the menu at the given path \a path.
  62. */
  63. QMenu* menu( const QString& path ) const;
  64. /*!
  65. Return the path of the menu \a menu.
  66. */
  67. QString menuPath( QMenu* menu ) const;
  68. /*!
  69. Return the action at the given path \a path.
  70. */
  71. QAction* action( const QString& path ) const;
  72. /*!
  73. Return the action path at the given path \a path.
  74. */
  75. QString actionPath( QAction* action ) const;
  76. };