2 * anjuta-document-loader.h
3 * This file is part of anjuta
5 * Copyright (C) 2005 - Paolo Maggi
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
24 * Modified by the anjuta Team, 2005. See the AUTHORS file for a
25 * list of people on the anjuta Team.
26 * See the ChangeLog files for a list of changes.
31 #ifndef __ANJUTA_DOCUMENT_LOADER_H__
32 #define __ANJUTA_DOCUMENT_LOADER_H__
34 #include "anjuta-document.h"
35 #include <libgnomevfs/gnome-vfs-file-size.h>
40 * Type checking and casting macros
42 #define ANJUTA_TYPE_DOCUMENT_LOADER (anjuta_document_loader_get_type())
43 #define ANJUTA_DOCUMENT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ANJUTA_TYPE_DOCUMENT_LOADER, AnjutaDocumentLoader))
44 #define ANJUTA_DOCUMENT_LOADER_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), ANJUTA_TYPE_DOCUMENT_LOADER, AnjutaDocumentLoader const))
45 #define ANJUTA_DOCUMENT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ANJUTA_TYPE_DOCUMENT_LOADER, AnjutaDocumentLoaderClass))
46 #define ANJUTA_IS_DOCUMENT_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), ANJUTA_TYPE_DOCUMENT_LOADER))
47 #define ANJUTA_IS_DOCUMENT_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_DOCUMENT_LOADER))
48 #define ANJUTA_DOCUMENT_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), ANJUTA_TYPE_DOCUMENT_LOADER, AnjutaDocumentLoaderClass))
50 /* Private structure type */
51 typedef struct _AnjutaDocumentLoaderPrivate AnjutaDocumentLoaderPrivate
;
54 * Main object structure
56 typedef struct _AnjutaDocumentLoader AnjutaDocumentLoader
;
58 struct _AnjutaDocumentLoader
63 AnjutaDocumentLoaderPrivate
*priv
;
69 typedef struct _AnjutaDocumentLoaderClass AnjutaDocumentLoaderClass
;
71 struct _AnjutaDocumentLoaderClass
73 GObjectClass parent_class
;
75 void (* loading
) (AnjutaDocumentLoader
*loader
,
83 GType
anjuta_document_loader_get_type (void) G_GNUC_CONST
;
85 AnjutaDocumentLoader
*anjuta_document_loader_new (AnjutaDocument
*doc
);
87 /* If enconding == NULL, the encoding will be autodetected */
88 void anjuta_document_loader_load (AnjutaDocumentLoader
*loader
,
90 const AnjutaEncoding
*encoding
);
92 gboolean
anjuta_document_loader_load_from_stdin (AnjutaDocumentLoader
*loader
);
94 gboolean
anjuta_document_loader_cancel (AnjutaDocumentLoader
*loader
);
97 /* Returns STDIN_URI if loading from stdin */
98 #define STDIN_URI "stdin:"
99 const gchar
*anjuta_document_loader_get_uri (AnjutaDocumentLoader
*loader
);
101 const gchar
*anjuta_document_loader_get_mime_type (AnjutaDocumentLoader
*loader
);
103 time_t anjuta_document_loader_get_mtime (AnjutaDocumentLoader
*loader
);
105 /* In the case the loader does not know if the file is readonly, for example for most
106 remote files, the function returns FALSE */
107 gboolean
anjuta_document_loader_get_readonly (AnjutaDocumentLoader
*loader
);
109 const AnjutaEncoding
*anjuta_document_loader_get_encoding (AnjutaDocumentLoader
*loader
);
111 /* Returns 0 if file size is unknown */
112 GnomeVFSFileSize
anjuta_document_loader_get_file_size (AnjutaDocumentLoader
*loader
);
114 GnomeVFSFileSize
anjuta_document_loader_get_bytes_read (AnjutaDocumentLoader
*loader
);
119 #endif /* __ANJUTA_DOCUMENT_LOADER_H__ */