]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/richtextfilehandler.tex
removed Insert() methods which already exist in the base wxControlWithItems class
[wxWidgets.git] / docs / latex / wx / richtextfilehandler.tex
1 \section{\class{wxRichTextFileHandler}}\label{wxrichtextfilehandler}
2
3 This is the base class for file handlers, for loading and/or saving content
4 associated with a \helpref{wxRichTextBuffer}{wxrichtextbuffer}.
5
6 \wxheading{Derived from}
7
8 \helpref{wxObject}{wxobject}
9
10 \wxheading{Include files}
11
12 <wx/richtext/richtextbuffer.h>
13
14 \wxheading{Data structures}
15
16 \latexignore{\rtfignore{\wxheading{Members}}}
17
18 \membersection{wxRichTextFileHandler::wxRichTextFileHandler}\label{wxrichtextfilehandlerwxrichtextfilehandler}
19
20 \func{}{wxRichTextFileHandler}{\param{const wxString\& }{name = wxEmptyString}, \param{const wxString\& }{ext = wxEmptyString}, \param{int }{type = 0}}
21
22 Constructor.
23
24 \membersection{wxRichTextFileHandler::CanHandle}\label{wxrichtextfilehandlercanhandle}
25
26 \constfunc{bool}{CanHandle}{\param{const wxString\& }{filename}}
27
28 Override this function and return \true if this handler can we handle {\it filename}. By default,
29 this function checks the extension.
30
31 \membersection{wxRichTextFileHandler::CanLoad}\label{wxrichtextfilehandlercanload}
32
33 \constfunc{bool}{CanLoad}{\void}
34
35 Override and return \true if this handler can load content.
36
37 \membersection{wxRichTextFileHandler::CanSave}\label{wxrichtextfilehandlercansave}
38
39 \constfunc{bool}{CanSave}{\void}
40
41 Override and return \true if this handler can save content.
42
43 \membersection{wxRichTextFileHandler::DoLoadFile}\label{wxrichtextfilehandlerdoloadfile}
44
45 \func{bool}{DoLoadFile}{\param{wxRichTextBuffer* }{buffer}, \param{wxInputStream\& }{stream}}
46
47 Override to load content from {\it stream} into {\it buffer}.
48
49 \membersection{wxRichTextFileHandler::DoSaveFile}\label{wxrichtextfilehandlerdosavefile}
50
51 \func{bool}{DoSaveFile}{\param{wxRichTextBuffer* }{buffer}, \param{wxOutputStream\& }{stream}}
52
53 Override to save content to {\it stream} from {\it buffer}.
54
55 \membersection{wxRichTextFileHandler::GetEncoding}\label{wxrichtextfilehandlergetencoding}
56
57 \constfunc{const wxString\&}{GetEncoding}{\void}
58
59 Returns the encoding associated with the handler (if any).
60
61 \membersection{wxRichTextFileHandler::GetExtension}\label{wxrichtextfilehandlergetextension}
62
63 \constfunc{wxString}{GetExtension}{\void}
64
65 Returns the extension associated with the handler.
66
67 \membersection{wxRichTextFileHandler::GetFlags}\label{wxrichtextfilehandlergetflags}
68
69 \constfunc{int}{GetFlags}{\void}
70
71 Returns flags that change the behaviour of loading or saving. See the documentation for each
72 handler class to see what flags are relevant for each handler.
73
74 \membersection{wxRichTextFileHandler::GetName}\label{wxrichtextfilehandlergetname}
75
76 \constfunc{wxString}{GetName}{\void}
77
78 Returns the name of the handler.
79
80 \membersection{wxRichTextFileHandler::GetType}\label{wxrichtextfilehandlergettype}
81
82 \constfunc{int}{GetType}{\void}
83
84 Returns the type of the handler.
85
86 \membersection{wxRichTextFileHandler::IsVisible}\label{wxrichtextfilehandlerisvisible}
87
88 \constfunc{bool}{IsVisible}{\void}
89
90 Returns \true if this handler should be visible to the user.
91
92 \membersection{wxRichTextFileHandler::LoadFile}\label{wxrichtextfilehandlerloadfile}
93
94 \func{bool}{LoadFile}{\param{wxRichTextBuffer* }{buffer}, \param{wxInputStream\& }{stream}}
95
96 \func{bool}{LoadFile}{\param{wxRichTextBuffer* }{buffer}, \param{const wxString\& }{filename}}
97
98 Loads content from a stream or file. Not all handlers will implement file loading.
99
100 \membersection{wxRichTextFileHandler::SaveFile}\label{wxrichtextfilehandlersavefile}
101
102 \func{bool}{SaveFile}{\param{wxRichTextBuffer* }{buffer}, \param{wxOutputStream\& }{stream}}
103
104 \func{bool}{SaveFile}{\param{wxRichTextBuffer* }{buffer}, \param{const wxString\& }{filename}}
105
106 Saves content to a stream or file. Not all handlers will implement file saving.
107
108 \membersection{wxRichTextFileHandler::SetEncoding}\label{wxrichtextfilehandlersetencoding}
109
110 \func{void}{SetEncoding}{\param{const wxString\& }{encoding}}
111
112 Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen.
113
114 \membersection{wxRichTextFileHandler::SetExtension}\label{wxrichtextfilehandlersetextension}
115
116 \func{void}{SetExtension}{\param{const wxString\& }{ext}}
117
118 Sets the default extension to recognise.
119
120 \membersection{wxRichTextFileHandler::SetFlags}\label{wxrichtextfilehandlersetflags}
121
122 \func{void}{SetFlags}{\param{int }{flags}}
123
124 Sets flags that change the behaviour of loading or saving. See the documentation for each
125 handler class to see what flags are relevant for each handler.
126
127 You call this function directly if you are using a file handler explicitly (without
128 going through the text control or buffer LoadFile/SaveFile API). Or, you can
129 call the control or buffer's SetHandlerFlags function to set the flags that will
130 be used for subsequent load and save operations.
131
132 \membersection{wxRichTextFileHandler::SetName}\label{wxrichtextfilehandlersetname}
133
134 \func{void}{SetName}{\param{const wxString\& }{name}}
135
136 Sets the name of the handler.
137
138 \membersection{wxRichTextFileHandler::SetType}\label{wxrichtextfilehandlersettype}
139
140 \func{void}{SetType}{\param{int }{type}}
141
142 Sets the handler type.
143
144 \membersection{wxRichTextFileHandler::SetVisible}\label{wxrichtextfilehandlersetvisible}
145
146 \func{void}{SetVisible}{\param{bool }{visible}}
147
148 Sets whether the handler should be visible to the user (via the application's load and save
149 dialogs).
150