![]() |
![]() |
![]() |
Anjuta Developers Reference Manual | ![]() |
---|---|---|---|---|
#include <libanjuta/interfaces/ianjuta-document-manager.h> #define IANJUTA_TYPE_DOCUMENT_MANAGER_ERROR enum IAnjutaDocumentManagerError; #define IANJUTA_DOCUMENT_MANAGER_ERROR IAnjutaDocumentManager; IAnjutaDocumentManagerIface; GQuark ianjuta_document_manager_error_quark (void); GType ianjuta_document_manager_get_type (void); IAnjutaEditor* ianjuta_document_manager_add_buffer (IAnjutaDocumentManager *obj, const gchar *name, const gchar *content, GError **err); void ianjuta_document_manager_add_document (IAnjutaDocumentManager *obj, IAnjutaDocument *document, GError **err); IAnjutaDocument* ianjuta_document_manager_find_document_with_path (IAnjutaDocumentManager *obj, const gchar *file_path, GError **err); IAnjutaDocument* ianjuta_document_manager_get_current_document (IAnjutaDocumentManager *obj, GError **err); GList* ianjuta_document_manager_get_documents (IAnjutaDocumentManager *obj, GError **err); const gchar* ianjuta_document_manager_get_full_filename (IAnjutaDocumentManager *obj, const gchar *file, GError **err); IAnjutaEditor* ianjuta_document_manager_goto_file_line (IAnjutaDocumentManager *obj, const gchar *file, gint lineno, GError **err); IAnjutaEditor* ianjuta_document_manager_goto_file_line_mark (IAnjutaDocumentManager *obj, const gchar *file, gint lineno, gboolean mark, GError **err); gboolean ianjuta_document_manager_remove_document (IAnjutaDocumentManager *obj, IAnjutaDocument *editor, gboolean save_before, GError **err); void ianjuta_document_manager_set_current_document (IAnjutaDocumentManager *obj, IAnjutaDocument *document, GError **err);
#define IANJUTA_TYPE_DOCUMENT_MANAGER_ERROR (ianjuta_document_manager_error_get_type())
typedef enum { IANJUTA_DOCUMENT_MANAGER_DOESNT_EXIST } IAnjutaDocumentManagerError;
#define IANJUTA_DOCUMENT_MANAGER_ERROR ianjuta_document_manager_error_quark()
typedef struct { GTypeInterface g_iface; IAnjutaEditor* (*add_buffer) (IAnjutaDocumentManager *obj, const gchar *name, const gchar* content, GError **err); void (*add_document) (IAnjutaDocumentManager *obj, IAnjutaDocument* document, GError **err); IAnjutaDocument* (*find_document_with_path) (IAnjutaDocumentManager *obj, const gchar *file_path, GError **err); IAnjutaDocument* (*get_current_document) (IAnjutaDocumentManager *obj, GError **err); GList* (*get_documents) (IAnjutaDocumentManager *obj, GError **err); const gchar* (*get_full_filename) (IAnjutaDocumentManager *obj, const gchar *file, GError **err); IAnjutaEditor* (*goto_file_line) (IAnjutaDocumentManager *obj, const gchar *file, gint lineno, GError **err); IAnjutaEditor* (*goto_file_line_mark) (IAnjutaDocumentManager *obj, const gchar *file, gint lineno, gboolean mark, GError **err); gboolean (*remove_document) (IAnjutaDocumentManager *obj, IAnjutaDocument *editor, gboolean save_before, GError **err); void (*set_current_document) (IAnjutaDocumentManager *obj, IAnjutaDocument *document, GError **err); } IAnjutaDocumentManagerIface;
GQuark ianjuta_document_manager_error_quark (void);
Returns : |
IAnjutaEditor* ianjuta_document_manager_add_buffer (IAnjutaDocumentManager *obj, const gchar *name, const gchar *content, GError **err);
Creates a new editor buffer of the given name and sets the given content as its initial content.
obj : |
Self |
name : |
Name of the editor buffer. |
content : |
Initial content of the buffer. |
err : |
Error propagation and reporting. |
Returns : | the IAnjutaEditor instance that has been added. |
void ianjuta_document_manager_add_document (IAnjutaDocumentManager *obj, IAnjutaDocument *document, GError **err);
Adds a document to the document manager. This will open a new Notebook tab and show the document there
obj : |
Self |
document : |
the document to add |
err : |
Error propagation and reporting. |
IAnjutaDocument* ianjuta_document_manager_find_document_with_path (IAnjutaDocumentManager *obj, const gchar *file_path, GError **err);
Finds the document that has the file with path file_path
loaded. Only
the editor that matches the file path will be searched.
obj : |
Self |
file_path : |
the file path. |
err : |
Error propagation and reporting. |
Returns : | the document that corresponds to given file path. NULL if there is no editor loaded with this file path. |
IAnjutaDocument* ianjuta_document_manager_get_current_document (IAnjutaDocumentManager *obj, GError **err);
Gets the current document.
obj : |
Self |
err : |
Error propagation and reporting. |
Returns : | the currently active editor. NULL if none is there. |
GList* ianjuta_document_manager_get_documents (IAnjutaDocumentManager *obj, GError **err);
Gets the current list of documents.
obj : |
Self |
err : |
Error propagation and reporting. |
Returns : | the list of current available documents. The returned list must be freed after use (not the editor objects in the list). |
const gchar* ianjuta_document_manager_get_full_filename (IAnjutaDocumentManager *obj, const gchar *file, GError **err);
Given the short filename, finds the full path of the file, if the editor that has it loaded is found. If there is no editor that has this file opened, returns NULL.
obj : |
Self |
file : |
short filename |
err : |
Error propagation and reporting. |
Returns : | the full path of the file, if an editor is found for it. |
IAnjutaEditor* ianjuta_document_manager_goto_file_line (IAnjutaDocumentManager *obj, const gchar *file, gint lineno, GError **err);
Loads the given file if not loaded yet, set its editor as current editor and moves cursor to the given line in the editor.
obj : |
Self |
file : |
the file to go to. |
lineno : |
the line number in the file to go to. |
err : |
Error propagation and reporting. |
Returns : | the editor where the mark has been put. NULL if none. |
IAnjutaEditor* ianjuta_document_manager_goto_file_line_mark (IAnjutaDocumentManager *obj, const gchar *file, gint lineno, gboolean mark, GError **err);
Loads the given file if not loaded yet, set its editor as current editor
and moves cursor to the given line in the editor. Optionally also marks
the line with line marker if mark
is given TRUE.
obj : |
Self |
file : |
the file to go to. |
lineno : |
the line number in the file to go to. |
mark : |
TRUE if the line should be marked with a marker. |
err : |
Error propagation and reporting |
Returns : | the editor where the mark has been put. NULL if none. |
gboolean ianjuta_document_manager_remove_document (IAnjutaDocumentManager *obj, IAnjutaDocument *editor, gboolean save_before, GError **err);
obj : |
|
editor : |
|
save_before : |
|
err : |
|
Returns : |
void ianjuta_document_manager_set_current_document (IAnjutaDocumentManager *obj, IAnjutaDocument *document, GError **err);
obj : |
|
document : |
|
err : |