X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f533a674ae352c1dd0a28ccd8ecf225a1ca29332..65baafba0e8cd74f2264b7e2f7625ff5bea84864:/docs/latex/wx/htwinprs.tex diff --git a/docs/latex/wx/htwinprs.tex b/docs/latex/wx/htwinprs.tex index 0f322c46a5..5a24cf285b 100644 --- a/docs/latex/wx/htwinprs.tex +++ b/docs/latex/wx/htwinprs.tex @@ -6,22 +6,22 @@ \section{\class{wxHtmlWinParser}}\label{wxhtmlwinparser} This class is derived from \helpref{wxHtmlParser}{wxhtmlparser} and -its mail goal is to parse HTML input so that it can be displayed in -\helpref{wxHtmlWindow}{wxhtmlwindow}. It uses special +its main goal is to parse HTML input so that it can be displayed in +\helpref{wxHtmlWindow}{wxhtmlwindow}. It uses a special \helpref{wxHtmlWinTagHandler}{wxhtmlwintaghandler}. \wxheading{Notes} -\begin{enumerate} -\item Product of parsing is wxHtmlCell (resp. wxHtmlContainer) object. -\item This parser produces temporary data! You should call -\helpref{delete GetTempData()}{wxhtmlparsergettempdata}! -\end{enumerate} +The product of parsing is a wxHtmlCell (resp. wxHtmlContainer) object. \wxheading{Derived from} \helpref{wxHtmlParser}{wxhtmlparser} +\wxheading{Include files} + + + \wxheading{See Also} \helpref{Handlers overview}{handlers} @@ -32,10 +32,10 @@ its mail goal is to parse HTML input so that it can be displayed in \func{}{wxHtmlWinParser}{\void} -\func{}{wxHtmlWinParser}{\param{wxWindow }{*wnd}} +\func{}{wxHtmlWinParser}{\param{wxHtmlWindow }{*wnd}} Constructor. Don't use the default one, use constructor with -{\it wnd} paremeter ({\it wnd} is pointer to associated \helpref{wxHtmlWindow}{wxhtmlwindow}) +{\it wnd} parameter ({\it wnd} is pointer to associated \helpref{wxHtmlWindow}{wxhtmlwindow}) \membersection{wxHtmlWinParser::AddModule}\label{wxhtmlwinparseraddmodule} @@ -54,24 +54,21 @@ and returns pointer to it (see \helpref{Overview}{cells}). \func{virtual wxFont*}{CreateCurrentFont}{\void} -Creates font based on current setting (see -\helpref{SetFontSize}{wxhtmlwinparsersetfontsize}, -\helpref{SetFontBold}{wxhtmlwinparsersetfontbold}, -\helpref{SetFontItalic}{wxhtmlwinparsersetfontitalic}, -\helpref{SetFontFixed}{wxhtmlwinparsersetfontfixed}, +Creates font based on current setting (see +\helpref{SetFontSize}{wxhtmlwinparsersetfontsize}, +\helpref{SetFontBold}{wxhtmlwinparsersetfontbold}, +\helpref{SetFontItalic}{wxhtmlwinparsersetfontitalic}, +\helpref{SetFontFixed}{wxhtmlwinparsersetfontfixed}, \helpref{SetFontUnderlined}{wxhtmlwinparsersetfontunderlined}) and returns pointer to it. -(If the font was already created only a pointer is returned.) +If the font was already created only a pointer is returned. -Fonts created during parsing are temporary data and are not freed on DoneParser. -You must call \helpref{delete myparser->GetTempData();}{wxhtmlparsergettempdata} -to free the memory! \membersection{wxHtmlWinParser::GetActualColor}\label{wxhtmlwinparsergetactualcolor} \constfunc{const wxColour\&}{GetActualColor}{\void} -Returns actual text color. +Returns actual text colour. \membersection{wxHtmlWinParser::GetAlign}\label{wxhtmlwinparsergetalign} @@ -83,25 +80,25 @@ Returns default horizontal alignment. \constfunc{int}{GetCharHeight}{\void} -Returns (average) char height in standard font. It's used as DC-independent metrics. +Returns (average) char height in standard font. It is used as DC-independent metrics. -{\bf Note:} This function doesn't return {\it actual} height. If you want to +{\bf Note:} This function doesn't return the {\it actual} height. If you want to know the height of the current font, call {\tt GetDC -> GetCharHeight()}. \membersection{wxHtmlWinParser::GetCharWidth}\label{wxhtmlwinparsergetcharwidth} \constfunc{int}{GetCharWidth}{\void} -Returns average char width in standard font. It's used as DC-independent metrics. +Returns average char width in standard font. It is used as DC-independent metrics. -{\bf Note:} This function doesn't return {\it actual} width. If you want to +{\bf Note:} This function doesn't return the {\it actual} width. If you want to know the height of the current font, call {\tt GetDC -> GetCharWidth()} \membersection{wxHtmlWinParser::GetContainer}\label{wxhtmlwinparsergetcontainer} \constfunc{wxHtmlContainerCell*}{GetContainer}{\void} -Returns pointer to the currectly opened container (see \helpref{Overview}{cells}). +Returns pointer to the currently opened container (see \helpref{Overview}{cells}). Common use: \begin{verbatim} @@ -114,24 +111,37 @@ m_WParser -> GetContainer() -> InsertCell(new ...); Returns pointer to the DC used during parsing. +\membersection{wxHtmlWinParser::GetEncodingConverter}\label{wxhtmlwinparsergetencodingconverter} + +\constfunc{wxEncodingConverter *}{GetEncodingConverter}{\void} + +Returns \helpref{wxEncodingConverter}{wxencodingconverter} class used +to do conversion between \helpref{input encoding}{wxhtmlwinparsergetinputencoding} +and \helpref{output encoding}{wxhtmlwinparsergetoutputencoding}. + \membersection{wxHtmlWinParser::GetFontBold}\label{wxhtmlwinparsergetfontbold} \constfunc{int}{GetFontBold}{\void} -Returns TRUE if actual font is bold, FALSE otherwise. +Returns true if actual font is bold, false otherwise. + +\membersection{wxHtmlWinParser::GetFontFace}\label{wxhtmlwinparsergetfontface} + +\constfunc{wxString}{GetFontFace}{\void} + +Returns actual font face name. \membersection{wxHtmlWinParser::GetFontFixed}\label{wxhtmlwinparsergetfontfixed} \constfunc{int}{GetFontFixed}{\void} -Returns TRUE if actual font is fixed face, FALSE otherwise. +Returns true if actual font is fixed face, false otherwise. \membersection{wxHtmlWinParser::GetFontItalic}\label{wxhtmlwinparsergetfontitalic} \constfunc{int}{GetFontItalic}{\void} -Returns TRUE if actual font is italic, FALSE otherwise. - +Returns true if actual font is italic, false otherwise. \membersection{wxHtmlWinParser::GetFontSize}\label{wxhtmlwinparsergetfontsize} @@ -143,89 +153,107 @@ Returns actual font size (HTML size varies from -2 to +4) \constfunc{int}{GetFontUnderlined}{\void} -Returns TRUE if actual font is underlined, FALSE otherwise. +Returns true if actual font is underlined, false otherwise. + +\membersection{wxHtmlWinParser::GetInputEncoding}\label{wxhtmlwinparsergetinputencoding} + +\constfunc{wxFontEncoding}{GetInputEncoding}{\void} + +Returns input encoding. \membersection{wxHtmlWinParser::GetLink}\label{wxhtmlwinparsergetlink} \constfunc{const wxHtmlLinkInfo\&}{GetLink}{\void} -Returns actual hypertext link. (This value has non-empty +Returns actual hypertext link. (This value has a non-empty \helpref{Href}{wxhtmllinkinfogethref} string if the parser is between {\tt } and {\tt } tags, wxEmptyString otherwise.) - \membersection{wxHtmlWinParser::GetLinkColor}\label{wxhtmlwinparsergetlinkcolor} \constfunc{const wxColour\&}{GetLinkColor}{\void} -Returns color of hypertext link text. +Returns the colour of hypertext link text. + +\membersection{wxHtmlWinParser::GetOutputEncoding}\label{wxhtmlwinparsergetoutputencoding} + +\constfunc{wxFontEncoding}{GetOutputEncoding}{\void} + +Returns output encoding, i.e. closest match to document's input encoding +that is supported by operating system. \membersection{wxHtmlWinParser::GetWindow}\label{wxhtmlwinparsergetwindow} -\func{wxWindow*}{GetWindow}{\void} +\func{wxHtmlWindow*}{GetWindow}{\void} Returns associated window (wxHtmlWindow). This may be NULL! (You should always test if it is non-NULL. For example {\tt TITLE} handler sets window title only if some window is associated, otherwise it does nothing) - \membersection{wxHtmlWinParser::OpenContainer}\label{wxhtmlwinparseropencontainer} \func{wxHtmlContainerCell*}{OpenContainer}{\void} Opens new container and returns pointer to it (see \helpref{Overview}{cells}). -% \membersection{wxHtmlWinParser::SetActualColor}\label{wxhtmlwinparsersetactualcolor} \func{void}{SetActualColor}{\param{const wxColour\& }{clr}} -Sets actual text color. Note: this DOESN'T change the color! +Sets actual text colour. Note: this DOESN'T change the colour! You must create \helpref{wxHtmlColourCell}{wxhtmlcolourcell} yourself. \membersection{wxHtmlWinParser::SetAlign}\label{wxhtmlwinparsersetalign} \func{void}{SetAlign}{\param{int }{a}} -Sets default horizontal alignment (see +Sets default horizontal alignment (see \helpref{wxHtmlContainerCell::SetAlignHor}{wxhtmlcontainercellsetalignhor}.) Alignment of newly opened container is set to this value. -%\membersection{wxHtmlWinParser::SetContainer}\label{wxhtmlwinparsersetcontainer} -% -%\func{wxHtmlContainerCell*}{SetContainer}{\param{wxHtmlContainerCell *}{c}} -% -%Allows you to directly set opened container. This is not recommended - you should use OpenContainer -%whereever possible. -% +\membersection{wxHtmlWinParser::SetContainer}\label{wxhtmlwinparsersetcontainer} + +\func{wxHtmlContainerCell*}{SetContainer}{\param{wxHtmlContainerCell *}{c}} + +Allows you to directly set opened container. This is not recommended - you should use OpenContainer +wherever possible. \membersection{wxHtmlWinParser::SetDC}\label{wxhtmlwinparsersetdc} -\func{virtual void}{SetDC}{\param{wxDC }{*dc}, \param{double }{pixel_scale = 1.0}} +\func{virtual void}{SetDC}{\param{wxDC }{*dc}, \param{double }{pixel\_scale = 1.0}} -Sets the DC. This must be called before \helpref{Parse}{wxhtmlparserparse}! {\it pixel_scale} -can be used when rendering to high-resolution DCs (e.g. printer) to adjust size of pixel metrics. -(Many dimensions in HTML are given in pixels - e.g. image sizes. 300x300 image would be only one -inch wide on typical printer. With pixel_scale = 3.0 it would be 3 inches.) +Sets the DC. This must be called before \helpref{Parse}{wxhtmlparserparse}! +{\it pixel\_scale} can be used when rendering to high-resolution +DCs (e.g. printer) to adjust size of pixel metrics. (Many dimensions in +HTML are given in pixels -- e.g. image sizes. 300x300 image would be only one +inch wide on typical printer. With pixel\_scale = 3.0 it would be 3 inches.) \membersection{wxHtmlWinParser::SetFontBold}\label{wxhtmlwinparsersetfontbold} \func{void}{SetFontBold}{\param{int }{x}} -Sets bold flag of actualfont. {\it x} is either TRUE of FALSE. +Sets bold flag of actualfont. {\it x} is either true of false. + +\membersection{wxHtmlWinParser::SetFontFace}\label{wxhtmlwinparsersetfontface} + +\func{void}{SetFontFace}{\param{const wxString\& }{face}} + +Sets current font face to {\it face}. This affects either fixed size +font or proportional, depending on context (whether the parser is +inside {\tt } tag or not). \membersection{wxHtmlWinParser::SetFontFixed}\label{wxhtmlwinparsersetfontfixed} \func{void}{SetFontFixed}{\param{int }{x}} -Sets fixed face flag of actualfont. {\it x} is either TRUE of FALSE. +Sets fixed face flag of actualfont. {\it x} is either true of false. \membersection{wxHtmlWinParser::SetFontItalic}\label{wxhtmlwinparsersetfontitalic} \func{void}{SetFontItalic}{\param{int }{x}} -Sets italic flag of actualfont. {\it x} is either TRUE of FALSE. +Sets italic flag of actualfont. {\it x} is either true of false. \membersection{wxHtmlWinParser::SetFontSize}\label{wxhtmlwinparsersetfontsize} @@ -237,13 +265,22 @@ Sets actual font size (HTML size varies from 1 to 7) \func{void}{SetFontUnderlined}{\param{int }{x}} -Sets underlined flag of actualfont. {\it x} is either TRUE of FALSE. +Sets underlined flag of actualfont. {\it x} is either true of false. \membersection{wxHtmlWinParser::SetFonts}\label{wxhtmlwinparsersetfonts} -\func{void}{SetFonts}{\param{wxString }{normal\_face}, \param{wxString }{fixed\_face}, \param{const int }{*sizes}} +\func{void}{SetFonts}{\param{const wxString\& }{normal\_face}, \param{const wxString\& }{fixed\_face}, \param{const int }{*sizes = NULL}} + +Sets fonts. See \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} for +detailed description. -Sets fonts. This method is identical to \helpref{wxHtmlWindow::SetFonts}{wxhtmlwindowsetfonts} +\membersection{wxHtmlWinParser::SetInputEncoding}\label{wxhtmlwinparsersetinputencoding} + +\func{void}{SetInputEncoding}{\param{wxFontEncoding }{enc}} + +Sets input encoding. The parser uses this information to build conversion +tables from document's encoding to some encoding supported by operating +system. \membersection{wxHtmlWinParser::SetLink}\label{wxhtmlwinparsersetlink} @@ -257,6 +294,5 @@ to wxEmptyString. \func{void}{SetLinkColor}{\param{const wxColour\& }{clr}} -Sets color of hypertext link. - +Sets colour of hypertext link.