1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) Johannes Schmid 2008 <jhs@gnome.org>
6 * anjuta-trunk is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * anjuta-trunk is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _SOURCEVIEW_IO_H_
21 #define _SOURCEVIEW_IO_H_
23 #include <glib-object.h>
25 #include <libanjuta/anjuta-encodings.h>
26 #include "sourceview.h"
30 #define SOURCEVIEW_TYPE_IO (sourceview_io_get_type ())
31 #define SOURCEVIEW_IO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOURCEVIEW_TYPE_IO, SourceviewIO))
32 #define SOURCEVIEW_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOURCEVIEW_TYPE_IO, SourceviewIOClass))
33 #define SOURCEVIEW_IS_IO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOURCEVIEW_TYPE_IO))
34 #define SOURCEVIEW_IS_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOURCEVIEW_TYPE_IO))
35 #define SOURCEVIEW_IO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOURCEVIEW_TYPE_IO, SourceviewIOClass))
37 typedef struct _SourceviewIOClass SourceviewIOClass
;
38 typedef struct _SourceviewIO SourceviewIO
;
40 struct _SourceviewIOClass
42 GObjectClass parent_class
;
45 void(* changed
) (SourceviewIO
*self
);
46 void(* save_finished
) (SourceviewIO
*self
);
47 void(* open_finished
) (SourceviewIO
*self
);
48 void(* open_failed
) (SourceviewIO
*self
, GError
* error
);
49 void(* save_failed
) (SourceviewIO
*self
, GError
* error
);
50 void(* deleted
) (SourceviewIO
*self
);
55 GObject parent_instance
;
63 GFileMonitor
* monitor
;
67 const AnjutaEncoding
* last_encoding
;
70 GType
sourceview_io_get_type (void) G_GNUC_CONST
;
71 void sourceview_io_save (SourceviewIO
* sio
);
72 void sourceview_io_save_as (SourceviewIO
* sio
, GFile
* file
);
73 void sourceview_io_open (SourceviewIO
* sio
, GFile
* file
);
74 void sourceview_io_cancel (SourceviewIO
* sio
);
75 GFile
* sourceview_io_get_file (SourceviewIO
* sio
);
76 const gchar
* sourceview_io_get_filename (SourceviewIO
* sio
);
77 void sourceview_io_set_filename (SourceviewIO
* sio
, const gchar
* filename
);
78 gchar
* sourceview_io_get_mime_type (SourceviewIO
* sio
);
79 gboolean
sourceview_io_get_read_only (SourceviewIO
* sio
);
80 SourceviewIO
* sourceview_io_new (Sourceview
* sv
);
84 #endif /* _SOURCEVIEW_IO_H_ */