mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
71 lines
1.7 KiB
C++
71 lines
1.7 KiB
C++
#ifndef VIEWWINDOWTOOLBARHELPER_H
|
|
#define VIEWWINDOWTOOLBARHELPER_H
|
|
|
|
class QToolBar;
|
|
class QAction;
|
|
class QWidget;
|
|
class QString;
|
|
class QToolButton;
|
|
|
|
namespace vnotex
|
|
{
|
|
// Help to setup common buttons of ViewWindow tool bar.
|
|
class ViewWindowToolBarHelper
|
|
{
|
|
public:
|
|
enum Action
|
|
{
|
|
Save,
|
|
EditReadDiscard,
|
|
ViewMode,
|
|
|
|
// Make sure they are put together.
|
|
// Including Heading1-6 and HeadingNone.
|
|
TypeHeading,
|
|
TypeBold,
|
|
TypeItalic,
|
|
TypeStrikethrough,
|
|
TypeUnorderedList,
|
|
TypeOrderedList,
|
|
TypeTodoList,
|
|
TypeCheckedTodoList,
|
|
TypeCode,
|
|
TypeCodeBlock,
|
|
TypeMath,
|
|
TypeMathBlock,
|
|
TypeQuote,
|
|
TypeLink,
|
|
TypeImage,
|
|
TypeTable,
|
|
TypeMark,
|
|
// Ending TypeXXX.
|
|
TypeMax,
|
|
|
|
Attachment,
|
|
Tag,
|
|
Outline,
|
|
FindAndReplace,
|
|
SectionNumber,
|
|
InplacePreview,
|
|
ImageHost,
|
|
Debug,
|
|
Print
|
|
};
|
|
|
|
static QAction *addAction(QToolBar *p_tb, Action p_action);
|
|
|
|
static void addActionShortcut(QAction *p_action,
|
|
const QString &p_shortcut,
|
|
QWidget *p_widget,
|
|
QAction *p_parentAction = nullptr);
|
|
|
|
static void addButtonShortcut(QToolButton *p_btn,
|
|
const QString &p_shortcut,
|
|
QWidget *p_widget);
|
|
|
|
ViewWindowToolBarHelper() = delete;
|
|
};
|
|
}
|
|
|
|
#endif // VIEWWINDOWTOOLBARHELPER_H
|