23
23
class KWTextFrameSet;
24
24
class KMacroCommand;
26
#include <qrichtext_p.h>
26
#include <korichtext.h>
29
28
// This command inserts a TOC at the beginning of a frameset, and is able to undo that.
30
29
// The reason we don't use KWTextFrameSet's insert, applyStyle etc. is that it would
31
30
// generate many many subcommands (resulting in much memory use).
32
class KWInsertTOCCommand : public QTextCommand
31
class KWInsertTOCCommand : public KoTextDocCommand
35
34
// The parag is where the TOC should be inserted
36
KWInsertTOCCommand( KWTextFrameSet *fs, QTextParag *parag );
37
QTextCursor *execute( QTextCursor *c );
38
QTextCursor *unexecute( QTextCursor *c );
35
KWInsertTOCCommand( KWTextFrameSet *fs, KoTextParag *parag );
36
KoTextCursor *execute( KoTextCursor *c );
37
KoTextCursor *unexecute( KoTextCursor *c );
40
39
// Helper method, public for KWTextFrameSet::insertTOC().
41
40
// Remove a toc based on the parag styles
42
static QTextCursor * removeTOC( KWTextFrameSet *fs, QTextCursor *cursor, KMacroCommand *macroCmd );
41
static KoTextCursor * removeTOC( KWTextFrameSet *fs, KoTextCursor *cursor, KMacroCommand *macroCmd );
45
44
// Find or create a toc style
46
static KWStyle * findOrCreateTOCStyle( KWTextFrameSet *fs, int depth );
45
static KoStyle * findOrCreateTOCStyle( KWTextFrameSet *fs, int depth );