2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
5 #ifndef MARKUP_PARSER_H
6 #define MARKUP_PARSER_H
8 #include "TextDocument.h"
15 const CharacterStyle
& characterStyle
,
16 const ParagraphStyle
& paragraphStyle
);
19 const CharacterStyle
& characterStyle
,
20 const ParagraphStyle
& paragraphStyle
);
22 const CharacterStyle
& HeadingCharacterStyle() const
23 { return fHeadingStyle
; }
24 const ParagraphStyle
& HeadingParagraphStyle() const
25 { return fHeadingParagraphStyle
; }
27 const CharacterStyle
& NormalCharacterStyle() const
28 { return fNormalStyle
; }
29 const ParagraphStyle
& NormalParagraphStyle() const
30 { return fParagraphStyle
; }
32 TextDocumentRef
CreateDocumentFromMarkup(const BString
& text
);
33 void AppendMarkup(const TextDocumentRef
& document
,
39 void _ParseText(const BString
& text
);
40 void _CopySpan(const BString
& text
,
41 int32
& start
, int32 end
);
42 void _ToggleStyle(const CharacterStyle
& style
);
43 void _FinishParagraph(bool isLast
);
46 CharacterStyle fNormalStyle
;
47 CharacterStyle fBoldStyle
;
48 CharacterStyle fItalicStyle
;
49 CharacterStyle fBoldItalicStyle
;
50 CharacterStyle fHeadingStyle
;
52 ParagraphStyle fParagraphStyle
;
53 ParagraphStyle fHeadingParagraphStyle
;
54 ParagraphStyle fBulletStyle
;
56 const CharacterStyle
* fCurrentCharacterStyle
;
57 const ParagraphStyle
* fCurrentParagraphStyle
;
60 TextDocumentRef fTextDocument
;
61 Paragraph fCurrentParagraph
;
62 int32 fSpanStartOffset
;
66 #endif // MARKUP_PARSER_H