viewwindowtoolbarhelper.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef VIEWWINDOWTOOLBARHELPER_H
  2. #define VIEWWINDOWTOOLBARHELPER_H
  3. class QToolBar;
  4. class QAction;
  5. class QWidget;
  6. class QString;
  7. class QToolButton;
  8. namespace vnotex
  9. {
  10. // Help to setup common buttons of ViewWindow tool bar.
  11. class ViewWindowToolBarHelper
  12. {
  13. public:
  14. enum Action
  15. {
  16. Save,
  17. EditReadDiscard,
  18. ViewMode,
  19. // Make sure they are put together.
  20. // Including Heading1-6 and HeadingNone.
  21. TypeHeading,
  22. TypeBold,
  23. TypeItalic,
  24. TypeStrikethrough,
  25. TypeUnorderedList,
  26. TypeOrderedList,
  27. TypeTodoList,
  28. TypeCheckedTodoList,
  29. TypeCode,
  30. TypeCodeBlock,
  31. TypeMath,
  32. TypeMathBlock,
  33. TypeQuote,
  34. TypeLink,
  35. TypeImage,
  36. TypeTable,
  37. TypeMark,
  38. // Ending TypeXXX.
  39. TypeMax,
  40. Attachment,
  41. Tag,
  42. Outline,
  43. FindAndReplace,
  44. SectionNumber,
  45. InplacePreview,
  46. ImageHost,
  47. Debug,
  48. Print
  49. };
  50. static QAction *addAction(QToolBar *p_tb, Action p_action);
  51. static void addActionShortcut(QAction *p_action,
  52. const QString &p_shortcut,
  53. QWidget *p_widget,
  54. QAction *p_parentAction = nullptr);
  55. static void addButtonShortcut(QToolButton *p_btn,
  56. const QString &p_shortcut,
  57. QWidget *p_widget);
  58. ViewWindowToolBarHelper() = delete;
  59. };
  60. }
  61. #endif // VIEWWINDOWTOOLBARHELPER_H