26#include <glib/gi18n.h>
28#include "gnc-plugin-csv-export.h"
36static void gnc_plugin_csv_export_finalize (GObject *
object);
39static void gnc_plugin_csv_export_tree_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
40static void gnc_plugin_csv_export_trans_cmd (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
41static 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"
46static 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 },
53static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
56static const gchar *gnc_plugin_load_ui_items [] =
67G_DEFINE_TYPE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN)
70gnc_plugin_csv_export_new (
void)
72 return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_CSV_EXPORT, NULL));
76gnc_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;
87 plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
88 plugin_class->actions = gnc_plugin_actions;
89 plugin_class->n_actions = gnc_plugin_n_actions;
90 plugin_class->ui_filename = PLUGIN_UI_FILENAME;
91 plugin_class->ui_updates = gnc_plugin_load_ui_items;
95gnc_plugin_csv_export_init (GncPluginCsvExport *plugin)
100gnc_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);
115gnc_plugin_csv_export_tree_cmd (GSimpleAction *simple,
123gnc_plugin_csv_export_trans_cmd (GSimpleAction *simple,
131gnc_plugin_csv_export_register_cmd (GSimpleAction *simple,
141 if (GNC_IS_PLUGIN_PAGE_REGISTER(page))
153gnc_plugin_csv_export_create_plugin (
void)
155 GncPlugin *plugin = gnc_plugin_csv_export_new ();
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...
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...
Plugin management functions for the GnuCash UI.
Functions providing a register page for the GnuCash UI.
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.
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.
Query * gnc_plugin_page_register_get_query(GncPluginPage *plugin_page)
This function is called to get the query associated with this plugin page.
Account * gnc_plugin_page_register_get_account(GncPluginPageRegister *page)
Get the Account associated with this register page.
The instance data structure for a content plugin.