' api_richedit.sbp


#ifndef _INC_RICHEDIT
#define _INC_RICHEDIT


Const MAX_TAB_STOPS = 32


'CHARFORMAT struct
Const CFM_BOLD =      &H00000001
Const CFM_ITALIC =    &H00000002
Const CFM_UNDERLINE = &H00000004
Const CFM_STRIKEOUT = &H00000008
Const CFM_PROTECTED = &H00000010
Const CFM_LINK =      &H00000020
Const CFM_SIZE =      &H80000000
Const CFM_COLOR =     &H40000000
Const CFM_FACE =      &H20000000
Const CFM_OFFSET =    &H10000000
Const CFM_CHARSET =   &H08000000

Const CFE_BOLD =      &H0001
Const CFE_ITALIC =    &H0002
Const CFE_UNDERLINE = &H0004
Const CFE_STRIKEOUT = &H0008
Const CFE_PROTECTED = &H0010
Const CFE_LINK =      &H0020
Const CFE_AUTOCOLOR = &H40000000

Type CHARFORMATW
	cbSize As DWord
	dwMask As DWord
	dwEffects As DWord
	yHeight As Long
	yOffset As Long
	crTextColor As COLORREF
	bCharSet As Byte
	bPitchAndFamily As Byte
	szFaceName[ELM(LF_FACESIZE)] As WCHAR
End Type
Type CHARFORMATA
	cbSize As DWord
	dwMask As DWord
	dwEffects As DWord
	yHeight As Long
	yOffset As Long
	crTextColor As COLORREF
	bCharSet As Byte
	bPitchAndFamily As Byte
	szFaceName[ELM(LF_FACESIZE)] As SByte
End Type
#ifdef UNICODE
TypeDef CHARFORMAT = CHARFORMATW
#else
TypeDef CHARFORMAT = CHARFORMATA
#endif

'CHARFORMAT2 struct
Const CFM_SMALLCAPS =     &H0040
Const CFM_ALLCAPS =       &H0080
Const CFM_HIDDEN =        &H0100
Const CFM_OUTLINE =       &H0200
Const CFM_SHADOW =        &H0400
Const CFM_EMBOSS =        &H0800
Const CFM_IMPRINT =       &H1000
Const CFM_DISABLED =      &H2000
Const CFM_REVISED =       &H4000
Const CFM_BACKCOLOR =     &H04000000
Const CFM_LCID =          &H02000000
Const CFM_UNDERLINETYPE = &H00800000
Const CFM_WEIGHT =        &H00400000
Const CFM_SPACING =       &H00200000
Const CFM_KERNING =       &H00100000
Const CFM_STYLE =         &H00080000
Const CFM_ANIMATION =     &H00040000
Const CFM_REVAUTHOR =     &H00008000
Const CFM_SUBSCRIPT =     &H00030000
Const CFM_SUPERSCRIPT =   CFM_SUBSCRIPT

Const CFE_SUBSCRIPT =     &H00010000
Const CFE_SUPERSCRIPT =   &H00020000
Const CFE_SMALLCAPS =    CFM_SMALLCAPS
Const CFE_ALLCAPS =      CFM_ALLCAPS
Const CFE_HIDDEN =       CFM_HIDDEN
Const CFE_OUTLINE =      CFM_OUTLINE
Const CFE_SHADOW =       CFM_SHADOW
Const CFE_EMBOSS =       CFM_EMBOSS
Const CFE_IMPRINT =      CFM_IMPRINT
Const CFE_DISABLED =     CFM_DISABLED
Const CFE_REVISED =      CFM_REVISED

Const CFU_CF1UNDERLINE =    &HFF
Const CFU_INVERT =          &HFE
Const CFU_UNDERLINEDOTTED = &H4
Const CFU_UNDERLINEDOUBLE = &H3
Const CFU_UNDERLINEWORD =   &H2
Const CFU_UNDERLINE =       &H1
Const CFU_UNDERLINENONE =   0

Type CHARFORMAT2W
	cbSize As DWord
	dwMask As DWord
	dwEffects As DWord
	yHeight As Long
	yOffset As Long
	crTextColor As DWord
	bCharSet As Byte
	bPitchAndFamily As Byte
	szFaceName[ELM(LF_FACESIZE)] As WCHAR
	wWeight As Word
	sSpacing As Integer
	crBackColor As DWord
	lcid As DWord
	dwReserved As DWord
	sStyle As Integer
	wKerning As Word
	bUnderlineType As Byte
	bAnimation As Byte
	bRevAuthor As Byte
	bReserved1 As Byte
End Type
Type CHARFORMAT2A
	cbSize As DWord
	dwMask As DWord
	dwEffects As DWord
	yHeight As Long
	yOffset As Long
	crTextColor As DWord
	bCharSet As Byte
	bPitchAndFamily As Byte
	szFaceName[ELM(LF_FACESIZE)] As CHAR
	wWeight As Word
	sSpacing As Integer
	crBackColor As DWord
	lcid As DWord
	dwReserved As DWord
	sStyle As Integer
	wKerning As Word
	bUnderlineType As Byte
	bAnimation As Byte
	bRevAuthor As Byte
	bReserved1 As Byte
End Type
#ifdef UNICODE
TypeDef CHARFORMAT2 = CHARFORMAT2W
#else
TypeDef CHARFORMAT2 = CHARFORMAT2A
#endif


'PARAFORMAT struct
Const PFM_STARTINDENT =  &H00000001
Const PFM_RIGHTINDENT =  &H00000002
Const PFM_OFFSET =       &H00000004
Const PFM_ALIGNMENT =    &H00000008
Const PFM_TABSTOPS =     &H00000010
Const PFM_NUMBERING =    &H00000020
Const PFM_OFFSETINDENT = &H80000000

Const PFA_LEFT =   &H0001
Const PFA_RIGHT =  &H0002
Const PFA_CENTER = &H0003

Type PARAFORMAT
	cbSize As DWord
	dwMask As DWord
	wNumbering As Word
	wReserved As Word
	dxStartIndent As Long
	dxRightIndent As Long
	dxOffset As Long
	wAlignment As Word
	cTabCount As Integer
	rgxTabs[ELM(MAX_TAB_STOPS)] As Long
End Type


'PARAFORMAT2 struct
Const PFM_SPACEBEFORE =     &H00000040
Const PFM_SPACEAFTER =      &H00000080
Const PFM_LINESPACING =     &H00000100
Const PFM_STYLE =           &H00000400
Const PFM_BORDER =          &H00000800
Const PFM_SHADING =         &H00001000
Const PFM_NUMBERINGSTYLE =  &H00002000
Const PFM_NUMBERINGTAB =    &H00004000
Const PFM_NUMBERINGSTART =  &H00008000
Const PFM_DIR =             &H00010000
Const PFM_RTLPARA =         &H00010000
Const PFM_KEEP =            &H00020000
Const PFM_KEEPNEXT =        &H00040000
Const PFM_PAGEBREAKBEFORE = &H00080000
Const PFM_NOLINENUMBER =    &H00100000
Const PFM_NOWIDOWCONTROL =  &H00200000
Const PFM_DONOTHYPHEN =     &H00400000
Const PFM_SIDEBYSIDE =      &H00800000
Const PFM_TABLE =           &Hc0000000

Const PFE_RTLPARA =         PFM_DIR             >> 16
Const PFE_RTLPAR =          PFM_RTLPARA         >> 16
Const PFE_KEEP =            PFM_KEEP            >> 16
Const PFE_KEEPNEXT =        PFM_KEEPNEXT        >> 16
Const PFE_PAGEBREAKBEFORE = PFM_PAGEBREAKBEFORE >> 16
Const PFE_NOLINENUMBER =    PFM_NOLINENUMBER    >> 16
Const PFE_NOWIDOWCONTROL =  PFM_NOWIDOWCONTROL  >> 16
Const PFE_DONOTHYPHEN =     PFM_DONOTHYPHEN     >> 16
Const PFE_SIDEBYSIDE =      PFM_SIDEBYSIDE      >> 16

Const PFA_JUSTIFY = &H0004

Type PARAFORMAT2
	cbSize As DWord
	dwMask As DWord
	wNumbering As Word
	wReserved As Word
	dxStartIndent As Long
	dxRightIndent As Long
	dxOffset As Long
	wAlignment As Word
	cTabCount As Integer
	rgxTabs[ELM(MAX_TAB_STOPS)] As Long
	dySpaceBefore As Long
	dySpaceAfter As Long
	dyLineSpacing As Long
	sStyle As Integer
	bLineSpacingRule As Byte
	bCRC As Byte
	wShadingWeight As Word
	wShadingStyle As Word
	wNumberingStart As Word
	wNumberingStyle As Word
	wNumberingTab As Word
	wBorderSpace As Word
	wBorderWidth As Word
	wBorders As Word
End Type



'----------
' Messages
'----------

Const EM_CANPASTE =           WM_USER + 50
Const EM_DISPLAYBAND =        WM_USER + 51
Const EM_EXGETSEL =           WM_USER + 52
Const EM_EXLIMITTEXT =        WM_USER + 53
Const EM_EXLINEFROMCHAR =     WM_USER + 54
Const EM_EXSETSEL =           WM_USER + 55
Const EM_FINDTEXT =           WM_USER + 56
Const EM_FORMATRANGE =        WM_USER + 57
Const EM_GETCHARFORMAT =      WM_USER + 58
Const EM_GETEVENTMASK =       WM_USER + 59
Const EM_GETOLEINTERFACE =    WM_USER + 60
Const EM_GETPARAFORMAT =      WM_USER + 61
Const EM_GETSELTEXT =         WM_USER + 62
Const EM_HIDESELECTION =      WM_USER + 63
Const EM_PASTESPECIAL =       WM_USER + 64
Const EM_REQUESTRESIZE =      WM_USER + 65
Const EM_SELECTIONTYPE =      WM_USER + 66
Const EM_SETBKGNDCOLOR =      WM_USER + 67

Const EM_SETCHARFORMAT =      WM_USER + 68
Const SCF_SELECTION =  &H0001
Const SCF_WORD =       &H0002
Const SCF_DEFAULT =    &H0000
Const SCF_ALL =        &H0004
Const SCF_USEUIRULES = &H0008

Const EM_SETEVENTMASK =       WM_USER + 69
Const ENM_NONE =             &H00000000
Const ENM_CHANGE =           &H00000001
Const ENM_UPDATE =           &H00000002
Const ENM_SCROLL =           &H00000004
Const ENM_KEYEVENTS =        &H00010000
Const ENM_MOUSEEVENTS =      &H00020000
Const ENM_REQUESTRESIZE =    &H00040000
Const ENM_SELCHANGE =        &H00080000
Const ENM_DROPFILES =        &H00100000
Const ENM_PROTECTED =        &H00200000
Const ENM_CORRECTTEXT =      &H00400000
Const ENM_SCROLLEVENTS =     &H00000008
Const ENM_DRAGDROPDONE =     &H00000010
Const ENM_IMECHANGE =        &H00800000
Const ENM_LANGCHANGE =       &H01000000
Const ENM_OBJECTPOSITIONS =  &H02000000
Const ENM_LINK =             &H04000000

Const EM_SETOLECALLBACK =     WM_USER + 70
Const EM_SETPARAFORMAT =      WM_USER + 71
Const EM_SETTARGETDEVICE =    WM_USER + 72
Const EM_STREAMIN =           WM_USER + 73
Const EM_STREAMOUT =          WM_USER + 74
Const EM_GETTEXTRANGE =       WM_USER + 75
Const EM_FINDWORDBREAK =      WM_USER + 76
Const EM_SETOPTIONS =         WM_USER + 77
Const EM_GETOPTIONS =         WM_USER + 78
Const EM_FINDTEXTEX =         WM_USER + 79
Const EM_GETWORDBREAKPROCEX = WM_USER + 80
Const EM_SETWORDBREAKPROCEX = WM_USER + 81
Const EM_SETUNDOLIMIT =       WM_USER + 82
Const EM_REDO =               WM_USER + 84
Const EM_CANREDO =            WM_USER + 85
Const EM_GETUNDONAME =        WM_USER + 86
Const EM_GETREDONAME =        WM_USER + 87
Const EM_STOPGROUPTYPING =    WM_USER + 88
Const EM_SETTEXTMODE =        WM_USER + 89
Const EM_GETTEXTMODE =        WM_USER + 90
Const EM_AUTOURLDETECT =      WM_USER + 91
Const EM_GETAUTOURLDETECT =   WM_USER + 92
Const EM_SETPALETTE =         WM_USER + 93
Const EM_GETTEXTEX =          WM_USER + 94
Const EM_GETTEXTLENGTHEX =    WM_USER + 95
Const EM_SETPUNCTUATION =     WM_USER + 100
Const EM_GETPUNCTUATION =     WM_USER + 101
Const EM_SETWORDWRAPMODE =    WM_USER + 102
Const EM_GETWORDWRAPMODE =    WM_USER + 103
Const EM_SETIMECOLOR =        WM_USER + 104
Const EM_GETIMECOLOR =        WM_USER + 105
Const EM_SETIMEOPTIONS =      WM_USER + 106
Const EM_GETIMEOPTIONS =      WM_USER + 107
Const EM_CONVPOSITION =       WM_USER + 108
Const EM_SETLANGOPTIONS =     WM_USER + 120
Const EM_GETLANGOPTIONS =     WM_USER + 121
Const EM_GETIMECOMPMODE =     WM_USER + 122
Const EM_FINDTEXTW =          WM_USER + 123
Const EM_FINDTEXTEXW =        WM_USER + 124
Const EM_SETBIDIOPTIONS =     WM_USER + 200
Const EM_GETBIDIOPTIONS =     WM_USER + 201



'---------------
' notifications
'---------------

Const EN_MSGFILTER =       &H0700
Type MSGFILTER
	nmhdr As NMHDR
	msg As DWord
	wParam As WPARAM
	lParam As LPARAM
End Type

Type CHARRANGE
	cpMin As Long
	cpMax As Long
End Type

Type EDITSTREAM
	dwCookie As ULONG_PTR
	dwError As DWord
	pfnCallback As VoidPtr
End Type

Const EN_REQUESTRESIZE =   &H0701
Const EN_SELCHANGE =       &H0702
Const EN_DROPFILES =       &H0703
Const EN_PROTECTED =       &H0704
Const EN_CORRECTTEXT =     &H0705
Const EN_STOPNOUNDO =      &H0706
Const EN_IMECHANGE =       &H0707
Const EN_SAVECLIPBOARD =   &H0708
Const EN_OLEOPFAILED =     &H0709
Const EN_OBJECTPOSITIONS = &H070a
Const EN_LINK =            &H070b
Const EN_DRAGDROPDONE =    &H070c
Const EN_ALIGN_LTR =       &H0710
Const EN_ALIGN_RTL =       &H0711


#endif '_INC_RICHEDIT
