Class: GtkSource::FileSaver
- Inherits:
-
Object
- Object
- GtkSource::FileSaver
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#buffer ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to save.
-
#buffer=(buffer) ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to save.
-
#compression_type ⇒ GtkSource::CompressionType
The compression type.
-
#compression_type=(compression_type) ⇒ GtkSource::CompressionType
The compression type.
-
#encoding ⇒ GtkSource::Encoding
The file's encoding.
-
#encoding=(encoding) ⇒ GtkSource::Encoding
The file's encoding.
-
#file ⇒ GtkSource::File
The Gtk::SourceFile.
-
#file=(file) ⇒ GtkSource::File
The Gtk::SourceFile.
-
#flags ⇒ GtkSource::FileSaverFlags
File saving flags.
-
#flags=(flags) ⇒ GtkSource::FileSaverFlags
File saving flags.
-
#initialize(buffer, file, target_location) ⇒ GtkSource::FileSaver
constructor
Creates a new Gtk::SourceFileSaver object with a target location.
-
#location ⇒ Gio::File
The #GFile where to save the buffer.
-
#location=(location) ⇒ Gio::File
The #GFile where to save the buffer.
-
#newline_type ⇒ GtkSource::NewlineType
The newline type.
-
#newline_type=(newline_type) ⇒ GtkSource::NewlineType
The newline type.
-
#save_async(io_priority, cancellable, progress_callback, progress_callback_data, progress_callback_notify, callback, user_data) ⇒ nil
Saves asynchronously the buffer into the file.
-
#save_finish(result) ⇒ Boolean
Finishes a file saving started with [methodFileSaver.save_async].
Constructor Details
#initialize(buffer, file, target_location) ⇒ GtkSource::FileSaver
Creates a new Gtk::SourceFileSaver object with a target location.
When the file saving is finished successfully, target_location is set to the file's [propertyFile:location] property. If an error occurs, the previous valid location is still available in [classFile].
This constructor is suitable for a "save as" operation, or for saving a new buffer for the first time.
Instance Method Details
#buffer ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to save. The #GtkSourceFileSaver object has a weak reference to the buffer.
#buffer=(buffer) ⇒ GtkSource::Buffer
The Gtk::SourceBuffer to save. The #GtkSourceFileSaver object has a weak reference to the buffer.
#compression_type ⇒ GtkSource::CompressionType
The compression type.
#compression_type=(compression_type) ⇒ GtkSource::CompressionType
The compression type.
#encoding ⇒ GtkSource::Encoding
The file's encoding.
#encoding=(encoding) ⇒ GtkSource::Encoding
The file's encoding.
#file ⇒ GtkSource::File
The Gtk::SourceFile. The #GtkSourceFileSaver object has a weak reference to the file.
#file=(file) ⇒ GtkSource::File
The Gtk::SourceFile. The #GtkSourceFileSaver object has a weak reference to the file.
#flags ⇒ GtkSource::FileSaverFlags
File saving flags.
#flags=(flags) ⇒ GtkSource::FileSaverFlags
File saving flags.
#location ⇒ Gio::File
The #GFile where to save the buffer. By default the location is taken from the Gtk::SourceFile at construction time.
#location=(location) ⇒ Gio::File
The #GFile where to save the buffer. By default the location is taken from the Gtk::SourceFile at construction time.
#newline_type ⇒ GtkSource::NewlineType
The newline type.
#newline_type=(newline_type) ⇒ GtkSource::NewlineType
The newline type.
#save_async(io_priority, cancellable, progress_callback, progress_callback_data, progress_callback_notify, callback, user_data) ⇒ nil
Saves asynchronously the buffer into the file.
See the [ifaceGio.AsyncResult] documentation to know how to use this function.
#save_finish(result) ⇒ Boolean
Finishes a file saving started with [methodFileSaver.save_async].
If the file has been saved successfully, the following [classFile] properties will be updated: the location, the encoding, the newline type and the compression type.
Since the 3.20 version, [methodGtk.TextBuffer.set_modified] is called with false if the file has been saved successfully.