]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/richtexthtmlhandler.tex
Limit indentation in style listbox, and also show centring
[wxWidgets.git] / docs / latex / wx / richtexthtmlhandler.tex
CommitLineData
5f35b46a
JS
1\section{\class{wxRichTextHTMLHandler}}\label{wxrichtexthtmlhandler}
2
3Handles HTML output (only) for \helpref{wxRichTextCtrl}{wxrichtextctrl} content.
4
1f65137f
JS
5The most flexible way to use this class is to create a temporary object and call
6its functions directly, rather than use \helpref{wxRichTextBuffer::SaveFile}{wxrichtextbuffersavefile} or\rtfsp
7\helpref{wxRichTextCtrl::SaveFile}{wxrichtextctrlsavefile}.
8
9Image handling requires a little extra work from the application, to choose an
10appropriate image format for the target HTML viewer and to clean up the temporary images
11later. If you are planning to load the HTML into a standard web browser, you can
12specify the handler flag wxRICHTEXT\_HANDLER\_SAVE\_IMAGES\_TO\_BASE64 (the default)
13and no extra work is required: the images will be written with the HTML.
14
15However, if you want wxHTML compatibility, you will need to use wxRICHTEXT\_HANDLER\_SAVE\_IMAGES\_TO\_MEMORY
16or wxRICHTEXT\_HANDLER\_SAVE\_IMAGES\_TO\_FILES. In this case, you must either call \helpref{DeleteTemporaryImages}{wxrichtexthtmlhandlerdeletetemporaryimages} before
17the next load operation, or you must store the image
18locations and delete them yourself when appropriate. You can call \helpref{GetTemporaryImageLocations}{wxrichtexthtmlhandlergettemporaryimagelocations} to
19get the array of temporary image names.
20
21\wxheading{Handler flags}
22
23The following flags can be used with this handler, via
24the handler's SetFlags function or the buffer or control's
25SetHandlerFlags function:
26
27\twocolwidtha{7cm}
28\begin{twocollist}\itemsep=0pt
29\twocolitem{\windowstyle{wxRICHTEXT\_HANDLER\_SAVE\_IMAGES\_TO\_MEMORY}}{Images are saved to the memory filesystem: suitable for showing wxHTML windows.}
30\twocolitem{\windowstyle{wxRICHTEXT\_HANDLER\_SAVE\_IMAGES\_TO\_FILES}}{Images are saved to temporary files: suitable for showing in wxHTML windows.}
31\twocolitem{\windowstyle{wxRICHTEXT\_HANDLER\_SAVE\_IMAGES\_TO\_BASE64}}{Images are written with the HTML files in Base 64 format: suitable for showing in web browsers.}
32\end{twocollist}
33
5f35b46a
JS
34\wxheading{Derived from}
35
36\helpref{wxRichTextFileHandler}{wxrichtextfilehandler}
37
38\wxheading{Include files}
39
40<wx/richtext/richtexthtml.h>
41
42\wxheading{Data structures}
43
44\latexignore{\rtfignore{\wxheading{Members}}}
45
46\membersection{wxRichTextHTMLHandler::wxRichTextHTMLHandler}\label{wxrichtexthtmlhandlerwxrichtexthtmlhandler}
47
48\func{}{wxRichTextHTMLHandler}{\param{const wxString\& }{name = wxT("HTML")}, \param{const wxString\& }{ext = wxT("html")}, \param{int }{type = wxRICHTEXT\_TYPE\_HTML}}
49
50Constructor.
51
1f65137f
JS
52\membersection{wxRichTextHTMLHandler::ClearTemporaryImageLocations}\label{wxrichtexthtmlhandlercleartemporaryimagelocations}
53
54\func{void}{ClearTemporaryImageLocations}{\void}
55
56Clears the image locations generated by the last operation.
57
58\membersection{wxRichTextHTMLHandler::DeleteTemporaryImages}\label{wxrichtexthtmlhandlerdeletetemporaryimages}
59
60\func{bool}{DeleteTemporaryImages}{\void}
61
62Deletes the in-memory or temporary files generated by the last operation.
63
64\func{bool}{DeleteTemporaryImages}{\param{int }{flags}, \param{const wxArrayString\& }{imageLocations}}
65
66Delete the in-memory or temporary files generated by the last operation. This is a static
67function that can be used to delete the saved locations from an earlier operation,
68for example after the user has viewed the HTML file.
69
5f35b46a
JS
70\membersection{wxRichTextHTMLHandler::DoSaveFile}\label{wxrichtexthtmlhandlerdosavefile}
71
72\func{bool}{DoSaveFile}{\param{wxRichTextBuffer* }{buffer}, \param{wxOutputStream\& }{stream}}
73
74Saves the buffer content to the HTML stream.
62a268cc 75
1f65137f
JS
76\membersection{wxRichTextHTMLHandler::GetTempDir}\label{wxrichtexthtmlhandlergettempdir}
77
78\constfunc{const wxString\&}{GetTempDir}{\void}
79
80Returns the directory used to store temporary image files.
81
82\membersection{wxRichTextHTMLHandler::GetTemporaryImageLocations}\label{wxrichtexthtmlhandlergettemporaryimagelocations}
83
84\constfunc{const wxArrayString\&}{GetTemporaryImageLocations}{\void}
85
86Returns the image locations for the last operation.
87
88\membersection{wxRichTextHTMLHandler::SetFileCounter}\label{wxrichtexthtmlhandlersetfilecounter}
89
90\func{void}{SetFileCounter}{\param{int }{counter}}
91
92Reset the file counter, in case, for example, the same names are required each time
93
94\membersection{wxRichTextHTMLHandler::SetTempDir}\label{wxrichtexthtmlhandlersettempdir}
95
96\func{void}{SetTempDir}{\param{const wxString\& }{tempDir}}
97
98Sets the directory for storing temporary files. If empty, the system
99temporary directory will be used.
100
101\membersection{wxRichTextHTMLHandler::SetTemporaryImageLocations}\label{wxrichtexthtmlhandlersettemporaryimagelocations}
102
103\func{void}{SetTemporaryImageLocations}{\param{const wxArrayString\& }{locations}}
104
105Sets the list of image locations generated by the last operation.
106