gedit-document.h 4.11 KB
Newer Older
1 2 3 4 5
/*
 * gedit-document.h
 * This file is part of gedit
 *
 * Copyright (C) 1998, 1999 Alex Roberts, Evan Lawrence
6 7
 * Copyright (C) 2000, 2001 Chema Celorio, Paolo Maggi
 * Copyright (C) 2002-2005 Paolo Maggi
8
 * Copyright (C) 2014 Sébastien Wilmet
9 10 11 12 13 14 15 16 17 18 19 20
 *
 * 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
21
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
22
 */
23

24 25
#ifndef GEDIT_DOCUMENT_H
#define GEDIT_DOCUMENT_H
26

27
#include <gtksourceview/gtksource.h>
28

Paolo Borelli's avatar
Paolo Borelli committed
29
G_BEGIN_DECLS
30

31
#define GEDIT_TYPE_DOCUMENT (gedit_document_get_type())
Paolo Borelli's avatar
Paolo Borelli committed
32

33
G_DECLARE_DERIVABLE_TYPE (GeditDocument, gedit_document, GEDIT, DOCUMENT, GtkSourceBuffer)
34

35 36
struct _GeditDocumentClass
{
Paolo Maggi's avatar
Paolo Maggi committed
37
	GtkSourceBufferClass parent_class;
38

39
	/* Signals */
40 41 42 43
	void (* cursor_moved)		(GeditDocument *document);

	void (* load)			(GeditDocument *document);

44
	void (* loaded)			(GeditDocument *document);
45 46 47

	void (* save)			(GeditDocument *document);

48
	void (* saved)  		(GeditDocument *document);
49
};
Paolo Maggi's avatar
Paolo Maggi committed
50

51
GeditDocument   *gedit_document_new				(void);
Paolo Borelli's avatar
Paolo Borelli committed
52

53
GtkSourceFile	*gedit_document_get_file			(GeditDocument       *doc);
54

55
G_DEPRECATED_FOR (gtk_source_file_get_location)
56
GFile		*gedit_document_get_location			(GeditDocument       *doc);
57 58

G_DEPRECATED_FOR (gtk_source_file_set_location)
59 60 61 62 63 64
void		 gedit_document_set_location			(GeditDocument       *doc,
								 GFile               *location);

gchar		*gedit_document_get_uri_for_display		(GeditDocument       *doc);

gchar		*gedit_document_get_short_name_for_display	(GeditDocument       *doc);
Paolo Borelli's avatar
Paolo Borelli committed
65

66
G_DEPRECATED
67 68
void		 gedit_document_set_short_name_for_display	(GeditDocument       *doc,
								 const gchar         *short_name);
Paolo Borelli's avatar
Paolo Borelli committed
69

70
gchar		*gedit_document_get_content_type		(GeditDocument       *doc);
71

72
G_DEPRECATED
73 74
void		 gedit_document_set_content_type		(GeditDocument       *doc,
								 const gchar         *content_type);
75

76
gchar		*gedit_document_get_mime_type			(GeditDocument       *doc);
77

78
G_DEPRECATED_FOR (gtk_source_file_is_readonly)
79
gboolean	 gedit_document_get_readonly			(GeditDocument       *doc);
Paolo Borelli's avatar
Paolo Borelli committed
80

81
gboolean	 gedit_document_is_untouched			(GeditDocument       *doc);
Paolo Borelli's avatar
Paolo Borelli committed
82

83
gboolean	 gedit_document_is_untitled			(GeditDocument       *doc);
Paolo Borelli's avatar
Paolo Borelli committed
84

85
G_DEPRECATED_FOR (gtk_source_file_is_local)
86
gboolean	 gedit_document_is_local			(GeditDocument       *doc);
87

88
G_DEPRECATED
89
gboolean	 gedit_document_get_deleted			(GeditDocument       *doc);
Paolo Borelli's avatar
Paolo Borelli committed
90

91 92
gboolean	 gedit_document_goto_line			(GeditDocument       *doc,
								gint                 line);
Paolo Borelli's avatar
Paolo Borelli committed
93

94 95 96
gboolean	 gedit_document_goto_line_offset		(GeditDocument       *doc,
								 gint                 line,
								 gint                 line_offset);
97

98 99
void 		 gedit_document_set_language			(GeditDocument       *doc,
								 GtkSourceLanguage   *lang);
100
GtkSourceLanguage
101
		*gedit_document_get_language			(GeditDocument       *doc);
Paolo Borelli's avatar
Paolo Borelli committed
102

103
G_DEPRECATED_FOR (gtk_source_file_get_encoding)
104
const GtkSourceEncoding
105
		*gedit_document_get_encoding			(GeditDocument       *doc);
Paolo Borelli's avatar
Paolo Borelli committed
106

107
G_DEPRECATED_FOR (gtk_source_file_get_newline_type)
108
GtkSourceNewlineType
109
		 gedit_document_get_newline_type		(GeditDocument       *doc);
110

111
G_DEPRECATED_FOR (gtk_source_file_get_compression_type)
112
GtkSourceCompressionType
113
		 gedit_document_get_compression_type		(GeditDocument       *doc);
114

115 116
gchar		*gedit_document_get_metadata			(GeditDocument       *doc,
								 const gchar         *key);
117

118 119 120
void		 gedit_document_set_metadata			(GeditDocument       *doc,
								 const gchar         *first_key,
								 ...);
121

122 123
void		 gedit_document_set_search_context		(GeditDocument          *doc,
								 GtkSourceSearchContext *search_context);
124

Sébastien Wilmet's avatar
Sébastien Wilmet committed
125
GtkSourceSearchContext *
126
		 gedit_document_get_search_context		(GeditDocument       *doc);
127

Paolo Borelli's avatar
Paolo Borelli committed
128
G_END_DECLS
129

130
#endif /* GEDIT_DOCUMENT_H */
131
/* ex:set ts=8 noet: */