1
////////////////////////////////////////////////////////////////////////////
2
// NoteCase notes manager project <http://notecase.sf.net>
4
// This code is licensed under BSD license.See "license.txt" for more details.
6
// File: Stores text formatting info
7
////////////////////////////////////////////////////////////////////////////
14
#endif // _MSC_VER > 1000
17
#pragma warning(disable:4786)
26
#define FMT_BOLD_BEGIN 1
27
#define FMT_BOLD_END 2
28
#define FMT_ITALIC_BEGIN 3
29
#define FMT_ITALIC_END 4
30
#define FMT_UNDERLINE_BEGIN 5
31
#define FMT_UNDERLINE_END 6
32
#define FMT_TXT_COLOR_BEGIN 7
33
#define FMT_TXT_COLOR_END 8
34
#define FMT_STRIKE_BEGIN 9
35
#define FMT_STRIKE_END 10
41
FmtInfo(const FmtInfo &other);
44
void operator = (const FmtInfo &other);
52
class FmtInfoList : public std::vector<FmtInfo>
56
virtual ~FmtInfoList();
58
static bool IsStartTag(int nFormatTag);
59
static int CalcFormatEndTag(int nFormatTag);
63
bool IsRangeFormatted(int nStart, int nEnd, int nFormatTag);
64
void AddFormatRange(int nStart, int nEnd, int nFormatTag, const GdkColor& color);
65
void ClearFormatRange(int nStart, int nEnd, int nFormatTag);
67
//adapt to events within the node text buffer
68
void OnTxtInsert(int nOffset, int nCharsAdded, const char *szTxt);
69
void OnTxtReplaced(int nStart, int nEnd, const char *szTxt);
70
void OnTxtDelete(int nOffset, int nCharsDeleted);
71
void OnLinkCreated(int nOffset, int nLen);
73
int GetTagCount(int nFormatTag);
74
void AssertValid(); //debugging helper