This is the base class for file handlers, for loading and/or saving content associated with a RichTextBuffer.
RichTextFileHandler.new(String name = '', String ext = '',
Integer type = 0)
Constructor.
Boolean can_handle(String filename)
Override this function and return if this handler can we handle filename. By default, this function checks the extension.
Boolean can_load()
Override and return if this handler can load content.
Boolean can_save()
Override and return if this handler can save content.
Boolean do_load_file(RichTextBuffer buffer,
InputStream stream)
Override to load content from stream into buffer.
Boolean do_save_file(RichTextBuffer buffer,
OutputStream stream)
Override to save content to stream from buffer.
String get_encoding()
Returns the encoding associated with the handler (if any).
String get_extension()
Returns the extension associated with the handler.
Integer get_flags()
Returns flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler.
String get_name()
Returns the name of the handler.
Integer get_type()
Returns the type of the handler.
Boolean is_visible()
Returns if this handler should be visible to the user.
Boolean load_file(RichTextBuffer buffer,
InputStream stream)
Boolean load_file(RichTextBuffer buffer,
String filename)
Loads content from a stream or file. Not all handlers will implement file loading.
Boolean save_file(RichTextBuffer buffer,
OutputStream stream)
Boolean save_file(RichTextBuffer buffer,
String filename)
Saves content to a stream or file. Not all handlers will implement file saving.
set_encoding(String encoding)
Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen.
set_extension(String ext)
Sets the default extension to recognise.
set_flags(Integer flags)
Sets flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler.
You call this function directly if you are using a file handler explicitly (without going through the text control or buffer LoadFile/SaveFile API). Or, you can call the control or buffer’s SetHandlerFlags function to set the flags that will be used for subsequent load and save operations.
set_name(String name)
Sets the name of the handler.
set_type(Integer type)
Sets the handler type.
set_visible(Boolean visible)
Sets whether the handler should be visible to the user (via the application’s load and save dialogs).
[This page automatically generated from the Textile source at Wed Sep 09 02:21:22 +0100 2009]