gedit-file-chooser-dialog.h 5.06 KB
Newer Older
Paolo Borelli's avatar
Paolo Borelli committed
1 2 3 4
/*
 * gedit-file-chooser-dialog.h
 * This file is part of gedit
 *
5
 * Copyright (C) 2014 - Jesse van den Kieboom
Paolo Borelli's avatar
Paolo Borelli committed
6 7 8 9 10 11 12 13 14 15 16 17
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Paolo Borelli's avatar
Paolo Borelli committed
19
 */
20

21 22
#ifndef GEDIT_FILE_CHOOSER_DIALOG_H
#define GEDIT_FILE_CHOOSER_DIALOG_H
Paolo Borelli's avatar
Paolo Borelli committed
23

24
#include <gtk/gtk.h>
25
#include <gtksourceview/gtksource.h>
Paolo Borelli's avatar
Paolo Borelli committed
26 27 28

G_BEGIN_DECLS

29
#define GEDIT_TYPE_FILE_CHOOSER_DIALOG (gedit_file_chooser_dialog_get_type ())
Paolo Borelli's avatar
Paolo Borelli committed
30

31
G_DECLARE_INTERFACE (GeditFileChooserDialog, gedit_file_chooser_dialog, GEDIT, FILE_CHOOSER_DIALOG, GObject)
Paolo Borelli's avatar
Paolo Borelli committed
32

33
struct _GeditFileChooserDialogInterface
Paolo Borelli's avatar
Paolo Borelli committed
34
{
35
	GTypeInterface g_iface;
Paolo Borelli's avatar
Paolo Borelli committed
36

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
	/* Virtual public methods */
	void	(*set_encoding)		(GeditFileChooserDialog  *dialog,
					 const GtkSourceEncoding *encoding);

	const GtkSourceEncoding *
		(*get_encoding)		(GeditFileChooserDialog *dialog);

	void	(*set_newline_type)	(GeditFileChooserDialog  *dialog,
					 GtkSourceNewlineType     newline_type);

	GtkSourceNewlineType
		(*get_newline_type)	(GeditFileChooserDialog *dialog);

	void	(*set_current_folder)	(GeditFileChooserDialog *dialog,
					 GFile                  *folder);

	void	(*set_current_name)	(GeditFileChooserDialog *dialog,
					 const gchar            *name);

	void	(*set_file)		(GeditFileChooserDialog *dialog,
					 GFile                  *file);

	GFile *	(*get_file)		(GeditFileChooserDialog *dialog);

	GSList *(*get_files)		(GeditFileChooserDialog *dialog);

	void	(*set_do_overwrite_confirmation)
					(GeditFileChooserDialog *dialog,
					 gboolean                overwrite_confirmation);

	void	(*show)			(GeditFileChooserDialog *dialog);
68
	void	(*hide)			(GeditFileChooserDialog *dialog);
69 70 71 72 73

	void    (*destroy)		(GeditFileChooserDialog *dialog);

	void	(*set_modal)		(GeditFileChooserDialog *dialog,
					 gboolean                is_modal);
Paolo Borelli's avatar
Paolo Borelli committed
74

75 76
	GtkWindow *
		(*get_window)		(GeditFileChooserDialog *dialog);
77 78 79 80

	void	(*add_pattern_filter)	(GeditFileChooserDialog *dilaog,
					 const gchar            *name,
					 const gchar            *pattern);
Paolo Borelli's avatar
Paolo Borelli committed
81 82
};

83 84
typedef enum
{
85 86 87 88 89
	GEDIT_FILE_CHOOSER_SAVE                   = 1 << 0,
	GEDIT_FILE_CHOOSER_OPEN                   = 1 << 1,
	GEDIT_FILE_CHOOSER_ENABLE_ENCODING        = 1 << 2,
	GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING     = 1 << 3,
	GEDIT_FILE_CHOOSER_ENABLE_DEFAULT_FILTERS = 1 << 4
90
} GeditFileChooserFlags;
Paolo Borelli's avatar
Paolo Borelli committed
91

92 93
GeditFileChooserDialog *
		gedit_file_chooser_dialog_create		(const gchar              *title,
Garrett Regier's avatar
Garrett Regier committed
94
								 GtkWindow                *parent,
95
								 GeditFileChooserFlags     flags,
96 97 98 99 100
								 const GtkSourceEncoding  *encoding,
								 const gchar              *cancel_label,
								 GtkResponseType           cancel_response,
								 const gchar              *accept_label,
								 GtkResponseType           accept_response);
101 102

void		 gedit_file_chooser_dialog_destroy		(GeditFileChooserDialog   *dialog);
103

Garrett Regier's avatar
Garrett Regier committed
104
void		 gedit_file_chooser_dialog_set_encoding		(GeditFileChooserDialog   *dialog,
105
								 const GtkSourceEncoding  *encoding);
106

107 108
const GtkSourceEncoding *
		 gedit_file_chooser_dialog_get_encoding		(GeditFileChooserDialog   *dialog);
109

Garrett Regier's avatar
Garrett Regier committed
110
void		 gedit_file_chooser_dialog_set_newline_type	(GeditFileChooserDialog   *dialog,
111
								 GtkSourceNewlineType      newline_type);
112

113
GtkSourceNewlineType
Garrett Regier's avatar
Garrett Regier committed
114
		 gedit_file_chooser_dialog_get_newline_type	(GeditFileChooserDialog   *dialog);
Paolo Borelli's avatar
Paolo Borelli committed
115

116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
void		 gedit_file_chooser_dialog_set_current_folder	(GeditFileChooserDialog   *dialog,
								 GFile                    *folder);

void		 gedit_file_chooser_dialog_set_current_name	(GeditFileChooserDialog   *dialog,
								 const gchar              *name);

void		 gedit_file_chooser_dialog_set_file		(GeditFileChooserDialog   *dialog,
								 GFile                    *file);

GFile		*gedit_file_chooser_dialog_get_file		(GeditFileChooserDialog   *dialog);

GSList		*gedit_file_chooser_dialog_get_files		(GeditFileChooserDialog   *dialog);

void		 gedit_file_chooser_dialog_set_do_overwrite_confirmation (
								 GeditFileChooserDialog   *dialog,
								 gboolean                  overwrite_confirmation);

void		 gedit_file_chooser_dialog_show			(GeditFileChooserDialog   *dialog);
134
void		 gedit_file_chooser_dialog_hide			(GeditFileChooserDialog   *dialog);
135 136 137 138 139 140

void		 gedit_file_chooser_dialog_set_modal		(GeditFileChooserDialog   *dialog,
								 gboolean                  is_modal);

GtkWindow	*gedit_file_chooser_dialog_get_window		(GeditFileChooserDialog   *dialog);

141
void		 gedit_file_chooser_dialog_add_pattern_filter	(GeditFileChooserDialog   *dialog,
142 143
								 const gchar              *name,
								 const gchar              *pattern);
144

Paolo Borelli's avatar
Paolo Borelli committed
145 146
G_END_DECLS

147
#endif /* GEDIT_FILE_CHOOSER_DIALOG_H */
Garrett Regier's avatar
Garrett Regier committed
148

149
/* ex:set ts=8 noet: */