GnuCash c935c2f+
Loading...
Searching...
No Matches
gnc-plugin-bi-import.c
1/*
2 * gnc-plugin-bi-import.c -- Invoice Importer Plugin
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, contact:
16 *
17 * Free Software Foundation Voice: +1-617-542-5942
18 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
19 * Boston, MA 02110-1301, USA gnu@gnu.org
20 */
21
30#ifdef HAVE_CONFIG_H
31#include <config.h>
32#endif
33#include <glib/gi18n.h>
34
35#include "dialog-utils.h"
36
39#include "gnc-plugin-manager.h"
40
41/* This static indicates the debugging module that this .o belongs to. */
42static QofLogModule log_module = G_LOG_DOMAIN;
43
44static void gnc_plugin_bi_import_finalize (GObject *object);
45
46/* Command callbacks */
47static void gnc_plugin_bi_import_cmd_test (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
48
49#define PLUGIN_ACTIONS_NAME "gnc-plugin-bi-import-actions"
50#define PLUGIN_UI_FILENAME "gnc-plugin-bi-import.ui"
51
52static GActionEntry gnc_plugin_actions [] =
53{
54 // should be "BiImportAction", but "bi_importAction" is already
55 // used externally in accelerator maps
56 { "bi_importAction", gnc_plugin_bi_import_cmd_test, NULL, NULL, NULL },
57};
59static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
60
62static const gchar *gnc_plugin_load_ui_items [] =
63{
64 "FilePlaceholder1",
65 NULL,
66};
67
68/************************************************************
69 * Object Implementation *
70 ************************************************************/
71
73{
74 GncPlugin gnc_plugin;
75};
76
77G_DEFINE_TYPE(GncPluginBiImport, gnc_plugin_bi_import, GNC_TYPE_PLUGIN)
78
79GncPlugin *
81{
82 return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_BI_IMPORT, (gchar*) NULL));
83}
84
85static void
86gnc_plugin_bi_import_class_init (GncPluginBiImportClass *klass)
87{
88 GObjectClass *object_class = G_OBJECT_CLASS (klass);
89 GncPluginClass *plugin_class = GNC_PLUGIN_CLASS(klass);
90
91 object_class->finalize = gnc_plugin_bi_import_finalize;
92
93 /* plugin info */
94 plugin_class->plugin_name = GNC_PLUGIN_BI_IMPORT_NAME;
95
96 /* widget addition/removal */
97 plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
98 plugin_class->actions = gnc_plugin_actions;
99 plugin_class->n_actions = gnc_plugin_n_actions;
100 plugin_class->ui_filename = PLUGIN_UI_FILENAME;
101 plugin_class->ui_updates = gnc_plugin_load_ui_items;
102}
103
104static void
105gnc_plugin_bi_import_init (GncPluginBiImport *plugin)
106{
107}
108
109static void
110gnc_plugin_bi_import_finalize (GObject *object)
111{
112 G_OBJECT_CLASS (gnc_plugin_bi_import_parent_class)->finalize (object);
113}
114
115/************************************************************
116* Plugin Bootstrapping *
117************************************************************/
118
119void
126
127/************************************************************
128 * Command Callbacks *
129 ************************************************************/
130
131static void
132gnc_plugin_bi_import_cmd_test (GSimpleAction *simple,
133 GVariant *parameter,
134 gpointer user_data)
135{
136 GncMainWindowActionData *data = user_data;
137
138 ENTER ("action %p, main window data %p", simple, data);
139 PINFO ("bi_import");
140
141 gnc_plugin_bi_import_showGUI(GTK_WINDOW(data->window));
142
143 LEAVE (" ");
144}
GUI handling for bi-import plugin.
Plugin registration of the bi-import module.
Plugin management functions for the GnuCash UI.
#define PINFO(format, args...)
Print an informational note.
Definition qoflog.h:256
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition qoflog.h:282
#define ENTER(format, args...)
Print a function entry debugging message.
Definition qoflog.h:272
void gnc_plugin_manager_add_plugin(GncPluginManager *manager, GncPlugin *plugin)
Add a plugin to the list maintained by the plugin manager.
GncPluginManager * gnc_plugin_manager_get(void)
Retrieve a pointer to the plugin manager.
BillImportGui * gnc_plugin_bi_import_showGUI(GtkWindow *parent)
File chooser.
void gnc_plugin_bi_import_create_plugin(void)
Create a new GncPluginbi_import object and register it.
GncPlugin * gnc_plugin_bi_import_new(void)