2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
2014-02-11 14:27:44 +01:00
|
|
|
// Copyright (C) 2014 Werner Schweer
|
2012-05-26 14:26:10 +02:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENCE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
#ifndef __SIMPLETEXT_H__
|
|
|
|
#define __SIMPLETEXT_H__
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
#include "element.h"
|
2016-03-02 13:20:19 +01:00
|
|
|
#include "textstyle.h"
|
2012-05-26 14:26:10 +02:00
|
|
|
#include "elementlayout.h"
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
class MuseScoreView;
|
|
|
|
struct SymCode;
|
2015-02-02 17:21:22 +01:00
|
|
|
class Text;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-05-21 18:52:58 +02:00
|
|
|
enum class CharFormatType : char { TEXT, SYMBOL };
|
|
|
|
enum class VerticalAlignment : char { AlignNormal, AlignSuperScript, AlignSubScript };
|
|
|
|
enum class FormatId : char { Bold, Italic, Underline, Valign, FontSize, FontFamily };
|
2014-02-11 14:27:44 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// CharFormat
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class CharFormat {
|
|
|
|
CharFormatType _type { CharFormatType::TEXT };
|
|
|
|
bool _bold { false };
|
|
|
|
bool _italic { false };
|
|
|
|
bool _underline { false };
|
2015-02-17 17:08:39 +01:00
|
|
|
bool _preedit { false };
|
2014-02-11 14:27:44 +01:00
|
|
|
VerticalAlignment _valign { VerticalAlignment::AlignNormal };
|
|
|
|
qreal _fontSize { 12.0 };
|
|
|
|
QString _fontFamily;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CharFormat() {}
|
|
|
|
bool operator==(const CharFormat&) const;
|
|
|
|
CharFormatType type() const { return _type; }
|
|
|
|
bool bold() const { return _bold; }
|
|
|
|
bool italic() const { return _italic; }
|
|
|
|
bool underline() const { return _underline; }
|
2015-02-17 17:08:39 +01:00
|
|
|
bool preedit() const { return _preedit; }
|
|
|
|
VerticalAlignment valign() const { return _valign; }
|
2014-02-11 14:27:44 +01:00
|
|
|
qreal fontSize() const { return _fontSize; }
|
|
|
|
QString fontFamily() const { return _fontFamily; }
|
|
|
|
|
|
|
|
void setType(CharFormatType val) { _type = val; }
|
|
|
|
void setBold(bool val) { _bold = val; }
|
|
|
|
void setItalic(bool val) { _italic = val; }
|
|
|
|
void setUnderline(bool val) { _underline = val; }
|
2015-02-17 17:08:39 +01:00
|
|
|
void setPreedit(bool val) { _preedit = val; }
|
2014-02-11 14:27:44 +01:00
|
|
|
void setValign(VerticalAlignment val) { _valign = val; }
|
|
|
|
void setFontSize(qreal val) { _fontSize = val; }
|
|
|
|
void setFontFamily(const QString& val) { _fontFamily = val; }
|
2014-03-14 15:43:13 +01:00
|
|
|
|
|
|
|
void setFormat(FormatId, QVariant);
|
2014-02-11 14:27:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// TextCursor
|
|
|
|
// Contains current position and start of selection
|
|
|
|
// during editing.
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class TextCursor {
|
2015-02-02 17:21:22 +01:00
|
|
|
Text* _text;
|
2014-02-11 14:27:44 +01:00
|
|
|
CharFormat _format;
|
|
|
|
int _line { 0 };
|
|
|
|
int _column { 0 };
|
|
|
|
int _selectLine { 0 }; // start of selection
|
|
|
|
int _selectColumn { 0 };
|
|
|
|
|
|
|
|
public:
|
|
|
|
TextCursor() {}
|
|
|
|
|
|
|
|
bool hasSelection() const { return (_selectLine != _line) || (_selectColumn != _column); }
|
|
|
|
void clearSelection();
|
|
|
|
|
|
|
|
CharFormat* format() { return &_format; }
|
|
|
|
void setFormat(const CharFormat& f) { _format = f; }
|
|
|
|
|
|
|
|
int line() const { return _line; }
|
|
|
|
int column() const { return _column; }
|
|
|
|
int selectLine() const { return _selectLine; }
|
|
|
|
int selectColumn() const { return _selectColumn; }
|
|
|
|
void setLine(int val) { _line = val; }
|
|
|
|
void setColumn(int val) { _column = val; }
|
|
|
|
void setSelectLine(int val) { _selectLine = val; }
|
|
|
|
void setSelectColumn(int val) { _selectColumn = val; }
|
2015-02-02 17:21:22 +01:00
|
|
|
void setText(Text* t) { _text = t; }
|
|
|
|
int columns() const;
|
2014-07-26 11:55:29 +02:00
|
|
|
void initFromStyle(const TextStyle& s);
|
2014-02-11 14:27:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
class Text;
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// TextFragment
|
|
|
|
// contains a styled text of symbol with name "text"
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class TextFragment {
|
2014-02-18 16:38:55 +01:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
public:
|
|
|
|
mutable CharFormat format;
|
2014-02-13 14:26:23 +01:00
|
|
|
QPointF pos; // y is relativ to TextBlock->y()
|
2014-02-11 14:27:44 +01:00
|
|
|
|
|
|
|
mutable QString text;
|
|
|
|
QList<SymId> ids;
|
|
|
|
|
|
|
|
bool operator ==(const TextFragment& f) const;
|
|
|
|
|
|
|
|
TextFragment();
|
|
|
|
TextFragment(const QString& s);
|
|
|
|
TextFragment(TextCursor*, SymId);
|
|
|
|
TextFragment(TextCursor*, const QString&);
|
|
|
|
TextFragment split(int column);
|
|
|
|
void draw(QPainter*, const Text*) const;
|
|
|
|
QFont font(const Text*) const;
|
2014-03-14 15:43:13 +01:00
|
|
|
int columns() const;
|
|
|
|
void changeFormat(FormatId id, QVariant data);
|
2014-02-11 14:27:44 +01:00
|
|
|
};
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
2014-02-11 14:27:44 +01:00
|
|
|
// TextBlock
|
|
|
|
// represents a block of formatted text
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
class TextBlock {
|
|
|
|
QList<TextFragment> _text;
|
2014-02-13 14:26:23 +01:00
|
|
|
qreal _y = 0;
|
2014-02-18 16:38:55 +01:00
|
|
|
qreal _lineSpacing;
|
2014-02-11 14:27:44 +01:00
|
|
|
QRectF _bbox;
|
2014-02-18 16:38:55 +01:00
|
|
|
bool _eol = false;
|
2014-02-11 14:27:44 +01:00
|
|
|
|
|
|
|
void simplify();
|
|
|
|
|
|
|
|
public:
|
|
|
|
TextBlock() {}
|
|
|
|
bool operator ==(const TextBlock& x) { return _text == x._text; }
|
2015-02-18 11:29:30 +01:00
|
|
|
bool operator !=(const TextBlock& x) { return _text != x._text; }
|
2014-02-11 14:27:44 +01:00
|
|
|
void draw(QPainter*, const Text*) const;
|
2014-02-13 14:26:23 +01:00
|
|
|
void layout(Text*);
|
2014-02-11 14:27:44 +01:00
|
|
|
const QList<TextFragment>& fragments() const { return _text; }
|
|
|
|
QList<TextFragment>& fragments() { return _text; }
|
2014-02-13 14:26:23 +01:00
|
|
|
const QRectF& boundingRect() const { return _bbox; }
|
2014-02-11 14:27:44 +01:00
|
|
|
QRectF boundingRect(int col1, int col2, const Text*) const;
|
|
|
|
int columns() const;
|
|
|
|
void insert(TextCursor*, const QString&);
|
|
|
|
void insert(TextCursor*, SymId);
|
|
|
|
void remove(int column);
|
2015-01-13 17:21:04 +01:00
|
|
|
QString remove(int start, int n);
|
2014-02-11 14:27:44 +01:00
|
|
|
int column(qreal x, Text*) const;
|
|
|
|
TextBlock split(int column);
|
|
|
|
qreal xpos(int col, const Text*) const;
|
2014-02-13 11:28:11 +01:00
|
|
|
const CharFormat* formatAt(int) const;
|
|
|
|
const TextFragment* fragment(int col) const;
|
2014-02-13 09:58:28 +01:00
|
|
|
QList<TextFragment>::iterator fragment(int col, int* rcol);
|
2014-02-13 14:26:23 +01:00
|
|
|
qreal y() const { return _y; }
|
|
|
|
void setY(qreal val) { _y = val; }
|
2014-02-18 16:38:55 +01:00
|
|
|
qreal lineSpacing() const { return _lineSpacing; }
|
2014-02-17 16:28:09 +01:00
|
|
|
QString text(int, int) const;
|
2014-02-18 16:38:55 +01:00
|
|
|
bool eol() const { return _eol; }
|
|
|
|
void setEol(bool val) { _eol = val; }
|
2014-03-14 15:43:13 +01:00
|
|
|
void changeFormat(FormatId, QVariant val, int start, int n);
|
2014-02-11 14:27:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2016-02-26 18:44:58 +01:00
|
|
|
// @@ MText
|
2014-05-16 13:44:32 +02:00
|
|
|
/// Graphic representation of a text.
|
2014-04-10 06:10:48 +02:00
|
|
|
//
|
2016-02-26 18:44:58 +01:00
|
|
|
// @P text string the raw text
|
2016-10-08 19:06:54 +02:00
|
|
|
// @P textStyleType enum (TextStyleType.DEFAULT, .TITLE, .SUBTITLE, .COMPOSER, .POET, .LYRIC1, .LYRIC2, .FINGERING, .LH_GUITAR_FINGERING, .RH_GUITAR_FINGERING, .STRING_NUMBER, .INSTRUMENT_LONG, .INSTRUMENT_SHORT, .INSTRUMENT_EXCERPT, .DYNAMICS, .EXPRESSION, .TEMPO, .METRONOME, .MEASURE_NUMBER, .TRANSLATOR, .TUPLET, .SYSTEM, .STAFF, .HARMONY, .REHEARSAL_MARK, .REPEAT_LEFT, .REPEAT_RIGHT, .VOLTA, .FRAME, .TEXTLINE, .GLISSANDO, .OTTAVA, .PEDAL, .HAIRPIN, .BEND, .HEADER, .FOOTER, .INSTRUMENT_CHANGE, .FIGURED_BASS)
|
2014-02-11 14:27:44 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class Text : public Element {
|
2012-05-28 11:29:21 +02:00
|
|
|
Q_OBJECT
|
2014-06-06 12:40:22 +02:00
|
|
|
|
2015-04-27 12:59:30 +02:00
|
|
|
Q_PROPERTY(QString text READ xmlText WRITE undoSetText)
|
2016-02-26 18:44:58 +01:00
|
|
|
Q_PROPERTY(Ms::MSQE_TextStyleType::E textStyleType READ qmlTextStyleType WRITE qmlUndoSetTextStyleType)
|
|
|
|
|
|
|
|
Q_ENUMS(Ms::MSQE_TextStyleType::E)
|
2012-05-28 11:29:21 +02:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
QString _text;
|
2016-02-17 13:36:31 +01:00
|
|
|
QString oldText; // used to remember original text in edit mode
|
|
|
|
QString preEdit;
|
2014-02-11 14:27:44 +01:00
|
|
|
QList<TextBlock> _layout;
|
2014-07-03 11:22:42 +02:00
|
|
|
TextStyleType _styleIndex;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2015-01-13 17:21:04 +01:00
|
|
|
bool _layoutToParentWidth { false };
|
|
|
|
bool _editMode { false };
|
|
|
|
int hexState { -1 };
|
2014-03-10 10:50:12 +01:00
|
|
|
TextStyle _textStyle;
|
2014-02-11 14:27:44 +01:00
|
|
|
|
2016-02-17 13:36:31 +01:00
|
|
|
TextCursor* _cursor; // used during editing
|
2014-02-11 14:27:44 +01:00
|
|
|
|
|
|
|
QRectF cursorRect() const;
|
|
|
|
const TextBlock& curLine() const;
|
|
|
|
TextBlock& curLine();
|
|
|
|
void drawSelection(QPainter*, const QRectF&) const;
|
2014-03-06 14:53:07 +01:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
void insert(TextCursor*, QChar);
|
|
|
|
void insert(TextCursor*, SymId);
|
|
|
|
void updateCursorFormat(TextCursor*);
|
2014-02-17 16:28:09 +01:00
|
|
|
void genText();
|
2014-03-14 15:43:13 +01:00
|
|
|
void changeSelectionFormat(FormatId id, QVariant val);
|
2014-10-04 13:11:56 +02:00
|
|
|
void setEditMode(bool val) { _editMode = val; }
|
2015-01-13 17:21:04 +01:00
|
|
|
void editInsertText(const QString&);
|
2015-02-02 17:21:22 +01:00
|
|
|
QChar currentCharacter() const;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
protected:
|
2014-02-11 14:27:44 +01:00
|
|
|
QColor textColor() const;
|
2015-03-18 11:40:40 +01:00
|
|
|
QColor frameColor() const;
|
2014-04-24 08:00:28 +02:00
|
|
|
QRectF frame; // calculated in layout()
|
2014-02-11 14:27:44 +01:00
|
|
|
void layoutFrame();
|
|
|
|
void layoutEdit();
|
2014-02-22 18:24:55 +01:00
|
|
|
void createLayout();
|
2015-02-02 17:21:22 +01:00
|
|
|
const TextBlock& textBlock(int line) { return _layout[line]; }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
public:
|
2012-05-30 20:54:26 +02:00
|
|
|
Text(Score* = 0);
|
2012-05-26 14:26:10 +02:00
|
|
|
Text(const Text&);
|
2016-02-17 13:36:31 +01:00
|
|
|
~Text();
|
2013-02-14 16:27:36 +01:00
|
|
|
|
2014-02-19 12:18:44 +01:00
|
|
|
virtual Text* clone() const override { return new Text(*this); }
|
2014-06-24 18:36:02 +02:00
|
|
|
virtual Element::Type type() const override { return Element::Type::TEXT; }
|
2014-02-19 12:18:44 +01:00
|
|
|
virtual bool mousePress(const QPointF&, QMouseEvent* ev) override;
|
2014-02-11 14:27:44 +01:00
|
|
|
|
2014-06-27 13:41:49 +02:00
|
|
|
Text &operator=(const Text&) = delete;
|
2014-02-11 14:27:44 +01:00
|
|
|
|
2014-02-19 12:18:44 +01:00
|
|
|
virtual void draw(QPainter*) const override;
|
2015-03-20 09:58:41 +01:00
|
|
|
virtual void setColor(const QColor& c) override;
|
|
|
|
virtual QColor color() const { return textStyle().foregroundColor(); }
|
2014-02-11 14:27:44 +01:00
|
|
|
|
2014-04-25 04:11:55 +02:00
|
|
|
virtual void setTextStyle(const TextStyle& st);
|
2014-02-11 14:27:44 +01:00
|
|
|
const TextStyle& textStyle() const { return _textStyle; }
|
|
|
|
TextStyle& textStyle() { return _textStyle; }
|
2014-07-03 11:22:42 +02:00
|
|
|
TextStyleType textStyleType() const { return _styleIndex; }
|
|
|
|
void setTextStyleType(TextStyleType);
|
|
|
|
void restyle(TextStyleType);
|
2014-02-11 14:27:44 +01:00
|
|
|
|
2016-06-03 16:51:17 +02:00
|
|
|
Align align() const { return _textStyle.align(); }
|
|
|
|
|
2016-02-26 18:44:58 +01:00
|
|
|
Ms::MSQE_TextStyleType::E qmlTextStyleType() const { return static_cast<Ms::MSQE_TextStyleType::E>(_styleIndex); }
|
|
|
|
void qmlUndoSetTextStyleType(Ms::MSQE_TextStyleType::E st) { undoChangeProperty(P_ID::TEXT_STYLE_TYPE, int(st)); }
|
|
|
|
|
2014-02-21 15:02:17 +01:00
|
|
|
void setPlainText(const QString&);
|
2015-04-27 12:59:30 +02:00
|
|
|
void setXmlText(const QString&);
|
|
|
|
QString xmlText() const { return _text; }
|
2014-04-05 10:48:10 +02:00
|
|
|
QString plainText(bool noSym = false) const;
|
2014-02-11 14:27:44 +01:00
|
|
|
void insertText(const QString&);
|
|
|
|
|
2014-10-04 12:59:29 +02:00
|
|
|
bool editMode() const { return _editMode; }
|
|
|
|
|
2014-02-19 12:18:44 +01:00
|
|
|
virtual void layout() override;
|
|
|
|
virtual void layout1();
|
2014-06-02 07:49:44 +02:00
|
|
|
void sameLayout();
|
2012-05-26 14:26:10 +02:00
|
|
|
qreal lineSpacing() const;
|
|
|
|
qreal lineHeight() const;
|
2014-02-19 12:18:44 +01:00
|
|
|
virtual qreal baseLine() const override;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2016-02-06 22:03:43 +01:00
|
|
|
bool empty() const { return _text.isEmpty(); }
|
2014-02-11 14:27:44 +01:00
|
|
|
void clear() { _text.clear(); }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
bool layoutToParentWidth() const { return _layoutToParentWidth; }
|
|
|
|
void setLayoutToParentWidth(bool v) { _layoutToParentWidth = v; }
|
|
|
|
|
|
|
|
void startEdit(MuseScoreView*, const QPointF&);
|
|
|
|
void endEdit();
|
2015-01-19 12:37:17 +01:00
|
|
|
bool edit(MuseScoreView*, Grip, int key, Qt::KeyboardModifiers, const QString&);
|
2014-02-11 14:27:44 +01:00
|
|
|
|
2014-03-14 15:43:13 +01:00
|
|
|
void setFormat(FormatId, QVariant);
|
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
bool deletePreviousChar();
|
|
|
|
bool deleteChar();
|
|
|
|
void deleteSelectedText();
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
bool movePosition(QTextCursor::MoveOperation op,
|
2014-03-18 21:26:46 +01:00
|
|
|
QTextCursor::MoveMode mode = QTextCursor::MoveAnchor, int count = 1);
|
2014-02-11 14:27:44 +01:00
|
|
|
bool setCursor(const QPointF& p,
|
|
|
|
QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
|
2014-02-14 17:54:33 +01:00
|
|
|
void moveCursorToEnd() { movePosition(QTextCursor::End); }
|
|
|
|
void moveCursorToStart() { movePosition(QTextCursor::Start); }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
QString selectedText() const;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
void insertSym(SymId);
|
|
|
|
void selectAll();
|
|
|
|
|
2014-02-19 18:01:58 +01:00
|
|
|
virtual bool systemFlag() const { return textStyle().systemFlag(); }
|
|
|
|
|
2016-11-19 11:51:21 +01:00
|
|
|
virtual void write(XmlWriter& xml) const override;
|
2014-02-19 12:18:44 +01:00
|
|
|
virtual void read(XmlReader&) override;
|
2016-11-19 11:51:21 +01:00
|
|
|
virtual void writeProperties(XmlWriter& xml) const { writeProperties(xml, true, true); }
|
|
|
|
void writeProperties(XmlWriter& xml, bool writeText) const { writeProperties(xml, writeText, true); }
|
|
|
|
void writeProperties(XmlWriter&, bool, bool) const;
|
2014-02-11 14:27:44 +01:00
|
|
|
bool readProperties(XmlReader&);
|
|
|
|
|
|
|
|
void spellCheckUnderline(bool) {}
|
2016-04-06 23:35:30 +02:00
|
|
|
virtual void styleChanged() override;
|
2014-02-11 14:27:44 +01:00
|
|
|
|
|
|
|
virtual void paste();
|
|
|
|
|
|
|
|
QRectF pageRectangle() const;
|
|
|
|
|
2016-02-17 13:36:31 +01:00
|
|
|
TextCursor* cursor() { return _cursor; }
|
2014-02-11 14:27:44 +01:00
|
|
|
|
|
|
|
void setAbove(bool val) { textStyle().setYoff(val ? -2.0 : 7.0); }
|
|
|
|
void dragTo(const QPointF&);
|
2013-04-10 12:08:29 +02:00
|
|
|
|
2015-06-19 22:37:27 +02:00
|
|
|
virtual QLineF dragAnchor() const override;
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
QVariant getProperty(P_ID propertyId) const;
|
|
|
|
bool setProperty(P_ID propertyId, const QVariant& v);
|
2014-04-18 06:59:30 +02:00
|
|
|
virtual QVariant propertyDefault(P_ID id) const;
|
2014-02-11 14:27:44 +01:00
|
|
|
|
2014-08-13 21:01:21 +02:00
|
|
|
virtual bool acceptDrop(const DropData&) const override;
|
2014-02-11 20:29:18 +01:00
|
|
|
virtual Element* drop(const DropData&) override;
|
|
|
|
|
2014-02-11 14:27:44 +01:00
|
|
|
friend class TextBlock;
|
|
|
|
friend class TextFragment;
|
2014-02-21 15:02:17 +01:00
|
|
|
virtual void textChanged() {}
|
2014-03-24 17:03:37 +01:00
|
|
|
QString convertFromHtml(const QString& ss) const;
|
2014-06-06 12:40:22 +02:00
|
|
|
static QString convertToHtml(const QString&, const TextStyle&);
|
2016-03-15 03:51:05 +01:00
|
|
|
static QString tagEscape(QString s);
|
|
|
|
static QString unEscape(QString s);
|
2014-06-06 12:40:22 +02:00
|
|
|
|
2014-05-26 18:18:01 +02:00
|
|
|
void undoSetText(const QString& s) { undoChangeProperty(P_ID::TEXT, s); }
|
2016-02-04 17:06:32 +01:00
|
|
|
virtual QString accessibleInfo() const override;
|
2014-11-07 12:28:32 +01:00
|
|
|
|
|
|
|
virtual int subtype() const;
|
|
|
|
virtual QString subtypeName() const;
|
2014-12-23 12:07:26 +01:00
|
|
|
|
|
|
|
QList<TextFragment> fragmentList() const; // for MusicXML formatted export
|
2015-01-06 15:23:10 +01:00
|
|
|
|
|
|
|
static bool validateText(QString& s);
|
2015-01-13 17:21:04 +01:00
|
|
|
bool inHexState() const { return hexState >= 0; }
|
|
|
|
void endHexState();
|
2015-02-17 17:08:39 +01:00
|
|
|
void inputTransition(QInputMethodEvent*);
|
2015-02-02 17:21:22 +01:00
|
|
|
|
|
|
|
friend class TextCursor;
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
|
|
|
|
} // namespace Ms
|
2016-02-26 18:44:58 +01:00
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(Ms::MSQE_TextStyleType::E);
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
#endif
|