wxRuby Documentation Home

Wx::RichTextFileHandler

This is the base class for file handlers, for loading and/or saving content associated with a RichTextBuffer.

Derived from

Object

Data structures

Methods

RichTextFileHandler.new

RichTextFileHandler.new(String name = '',  String ext = '', 
                        Integer type = 0)

Constructor.

RichTextFileHandler#can_handle

Boolean can_handle(String filename)

Override this function and return if this handler can we handle filename. By default, this function checks the extension.

RichTextFileHandler#can_load

Boolean can_load()

Override and return if this handler can load content.

RichTextFileHandler#can_save

Boolean can_save()

Override and return if this handler can save content.

RichTextFileHandler#do_load_file

Boolean do_load_file(RichTextBuffer buffer, 
                     InputStream stream)

Override to load content from stream into buffer.

RichTextFileHandler#do_save_file

Boolean do_save_file(RichTextBuffer buffer, 
                     OutputStream stream)

Override to save content to stream from buffer.

RichTextFileHandler#get_encoding

String get_encoding()

Returns the encoding associated with the handler (if any).

RichTextFileHandler#get_extension

String get_extension()

Returns the extension associated with the handler.

RichTextFileHandler#get_flags

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.

RichTextFileHandler#get_name

String get_name()

Returns the name of the handler.

RichTextFileHandler#get_type

Integer get_type()

Returns the type of the handler.

RichTextFileHandler#is_visible

Boolean is_visible()

Returns if this handler should be visible to the user.

RichTextFileHandler#load_file

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.

RichTextFileHandler#save_file

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.

RichTextFileHandler#set_encoding

set_encoding(String encoding)

Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen.

RichTextFileHandler#set_extension

set_extension(String ext)

Sets the default extension to recognise.

RichTextFileHandler#set_flags

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.

RichTextFileHandler#set_name

set_name(String name)

Sets the name of the handler.

RichTextFileHandler#set_type

set_type(Integer type)

Sets the handler type.

RichTextFileHandler#set_visible

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]