26 #include <glib/gi18n.h> 28 #include "gnc-plugin-csv-export.h" 36 static void gnc_plugin_csv_export_finalize (GObject *
object);
39 static void gnc_plugin_csv_export_tree_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
40 static void gnc_plugin_csv_export_trans_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
41 static void gnc_plugin_csv_export_register_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
43 #define PLUGIN_ACTIONS_NAME "gnc-plugin-csv-export-actions" 44 #define PLUGIN_UI_FILENAME "gnc-plugin-csv-export.ui" 46 static GActionEntry gnc_plugin_actions [] =
48 {
"CsvExportTreeAction", gnc_plugin_csv_export_tree_cmd, NULL, NULL, NULL },
49 {
"CsvExportTransAction", gnc_plugin_csv_export_trans_cmd, NULL, NULL, NULL },
50 {
"CsvExportRegisterAction", gnc_plugin_csv_export_register_cmd, NULL, NULL, NULL },
53 static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
56 static const gchar *gnc_plugin_load_ui_items [] =
67 G_DEFINE_TYPE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN)
70 gnc_plugin_csv_export_new (
void)
72 return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_CSV_EXPORT, NULL));
76 gnc_plugin_csv_export_class_init (GncPluginCsvExportClass *klass)
78 GObjectClass *object_class = G_OBJECT_CLASS (klass);
79 GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
81 object_class->finalize = gnc_plugin_csv_export_finalize;
84 plugin_class->plugin_name = GNC_PLUGIN_CSV_EXPORT_NAME;
88 plugin_class->actions = gnc_plugin_actions;
89 plugin_class->n_actions = gnc_plugin_n_actions;
91 plugin_class->ui_updates = gnc_plugin_load_ui_items;
95 gnc_plugin_csv_export_init (GncPluginCsvExport *plugin)
100 gnc_plugin_csv_export_finalize (GObject *
object)
102 g_return_if_fail (GNC_IS_PLUGIN_CSV_EXPORT (
object));
104 G_OBJECT_CLASS (gnc_plugin_csv_export_parent_class)->finalize (
object);
115 gnc_plugin_csv_export_tree_cmd (GSimpleAction *simple,
123 gnc_plugin_csv_export_trans_cmd (GSimpleAction *simple,
131 gnc_plugin_csv_export_register_cmd (GSimpleAction *simple,
141 if (GNC_IS_PLUGIN_PAGE_REGISTER(page))
153 gnc_plugin_csv_export_create_plugin (
void)
155 GncPlugin *plugin = gnc_plugin_csv_export_new ();
The instance data structure for a content plugin.
Plugin management functions for the GnuCash UI.
void gnc_plugin_manager_add_plugin(GncPluginManager *manager, GncPlugin *plugin)
Add a plugin to the list maintained by the plugin manager.
GncPluginPage * gnc_main_window_get_current_page(GncMainWindow *window)
Retrieve a pointer to the page that is currently at the front of the specified window.
Functions providing a register page for the GnuCash UI.
GncPluginManager * gnc_plugin_manager_get(void)
Retrieve a pointer to the plugin manager.
void gnc_file_csv_export_register(CsvExportType export_type, Query *q, Account *acc)
The gnc_file_csv_export_register() will let the user export the active register transactions to a del...
void gnc_file_csv_export(CsvExportType export_type)
The gnc_file_csv_export() will let the user export the account tree or transactions to a delimited fi...
Query * gnc_plugin_page_register_get_query(GncPluginPage *plugin_page)
This function is called to get the query associated with this plugin page.
#define PLUGIN_ACTIONS_NAME
The label given to the main window for this plugin.
Account * gnc_plugin_page_register_get_account(GncPluginPageRegister *page)
Get the Account associated with this register page.
#define PLUGIN_UI_FILENAME
The name of the UI description file for this plugin.