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