|
|
Support for MFC (Windows) .
More...
#include "NMEMFC.h"
#include "NMEStyleCpp.h"
Go to the source code of this file.
Defines |
|
#define | isFirstUTF8Byte(c) (((c) & 0x80) == 0 || ((c) & 0xe0) == 0xc0 || ((c) & 0xf0) == 0xe0) |
| | Test if a byte is the first byte of a UTF-8 character.
|
Functions |
| static CString | utf8ToCString (char const *utf8, int len=-1) |
| | Convert unicode characters encoded as 16-bit UTF-8 to a CString.
|
| static char * | cStringToUtf8 (WCHAR const *wstr, int len=-1) |
| | Convert UCS-16 string to UTF-8.
|
| void | NMEMFCSetRichText (CRichEditCtrl &c, char const *input, int inputLength, bool replaceSel, CHARFORMAT const *plainTextCharFormat, bool links) |
| | Replace selection in a CRichEditCtrl with NME text converted to styled text.
|
| void | NMEMFCSetRichText (CRichEditCtrl &c, WCHAR const *input, int inputLength, bool replaceSel, CHARFORMAT const *plainTextCharFormat, bool links) |
| | Replace selection in a CRichEditCtrl with NME text converted to styled text.
|
| void | NMEMFCEnLink (NMHDR const *pNMHDR, LRESULT *pResult, NMEMFCLinkFun linkFun, void *linkFunData) |
| | Handle links (should be called when an EN_LINK notification is received).
|
| void | NMEMFCLinkFunURL (NMEConstText link, void *data) |
| | NMEMFCLinkFun callback to let Windows process URL (can be used as is or called from a user-written callback which recognizes other kinds of links).
|
Detailed Description
Support for MFC (Windows) .
- Author:
- Yves Piguet.
- Copyright:
- 2007-2013, Yves Piguet.
Definition in file NMEMFC.cpp.
Function Documentation
| static char* cStringToUtf8 |
( |
WCHAR const * |
wstr, |
|
|
int |
len = -1 |
|
) |
| [static] |
Convert UCS-16 string to UTF-8.
- Parameters:
-
| [in] | wstr | string with 16-bit unicode char (UCS-16) |
| [in] | len | number of characters in wstr (-1 if null-terminated) |
- Returns:
- newly allocated null-terminated string converted to UTF-8 (should be freed with delete [])
Definition at line 82 of file NMEMFC.cpp.
| void NMEMFCEnLink |
( |
NMHDR const * |
pNMHDR, |
|
|
LRESULT * |
pResult, |
|
|
NMEMFCLinkFun |
linkFun, |
|
|
void * |
linkFunData = NULL |
|
) |
| |
Handle links (should be called when an EN_LINK notification is received).
- Parameters:
-
| [in] | pNMHDR | notification message |
| [out] | pResult | result code |
| [in] | linkFun | callback which handles link clicks |
| [in] | linkFunData | value passed to linkFun |
Definition at line 293 of file NMEMFC.cpp.
| void NMEMFCLinkFunURL |
( |
NMEConstText |
link, |
|
|
void * |
data = NULL |
|
) |
| |
NMEMFCLinkFun callback to let Windows process URL (can be used as is or called from a user-written callback which recognizes other kinds of links).
- Parameters:
-
| [in] | link | raw URL, as in NME source text, without leading and trailing spaces (null-terminated string) |
| [in,out] | data | not used |
Definition at line 332 of file NMEMFC.cpp.
| void NMEMFCSetRichText |
( |
CRichEditCtrl & |
c, |
|
|
char const * |
input, |
|
|
int |
inputLength = -1, |
|
|
bool |
replaceSel = FALSE, |
|
|
CHARFORMAT const * |
plainTextCharFormat = NULL, |
|
|
bool |
links = FALSE |
|
) |
| |
Replace selection in a CRichEditCtrl with NME text converted to styled text.
- Parameters:
-
| [in,out] | c | MFC rich text control |
| [in] | input | text with NME markup |
| [in] | inputLength | length of input, or negative if input is null-terminated |
| [in] | replaceSel | if TRUE, replace selection, else replace whole text |
| [in] | plainTextCharFormat | character format of plain text (if NULL, use default character format of c) |
| [in] | links | TRUE to enable links, else FALSE |
Definition at line 123 of file NMEMFC.cpp.
| void NMEMFCSetRichText |
( |
CRichEditCtrl & |
c, |
|
|
WCHAR const * |
input, |
|
|
int |
inputLength = -1, |
|
|
bool |
replaceSel = FALSE, |
|
|
CHARFORMAT const * |
plainTextCharFormat = NULL, |
|
|
bool |
links = FALSE |
|
) |
| |
Replace selection in a CRichEditCtrl with NME text converted to styled text.
- Parameters:
-
| [in,out] | c | MFC rich text control |
| [in] | input | text as UCS-16 with NME markup |
| [in] | inputLength | length of input, or negative if input is null-terminated |
| [in] | replaceSel | if TRUE, replace selection, else replace whole text |
| [in] | plainTextCharFormat | character format of plain text (if NULL, use default character format of c) |
| [in] | links | TRUE to enable links, else FALSE |
Definition at line 282 of file NMEMFC.cpp.
| static CString utf8ToCString |
( |
char const * |
utf8, |
|
|
int |
len = -1 |
|
) |
| [static] |
Convert unicode characters encoded as 16-bit UTF-8 to a CString.
- Parameters:
-
| [in] | utf8 | UTF-8 string |
| [in] | len | length of utf8 in bytes, or -1 if null-terminated |
Definition at line 21 of file NMEMFC.cpp.
|
Generated by Doxygen.
Copyright 2007-2013, Yves Piguet.
All rights reserved.
|
|