|
Packit |
a7d494 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*- */
|
|
Packit |
a7d494 |
/* gtksourcefilesaver.h
|
|
Packit |
a7d494 |
* This file is part of GtkSourceView
|
|
Packit |
a7d494 |
*
|
|
Packit |
a7d494 |
* Copyright (C) 2005, 2007 - Paolo Maggi
|
|
Packit |
a7d494 |
* Copyrhing (C) 2007 - Steve Frécinaux
|
|
Packit |
a7d494 |
* Copyright (C) 2008 - Jesse van den Kieboom
|
|
Packit |
a7d494 |
* Copyright (C) 2014 - Sébastien Wilmet
|
|
Packit |
a7d494 |
*
|
|
Packit |
a7d494 |
* GtkSourceView is free software; you can redistribute it and/or
|
|
Packit |
a7d494 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
a7d494 |
* License as published by the Free Software Foundation; either
|
|
Packit |
a7d494 |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
a7d494 |
*
|
|
Packit |
a7d494 |
* GtkSourceView is distributed in the hope that it will be useful,
|
|
Packit |
a7d494 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
a7d494 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
a7d494 |
* Lesser General Public License for more details.
|
|
Packit |
a7d494 |
*
|
|
Packit |
a7d494 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
a7d494 |
* License along with this library; if not, write to the Free Software
|
|
Packit |
a7d494 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
a7d494 |
*/
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
#ifndef GTK_SOURCE_FILE_SAVER_H
|
|
Packit |
a7d494 |
#define GTK_SOURCE_FILE_SAVER_H
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
#if !defined (GTK_SOURCE_H_INSIDE) && !defined (GTK_SOURCE_COMPILATION)
|
|
Packit |
a7d494 |
# if defined (__GNUC__)
|
|
Packit |
a7d494 |
# warning "Only <gtksourceview/gtksource.h> can be included directly."
|
|
Packit |
a7d494 |
# elif defined (G_OS_WIN32)
|
|
Packit |
a7d494 |
# pragma message("Only <gtksourceview/gtksource.h> can be included directly.")
|
|
Packit |
a7d494 |
# endif
|
|
Packit |
a7d494 |
#endif
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
#include <gtk/gtk.h>
|
|
Packit |
a7d494 |
#include <gtksourceview/gtksourcetypes.h>
|
|
Packit |
a7d494 |
#include <gtksourceview/gtksourcefile.h>
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
G_BEGIN_DECLS
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
#define GTK_SOURCE_TYPE_FILE_SAVER (gtk_source_file_saver_get_type())
|
|
Packit |
a7d494 |
#define GTK_SOURCE_FILE_SAVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_SOURCE_TYPE_FILE_SAVER, GtkSourceFileSaver))
|
|
Packit |
a7d494 |
#define GTK_SOURCE_FILE_SAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_SOURCE_TYPE_FILE_SAVER, GtkSourceFileSaverClass))
|
|
Packit |
a7d494 |
#define GTK_SOURCE_IS_FILE_SAVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_SOURCE_TYPE_FILE_SAVER))
|
|
Packit |
a7d494 |
#define GTK_SOURCE_IS_FILE_SAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_SOURCE_TYPE_FILE_SAVER))
|
|
Packit |
a7d494 |
#define GTK_SOURCE_FILE_SAVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_SOURCE_TYPE_FILE_SAVER, GtkSourceFileSaverClass))
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
typedef struct _GtkSourceFileSaverClass GtkSourceFileSaverClass;
|
|
Packit |
a7d494 |
typedef struct _GtkSourceFileSaverPrivate GtkSourceFileSaverPrivate;
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
#define GTK_SOURCE_FILE_SAVER_ERROR gtk_source_file_saver_error_quark ()
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
/**
|
|
Packit |
a7d494 |
* GtkSourceFileSaverError:
|
|
Packit |
a7d494 |
* @GTK_SOURCE_FILE_SAVER_ERROR_INVALID_CHARS: The buffer contains invalid
|
|
Packit |
a7d494 |
* characters.
|
|
Packit |
a7d494 |
* @GTK_SOURCE_FILE_SAVER_ERROR_EXTERNALLY_MODIFIED: The file is externally
|
|
Packit |
a7d494 |
* modified.
|
|
Packit |
a7d494 |
*
|
|
Packit |
a7d494 |
* An error code used with the %GTK_SOURCE_FILE_SAVER_ERROR domain.
|
|
Packit |
a7d494 |
* Since: 3.14
|
|
Packit |
a7d494 |
*/
|
|
Packit |
a7d494 |
typedef enum _GtkSourceFileSaverError
|
|
Packit |
a7d494 |
{
|
|
Packit |
a7d494 |
GTK_SOURCE_FILE_SAVER_ERROR_INVALID_CHARS,
|
|
Packit |
a7d494 |
GTK_SOURCE_FILE_SAVER_ERROR_EXTERNALLY_MODIFIED
|
|
Packit |
a7d494 |
} GtkSourceFileSaverError;
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
/**
|
|
Packit |
a7d494 |
* GtkSourceFileSaverFlags:
|
|
Packit |
a7d494 |
* @GTK_SOURCE_FILE_SAVER_FLAGS_NONE: No flags.
|
|
Packit |
a7d494 |
* @GTK_SOURCE_FILE_SAVER_FLAGS_IGNORE_INVALID_CHARS: Ignore invalid characters.
|
|
Packit |
a7d494 |
* @GTK_SOURCE_FILE_SAVER_FLAGS_IGNORE_MODIFICATION_TIME: Save file despite external modifications.
|
|
Packit |
a7d494 |
* @GTK_SOURCE_FILE_SAVER_FLAGS_CREATE_BACKUP: Create a backup before saving the file.
|
|
Packit |
a7d494 |
*
|
|
Packit |
a7d494 |
* Flags to define the behavior of a #GtkSourceFileSaver.
|
|
Packit |
a7d494 |
* Since: 3.14
|
|
Packit |
a7d494 |
*/
|
|
Packit |
a7d494 |
typedef enum _GtkSourceFileSaverFlags
|
|
Packit |
a7d494 |
{
|
|
Packit |
a7d494 |
GTK_SOURCE_FILE_SAVER_FLAGS_NONE = 0,
|
|
Packit |
a7d494 |
GTK_SOURCE_FILE_SAVER_FLAGS_IGNORE_INVALID_CHARS = 1 << 0,
|
|
Packit |
a7d494 |
GTK_SOURCE_FILE_SAVER_FLAGS_IGNORE_MODIFICATION_TIME = 1 << 1,
|
|
Packit |
a7d494 |
GTK_SOURCE_FILE_SAVER_FLAGS_CREATE_BACKUP = 1 << 2
|
|
Packit |
a7d494 |
} GtkSourceFileSaverFlags;
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
struct _GtkSourceFileSaver
|
|
Packit |
a7d494 |
{
|
|
Packit |
a7d494 |
GObject object;
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GtkSourceFileSaverPrivate *priv;
|
|
Packit |
a7d494 |
};
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
struct _GtkSourceFileSaverClass
|
|
Packit |
a7d494 |
{
|
|
Packit |
a7d494 |
GObjectClass parent_class;
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
gpointer padding[10];
|
|
Packit |
a7d494 |
};
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GType gtk_source_file_saver_get_type (void) G_GNUC_CONST;
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GQuark gtk_source_file_saver_error_quark (void);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GtkSourceFileSaver *gtk_source_file_saver_new (GtkSourceBuffer *buffer,
|
|
Packit |
a7d494 |
GtkSourceFile *file);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GtkSourceFileSaver *gtk_source_file_saver_new_with_target (GtkSourceBuffer *buffer,
|
|
Packit |
a7d494 |
GtkSourceFile *file,
|
|
Packit |
a7d494 |
GFile *target_location);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GtkSourceBuffer *gtk_source_file_saver_get_buffer (GtkSourceFileSaver *saver);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GtkSourceFile *gtk_source_file_saver_get_file (GtkSourceFileSaver *saver);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GFile *gtk_source_file_saver_get_location (GtkSourceFileSaver *saver);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
void gtk_source_file_saver_set_encoding (GtkSourceFileSaver *saver,
|
|
Packit |
a7d494 |
const GtkSourceEncoding *encoding);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
const GtkSourceEncoding *gtk_source_file_saver_get_encoding (GtkSourceFileSaver *saver);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
void gtk_source_file_saver_set_newline_type (GtkSourceFileSaver *saver,
|
|
Packit |
a7d494 |
GtkSourceNewlineType newline_type);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GtkSourceNewlineType gtk_source_file_saver_get_newline_type (GtkSourceFileSaver *saver);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
void gtk_source_file_saver_set_compression_type
|
|
Packit |
a7d494 |
(GtkSourceFileSaver *saver,
|
|
Packit |
a7d494 |
GtkSourceCompressionType compression_type);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GtkSourceCompressionType gtk_source_file_saver_get_compression_type
|
|
Packit |
a7d494 |
(GtkSourceFileSaver *saver);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
void gtk_source_file_saver_set_flags (GtkSourceFileSaver *saver,
|
|
Packit |
a7d494 |
GtkSourceFileSaverFlags flags);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
GtkSourceFileSaverFlags gtk_source_file_saver_get_flags (GtkSourceFileSaver *saver);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
void gtk_source_file_saver_save_async (GtkSourceFileSaver *saver,
|
|
Packit |
a7d494 |
gint io_priority,
|
|
Packit |
a7d494 |
GCancellable *cancellable,
|
|
Packit |
a7d494 |
GFileProgressCallback progress_callback,
|
|
Packit |
a7d494 |
gpointer progress_callback_data,
|
|
Packit |
a7d494 |
GDestroyNotify progress_callback_notify,
|
|
Packit |
a7d494 |
GAsyncReadyCallback callback,
|
|
Packit |
a7d494 |
gpointer user_data);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
GTK_SOURCE_AVAILABLE_IN_3_14
|
|
Packit |
a7d494 |
gboolean gtk_source_file_saver_save_finish (GtkSourceFileSaver *saver,
|
|
Packit |
a7d494 |
GAsyncResult *result,
|
|
Packit |
a7d494 |
GError **error);
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
G_END_DECLS
|
|
Packit |
a7d494 |
|
|
Packit |
a7d494 |
#endif /* GTK_SOURCE_FILE_SAVER_H */
|