1 \section{\class{wxRichTextFileHandler
}}\label{wxrichtextfilehandler
}
3 This is the base class for file handlers, for loading and/or saving content
4 associated with a
\helpref{wxRichTextBuffer
}{wxrichtextbuffer
}.
6 \wxheading{Derived from
}
8 \helpref{wxObject
}{wxobject
}
10 \wxheading{Include files
}
12 <wx/richtext/richtextbuffer.h>
14 \wxheading{Data structures
}
16 \latexignore{\rtfignore{\wxheading{Members
}}}
18 \membersection{wxRichTextFileHandler::wxRichTextFileHandler
}\label{wxrichtextfilehandlerwxrichtextfilehandler
}
20 \func{}{wxRichTextFileHandler
}{\param{const wxString\&
}{name = wxEmptyString
},
\param{const wxString\&
}{ext = wxEmptyString
},
\param{int
}{type =
0}}
24 \membersection{wxRichTextFileHandler::CanHandle
}\label{wxrichtextfilehandlercanhandle
}
26 \constfunc{bool
}{CanHandle
}{\param{const wxString\&
}{filename
}}
28 Override this function and return
\true if this handler can we handle
{\it filename
}. By default,
29 this function checks the extension.
31 \membersection{wxRichTextFileHandler::CanLoad
}\label{wxrichtextfilehandlercanload
}
33 \constfunc{bool
}{CanLoad
}{\void}
35 Override and return
\true if this handler can load content.
37 \membersection{wxRichTextFileHandler::CanSave
}\label{wxrichtextfilehandlercansave
}
39 \constfunc{bool
}{CanSave
}{\void}
41 Override and return
\true if this handler can save content.
43 \membersection{wxRichTextFileHandler::DoLoadFile
}\label{wxrichtextfilehandlerdoloadfile
}
45 \func{bool
}{DoLoadFile
}{\param{wxRichTextBuffer*
}{buffer
},
\param{wxInputStream\&
}{stream
}}
47 Override to load content from
{\it stream
} into
{\it buffer
}.
49 \membersection{wxRichTextFileHandler::DoSaveFile
}\label{wxrichtextfilehandlerdosavefile
}
51 \func{bool
}{DoSaveFile
}{\param{wxRichTextBuffer*
}{buffer
},
\param{wxOutputStream\&
}{stream
}}
53 Override to save content to
{\it stream
} from
{\it buffer
}.
55 \membersection{wxRichTextFileHandler::GetEncoding
}\label{wxrichtextfilehandlergetencoding
}
57 \constfunc{const wxString\&
}{GetEncoding
}{\void}
59 Returns the encoding associated with the handler (if any).
61 \membersection{wxRichTextFileHandler::GetExtension
}\label{wxrichtextfilehandlergetextension
}
63 \constfunc{wxString
}{GetExtension
}{\void}
65 Returns the extension associated with the handler.
67 \membersection{wxRichTextFileHandler::GetFlags
}\label{wxrichtextfilehandlergetflags
}
69 \constfunc{int
}{GetFlags
}{\void}
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.
74 \membersection{wxRichTextFileHandler::GetName
}\label{wxrichtextfilehandlergetname
}
76 \constfunc{wxString
}{GetName
}{\void}
78 Returns the name of the handler.
80 \membersection{wxRichTextFileHandler::GetType
}\label{wxrichtextfilehandlergettype
}
82 \constfunc{int
}{GetType
}{\void}
84 Returns the type of the handler.
86 \membersection{wxRichTextFileHandler::IsVisible
}\label{wxrichtextfilehandlerisvisible
}
88 \constfunc{bool
}{IsVisible
}{\void}
90 Returns
\true if this handler should be visible to the user.
92 \membersection{wxRichTextFileHandler::LoadFile
}\label{wxrichtextfilehandlerloadfile
}
94 \func{bool
}{LoadFile
}{\param{wxRichTextBuffer*
}{buffer
},
\param{wxInputStream\&
}{stream
}}
96 \func{bool
}{LoadFile
}{\param{wxRichTextBuffer*
}{buffer
},
\param{const wxString\&
}{filename
}}
98 Loads content from a stream or file. Not all handlers will implement file loading.
100 \membersection{wxRichTextFileHandler::SaveFile
}\label{wxrichtextfilehandlersavefile
}
102 \func{bool
}{SaveFile
}{\param{wxRichTextBuffer*
}{buffer
},
\param{wxOutputStream\&
}{stream
}}
104 \func{bool
}{SaveFile
}{\param{wxRichTextBuffer*
}{buffer
},
\param{const wxString\&
}{filename
}}
106 Saves content to a stream or file. Not all handlers will implement file saving.
108 \membersection{wxRichTextFileHandler::SetEncoding
}\label{wxrichtextfilehandlersetencoding
}
110 \func{void
}{SetEncoding
}{\param{const wxString\&
}{encoding
}}
112 Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen.
114 \membersection{wxRichTextFileHandler::SetExtension
}\label{wxrichtextfilehandlersetextension
}
116 \func{void
}{SetExtension
}{\param{const wxString\&
}{ext
}}
118 Sets the default extension to recognise.
120 \membersection{wxRichTextFileHandler::SetFlags
}\label{wxrichtextfilehandlersetflags
}
122 \func{void
}{SetFlags
}{\param{int
}{flags
}}
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.
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.
132 \membersection{wxRichTextFileHandler::SetName
}\label{wxrichtextfilehandlersetname
}
134 \func{void
}{SetName
}{\param{const wxString\&
}{name
}}
136 Sets the name of the handler.
138 \membersection{wxRichTextFileHandler::SetType
}\label{wxrichtextfilehandlersettype
}
140 \func{void
}{SetType
}{\param{int
}{type
}}
142 Sets the handler type.
144 \membersection{wxRichTextFileHandler::SetVisible
}\label{wxrichtextfilehandlersetvisible
}
146 \func{void
}{SetVisible
}{\param{bool
}{visible
}}
148 Sets whether the handler should be visible to the user (via the application's load and save