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#can_handle
- RichTextFileHandler#can_load
- RichTextFileHandler#can_save
- RichTextFileHandler#do_load_file
- RichTextFileHandler#do_save_file
- RichTextFileHandler#get_encoding
- RichTextFileHandler#get_extension
- RichTextFileHandler#get_flags
- RichTextFileHandler#get_name
- RichTextFileHandler#get_type
- RichTextFileHandler#is_visible
- RichTextFileHandler#load_file
- RichTextFileHandler#save_file
- RichTextFileHandler#set_encoding
- RichTextFileHandler#set_extension
- RichTextFileHandler#set_flags
- RichTextFileHandler#set_name
- RichTextFileHandler#set_type
- RichTextFileHandler#set_visible

### RichTextFileHandler.new

RichTextFileHandler.new(%(arg-type)String% name = ‘’, String ext = ’’, Integer type = 0)

Constructor.

### RichTextFileHandler#can_handle

Boolean can_handle(%(arg-type)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(%(arg-type)RichTextBuffer% buffer, InputStream stream)

Override to load content from stream into buffer.

### RichTextFileHandler#do_save_file

Boolean do_save_file(%(arg-type)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(%(arg-type)RichTextBuffer% buffer, InputStream stream) Boolean load_file(%(arg-type)RichTextBuffer% buffer, String filename)

Loads content from a stream or file. Not all handlers will implement file loading.

### RichTextFileHandler#save_file

Boolean save_file(%(arg-type)RichTextBuffer% buffer, OutputStream stream) Boolean save_file(%(arg-type)RichTextBuffer% buffer, String filename)

Saves content to a stream or file. Not all handlers will implement file saving.

### RichTextFileHandler#set_encoding

set_encoding(%(arg-type)String% encoding)

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

### RichTextFileHandler#set_extension

set_extension(%(arg-type)String% ext)

Sets the default extension to recognise.

### RichTextFileHandler#set_flags

set_flags(%(arg-type)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(%(arg-type)String% name)

Sets the name of the handler.

### RichTextFileHandler#set_type

set_type(%(arg-type)Integer% type)

Sets the handler type.

### RichTextFileHandler#set_visible

set_visible(%(arg-type)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 2023-06-09 00:45:30 +0000]