1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) Dragos Dena 2010
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301 USA
22 #ifndef __SNIPPETS_MANAGER_PLUGIN_H__
23 #define __SNIPPETS_MANAGER_PLUGIN_H__
26 #include <libanjuta/anjuta-plugin.h>
27 #include <libanjuta/interfaces/ianjuta-snippets-manager.h>
28 #include <libanjuta/interfaces/ianjuta-editor.h>
30 #include "snippets-editor.h"
31 #include "snippets-browser.h"
32 #include "snippets-db.h"
33 #include "snippets-interaction-interpreter.h"
34 #include "snippets-provider.h"
37 extern GType
snippets_manager_plugin_get_type (GTypeModule
*module
);
38 #define ANJUTA_TYPE_PLUGIN_SNIPPETS_MANAGER (snippets_manager_plugin_get_type (NULL))
39 #define ANJUTA_PLUGIN_SNIPPETS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_PLUGIN_SNIPPETS_MANAGER, SnippetsManagerPlugin))
40 #define ANJUTA_PLUGIN_SNIPPETS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), ANJUTA_TYPE_PLUGIN_SNIPPETS_MANAGER, SnippetsManagerPluginClass))
41 #define ANJUTA_IS_PLUGIN_SNIPPETS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PLUGIN_SNIPPETS_MANAGER))
42 #define ANJUTA_IS_PLUGIN_SNIPPETS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_PLUGIN_SNIPPETS_MANAGER))
43 #define ANJUTA_PLUGIN_SNIPPETS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ANJUTA_TYPE_PLUGIN_SNIPPETS_MANAGER, SnippetsManagerPluginClass))
46 typedef struct _SnippetsManagerPlugin SnippetsManagerPlugin
;
47 typedef struct _SnippetsManagerPluginClass SnippetsManagerPluginClass
;
49 struct _SnippetsManagerPlugin
53 /* Snippet Database. This is where snippets are loaded into memory.
54 Provides search functions. */
55 SnippetsDB
* snippets_db
;
57 /* Snippets Interaction Interpreter. This takes care of interacting with
58 the editor for inserting and live editing the snippets. */
59 SnippetsInteraction
* snippets_interaction
;
62 SnippetsBrowser
* snippets_browser
;
64 SnippetsProvider
*snippets_provider
;
66 /* Plug-in settings */
67 gboolean overwrite_on_conflict
;
68 gboolean show_only_document_language_snippets
;
70 gint cur_editor_watch_id
;
73 GtkActionGroup
*action_group
;
76 gboolean browser_maximized
;
83 struct _SnippetsManagerPluginClass
85 AnjutaPluginClass parent_class
;
89 /* To insert a snippet to the editor. */
91 snippet_insert (SnippetsManagerPlugin
* plugin
, const gchar
*keyword
, gboolean editing_session
);
94 #endif /* __SNIPPETS_MANAGER_PLUGIN_H__ */