42 #ifndef QTEXTDOCUMENT_P_H 43 #define QTEXTDOCUMENT_P_H 56 #include "QtCore/qglobal.h" 57 #include "QtCore/qstring.h" 58 #include "QtCore/qvector.h" 59 #include "QtCore/qlist.h" 60 #include "private/qobject_p.h" 61 #include "private/qfragmentmap_p.h" 62 #include "QtGui/qtextlayout.h" 63 #include "QtGui/qtextoption.h" 64 #include "private/qtextformat_p.h" 65 #include "QtGui/qtextdocument.h" 66 #include "QtGui/qtextobject.h" 67 #include "QtGui/qtextcursor.h" 68 #include "QtCore/qmap.h" 69 #include "QtCore/qvariant.h" 70 #include "QtCore/qurl.h" 71 #include "private/qcssparser_p.h" 89 #define QTextBeginningOfFrame QChar(0xfdd0) 90 #define QTextEndOfFrame QChar(0xfdd1) 106 {
layout = 0; userData = 0; userState = -1; revision = 0; hidden = 0; }
109 {
delete layout;
layout = 0;
delete userData; userData = 0; }
129 CharFormatChanged = 2,
130 BlockFormatChanged = 3,
135 GroupFormatChange = 8,
180 void insert(
int pos,
int strPos,
int strLength,
int format);
182 int insertBlock(
const QChar &blockSeparator,
int pos,
int blockFormat,
int charFormat,
188 void aboutToRemoveCell(
int cursorFrom,
int cursorEnd);
199 void emitUndoAvailable(
bool available);
200 void emitRedoAvailable(
bool available);
202 int undoRedo(
bool undo);
203 inline void undo() { undoRedo(
true); }
204 inline void redo() { undoRedo(
false); }
207 void joinPreviousEditBlock();
211 void enableUndoRedo(
bool enable);
215 inline bool isRedoAvailable()
const {
return undoEnabled && undoState < undoStack.size(); }
222 inline int length()
const {
return fragments.length(); }
228 inline FragmentIterator
find(
int pos)
const {
return fragments.find(pos); }
229 inline FragmentIterator
begin()
const {
return fragments.begin(); }
230 inline FragmentIterator
end()
const {
return fragments.end(); }
235 int blockCharFormatIndex(
int node)
const;
237 inline int numBlocks()
const {
return blocks.numNodes(); }
239 const BlockMap &
blockMap()
const {
return blocks; }
248 int leftCursorPosition(
int position)
const;
249 int rightCursorPosition(
int position)
const;
253 void setModified(
bool m);
265 void insert_string(
int pos,
uint strPos,
uint length,
int format, QTextUndoCommand::Operation op);
266 int insert_block(
int pos,
uint strPos,
int format,
int blockformat, QTextUndoCommand::Operation op,
int command);
267 int remove_string(
int pos,
uint length, QTextUndoCommand::Operation op);
268 int remove_block(
int pos,
int *blockformat,
int command, QTextUndoCommand::Operation op);
271 void scan_frames(
int pos,
int charsRemoved,
int charsAdded);
274 void adjustDocumentChangesAndCursors(
int from,
int addedOrRemoved, QTextUndoCommand::Operation op);
280 void documentChange(
int from,
int length);
288 QTextObject *objectForIndex(
int objectIndex)
const;
289 QTextObject *objectForFormat(
int formatIndex)
const;
298 bool ensureMaximumBlockCount();
306 void contentsChanged();
308 void compressPieceTable();
346 #ifndef QT_NO_CSSPARSER 388 void emitBlockAttributes(
const QTextBlock &block);
390 void emitTextLength(
const char *attribute,
const QTextLength &length);
391 void emitAlignment(Qt::Alignment alignment);
394 void emitAttribute(
const char *attribute,
const QString &value);
397 void emitPageBreakPolicy(QTextFormat::PageBreakFlags policy);
399 void emitFontFamily(
const QString &family);
401 void emitBackgroundAttribute(
const QTextFormat &format);
412 #endif // QTEXTDOCUMENT_P_H
QTextCharFormat defaultCharFormat
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
#define QT_END_NAMESPACE
This macro expands to.
FragmentIterator end() const
QTextFormatCollection formats
#define it(className, varName)
QAbstractTextDocumentLayout * lout
The QTextFrame class represents a frame in a QTextDocument.
Position
This enum describes how a frame is located relative to the surrounding text.
The QByteArray class provides an array of bytes.
QList< QTextCursorPrivate * > cursors
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
static void clear(QVariant::Private *d)
const QTextDocument * doc
Q_DECLARE_TYPEINFO(QTextUndoCommand, Q_PRIMITIVE_TYPE)
QFragmentMap< QTextFragmentData > FragmentMap
void setDefaultFont(const QFont &f)
QAbstractTextDocumentLayout * layout() const
bool isRedoAvailable() const
The QString class provides a Unicode character string.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
The QChar class provides a 16-bit Unicode character.
QTextOption defaultTextOption
void addCursor(QTextCursorPrivate *c)
FragmentMap::ConstIterator FragmentIterator
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
bool isInEditBlock() const
QString defaultStyleSheet
#define QT_BEGIN_NAMESPACE
This macro expands to.
FragmentIterator find(int pos) const
QTextBlock blocksBegin() const
uint blockCursorAdjustment
The QTextFormat class provides formatting information for a QTextDocument.
The QTextCursor class offers an API to access and modify QTextDocuments.
bool isUndoAvailable() const
QTextFormatCollection * formatCollection()
QAbstractUndoItem * custom
QMap< QUrl, QVariant > cachedResources
uint needsEnsureMaximumBlockCount
The QTextBlock class provides a container for text fragments in a QTextDocument.
QCss::StyleSheet parsedDefaultStyleSheet
static void split(QT_FT_Vector *b)
static const QTextBlockData * block(const QTextBlock &it)
The QTextTable class represents a table in a QTextDocument.
const BlockMap & blockMap() const
bool isUndoRedoEnabled() const
The QTextFragment class holds a piece of text in a QTextDocument with a single QTextCharFormat.
const QTextDocument * document() const
QFont defaultFont() const
QFragmentMap< QTextBlockData > BlockMap
The iterator class provides an iterator for reading the contents of a QTextFrame. ...
The QTextBlockUserData class is used to associate custom data with blocks of text.
Fragment * fragment(uint index)
void removeCursor(QTextCursorPrivate *c)
QTextBlockUserData * userData
The QTextLayout class is used to lay out and render text.
#define Q_DECLARE_PUBLIC(Class)
FragmentIterator begin() const
CursorMoveStyle
This enum describes the movement style available to text cursors.
The QFont class specifies a font used for drawing text.
int availableRedoSteps() const
int editBlockCursorPosition
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
The QTextLength class encapsulates the different types of length used in a QTextDocument.
The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument...
#define Q_AUTOTEST_EXPORT
The QTextOption class provides a description of general rich text properties.
QVector< QTextUndoCommand > undoStack
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
Qt::CursorMoveStyle defaultCursorMoveStyle
int availableUndoSteps() const
QTextBlock blocksFind(int pos) const
const QTextFormatCollection * formatCollection() const
The QTextObject class is a base class for different kinds of objects that can group parts of a QTextD...
QMap< QUrl, QVariant > resources
static const KeyPair *const end
uint unreachableCharacterCount
const FragmentMap & fragmentMap() const
BorderStyle
This enum describes different border styles for the text frame.
int initialBlockCharFormatIndex
QMap< int, QTextObject * > objects
The QMap class is a template class that provides a skip-list-based dictionary.
QTextDocument * document()
FragmentMap & fragmentMap()
The QList class is a template class that provides lists.
QTextBlock blocksEnd() const
The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for ...