58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
#ifndef RICHTEXTEDITORTOOLBAR_H
|
|
#define RICHTEXTEDITORTOOLBAR_H
|
|
|
|
#include "richtexteditor.h"
|
|
#include "coloraction.h"
|
|
|
|
#include <QToolBar>
|
|
#include <QComboBox>
|
|
#include <QFontComboBox>
|
|
#include <QPointer>
|
|
#include <QAction>
|
|
|
|
QIcon createIconSet(const QString &name);
|
|
|
|
class RichTextEditorToolBar : public QToolBar
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
RichTextEditorToolBar(RichTextEditor *editor,
|
|
QWidget *parent = nullptr);
|
|
|
|
public Q_SLOTS:
|
|
void updateActions();
|
|
|
|
private Q_SLOTS:
|
|
void alignmentActionTriggered(QAction *action);
|
|
void sizeInputActivated(const QString &size);
|
|
void fontFamilyActivated(const QString &font);
|
|
void colorChanged(const QColor &color);
|
|
void setVAlignSuper(bool super);
|
|
void setVAlignSub(bool sub);
|
|
void insertLink();
|
|
void insertImage();
|
|
void layoutDirectionChanged();
|
|
|
|
private:
|
|
QAction *m_bold_action;
|
|
QAction *m_italic_action;
|
|
QAction *m_underline_action;
|
|
QAction *m_valign_sup_action;
|
|
QAction *m_valign_sub_action;
|
|
QAction *m_align_left_action;
|
|
QAction *m_align_center_action;
|
|
QAction *m_align_right_action;
|
|
QAction *m_align_justify_action;
|
|
QAction *m_layoutDirectionAction;
|
|
QAction *m_link_action;
|
|
QAction *m_image_action;
|
|
QAction *m_simplify_richtext_action;
|
|
ColorAction *m_color_action;
|
|
QComboBox *m_font_size_input;
|
|
QFontComboBox *m_font_family_input;
|
|
|
|
QPointer<RichTextEditor> m_editor;
|
|
};
|
|
|
|
#endif // RICHTEXTEDITORTOOLBAR_H
|