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