GnuCash 7574033+
Loading...
Searching...
No Matches
Reports

Files

file  gnc-plugin-page-report.h
 Report page.

Data Structures

struct  GncPluginPageReportPrivate
struct  GncPluginPageReport
struct  GncPluginPageReportClass

Macros

#define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(o)
#define SCHEME_OPTIONS   "SchemeOptions"
 The key name used it the state file for storing the report options.
#define SCHEME_OPTIONS_N   "SchemeOptions%d"
#define GNC_PREFS_GROUP_REPORT_PDFEXPORT   GNC_PREFS_GROUP_GENERAL_REPORT ".pdf-export"
#define GNC_PREF_FILENAME_DATE_FMT   "filename-date-format"
#define GNC_PREF_FILENAME_FMT   "filename-format"
#define GNC_TYPE_PLUGIN_PAGE_REPORT   (gnc_plugin_page_report_get_type ())
#define GNC_PLUGIN_PAGE_REPORT(obj)
#define GNC_PLUGIN_PAGE_REPORT_CLASS(klass)
#define GNC_IS_PLUGIN_PAGE_REPORT(obj)
#define GNC_IS_PLUGIN_PAGE_REPORT_CLASS(klass)
#define GNC_PLUGIN_PAGE_REPORT_GET_CLASS(obj)
#define GNC_PLUGIN_PAGE_REPORT_NAME   "GncPluginPageReport"
#define WINDOW_REPORT_CM_CLASS   "window-report"

Enumerations

enum  { PROP_0 , PROP_REPORT_ID }

Functions

void gnc_plugin_page_report_destroy (GncPluginPageReportPrivate *priv)
void gnc_plugin_page_report_remove_edited_report (GncPluginPageReportPrivate *priv, SCM report)
void gnc_plugin_page_report_add_edited_report (GncPluginPageReportPrivate *priv, SCM report)
void gnc_plugin_page_report_raise_editor (SCM report)
GncPluginPage * gnc_plugin_page_report_new (int reportId)
void gnc_plugin_page_report_reload (GncPluginPageReport *report)
void gnc_main_window_open_report (int report_id, GncMainWindow *window)
void gnc_main_window_open_report_url (const char *url, GncMainWindow *window)
GType gnc_plugin_page_report_get_type (void)

Detailed Description

Macro Definition Documentation

◆ GNC_IS_PLUGIN_PAGE_REPORT

#define GNC_IS_PLUGIN_PAGE_REPORT ( obj)
Value:
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_PAGE_REPORT))

Definition at line 49 of file gnc-plugin-page-report.h.

◆ GNC_IS_PLUGIN_PAGE_REPORT_CLASS

#define GNC_IS_PLUGIN_PAGE_REPORT_CLASS ( klass)
Value:
(G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE_REPORT))

Definition at line 50 of file gnc-plugin-page-report.h.

◆ GNC_PLUGIN_PAGE_REPORT

#define GNC_PLUGIN_PAGE_REPORT ( obj)
Value:
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_PAGE_REPORT, GncPluginPageReport))

Definition at line 47 of file gnc-plugin-page-report.h.

◆ GNC_PLUGIN_PAGE_REPORT_CLASS

#define GNC_PLUGIN_PAGE_REPORT_CLASS ( klass)
Value:
(G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE_REPORT, GncPluginPageReportClass))

Definition at line 48 of file gnc-plugin-page-report.h.

◆ GNC_PLUGIN_PAGE_REPORT_GET_CLASS

#define GNC_PLUGIN_PAGE_REPORT_GET_CLASS ( obj)
Value:
(G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_PAGE_REPORT, GncPluginPageReportClass))

Definition at line 51 of file gnc-plugin-page-report.h.

◆ GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE

#define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE ( o)
Value:
((GncPluginPageReportPrivate*)gnc_plugin_page_report_get_instance_private((GncPluginPageReport*)o))

Definition at line 138 of file gnc-plugin-page-report.cpp.

138#define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(o) \
139 ((GncPluginPageReportPrivate*)gnc_plugin_page_report_get_instance_private((GncPluginPageReport*)o))

◆ GNC_PLUGIN_PAGE_REPORT_NAME

#define GNC_PLUGIN_PAGE_REPORT_NAME   "GncPluginPageReport"

Definition at line 53 of file gnc-plugin-page-report.h.

◆ GNC_PREF_FILENAME_DATE_FMT

#define GNC_PREF_FILENAME_DATE_FMT   "filename-date-format"

Definition at line 1871 of file gnc-plugin-page-report.cpp.

◆ GNC_PREF_FILENAME_FMT

#define GNC_PREF_FILENAME_FMT   "filename-format"

Definition at line 1872 of file gnc-plugin-page-report.cpp.

◆ GNC_PREFS_GROUP_REPORT_PDFEXPORT

#define GNC_PREFS_GROUP_REPORT_PDFEXPORT   GNC_PREFS_GROUP_GENERAL_REPORT ".pdf-export"

Definition at line 1870 of file gnc-plugin-page-report.cpp.

◆ GNC_TYPE_PLUGIN_PAGE_REPORT

#define GNC_TYPE_PLUGIN_PAGE_REPORT   (gnc_plugin_page_report_get_type ())

Definition at line 46 of file gnc-plugin-page-report.h.

◆ SCHEME_OPTIONS

#define SCHEME_OPTIONS   "SchemeOptions"

The key name used it the state file for storing the report options.

Definition at line 908 of file gnc-plugin-page-report.cpp.

◆ SCHEME_OPTIONS_N

#define SCHEME_OPTIONS_N   "SchemeOptions%d"

Definition at line 909 of file gnc-plugin-page-report.cpp.

◆ WINDOW_REPORT_CM_CLASS

#define WINDOW_REPORT_CM_CLASS   "window-report"

Definition at line 55 of file gnc-plugin-page-report.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 94 of file gnc-plugin-page-report.cpp.

95{
96 PROP_0,
97 PROP_REPORT_ID,
98};

Function Documentation

◆ gnc_main_window_open_report()

void gnc_main_window_open_report ( int report_id,
GncMainWindow * window )

Definition at line 2107 of file gnc-plugin-page-report.cpp.

2108{
2109 GncPluginPage *reportPage;
2110
2111 if (window)
2112 g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
2113
2114 reportPage = gnc_plugin_page_report_new( report_id );
2115 gnc_main_window_open_page( window, reportPage );
2116}
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Display a data plugin page in a window.
GncPluginPage * gnc_plugin_page_report_new(int reportId)
The instance data structure for a content plugin.

◆ gnc_main_window_open_report_url()

void gnc_main_window_open_report_url ( const char * url,
GncMainWindow * window )

Definition at line 2119 of file gnc-plugin-page-report.cpp.

2120{
2121 GncPluginPage *reportPage;
2122
2123 DEBUG( "report url: [%s]\n", url );
2124
2125 if (window)
2126 g_return_if_fail(GNC_IS_MAIN_WINDOW(window));
2127
2128 reportPage = gnc_plugin_page_report_new( 42 /* url? */ );
2129 gnc_main_window_open_page( window, reportPage );
2130}
#define DEBUG(format, args...)
Print a debugging message.
Definition qoflog.h:264

◆ gnc_plugin_page_report_add_edited_report()

void gnc_plugin_page_report_add_edited_report ( GncPluginPageReportPrivate * priv,
SCM report )

Definition at line 1363 of file gnc-plugin-page-report.cpp.

1365{
1366 SCM new_edited = scm_cons(report, priv->edited_reports);
1367 if (priv->edited_reports != SCM_EOL)
1368 scm_gc_unprotect_object(priv->edited_reports);
1369 priv->edited_reports = new_edited;
1370 if (new_edited != SCM_EOL)
1371 scm_gc_protect_object(priv->edited_reports);
1372}

◆ gnc_plugin_page_report_destroy()

void gnc_plugin_page_report_destroy ( GncPluginPageReportPrivate * priv)

Definition at line 1162 of file gnc-plugin-page-report.cpp.

1163{
1164 SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
1165 SCM set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
1166 SCM edited, editor;
1167
1168 /* close any open editors */
1169 for (edited = scm_list_copy(priv->edited_reports); !scm_is_null(edited);
1170 edited = SCM_CDR(edited))
1171 {
1172 editor = scm_call_1(get_editor, SCM_CAR(edited));
1173 scm_call_2(set_editor, SCM_CAR(edited), SCM_BOOL_F);
1174 if (editor != SCM_BOOL_F)
1175 {
1176#define FUNC_NAME "gtk_widget_destroy"
1177 auto w{static_cast<GtkWidget*>(SWIG_MustGetPtr(editor, SWIG_TypeQuery("_p_GtkWidget"), 1, 0))};
1178#undef FUNC_NAME
1179 gtk_widget_destroy(GTK_WIDGET(w));
1180 }
1181 }
1182
1183 if (priv->initial_odb)
1184 {
1185//Remove this if there's a double-free
1186 gnc_option_db_destroy(priv->initial_odb);
1187 priv->initial_odb = nullptr;
1188 }
1189
1190 gnc_html_destroy(priv->html);
1191 priv->html = nullptr;
1192
1193 g_object_unref(priv->container);
1194 priv->container = nullptr;
1195
1196 if (priv->cur_report != SCM_BOOL_F)
1197 scm_gc_unprotect_object(priv->cur_report);
1198 if (priv->edited_reports != SCM_EOL)
1199 scm_gc_unprotect_object(priv->edited_reports);
1200}
void gnc_option_db_destroy(GncOptionDB *odb)
Destruct and release a GncOptionDB.
GtkContainer * container
the container the above HTML widget is in.
SCM cur_report
The report which this Page is satisfying.
GncHtml * html
the gnc_html abstraction this PluginPage contains

◆ gnc_plugin_page_report_get_type()

GType gnc_plugin_page_report_get_type ( void )
Returns
the type number for an "report" plugin page.

◆ gnc_plugin_page_report_new()

GncPluginPage * gnc_plugin_page_report_new ( int reportId)
Parameters
reportIdThe scheme-defined report identifier
Returns
a new "report" plugin page.

Definition at line 1340 of file gnc-plugin-page-report.cpp.

1341{
1342 DEBUG( "report id = %d", reportId );
1343 auto plugin_page{g_object_new(GNC_TYPE_PLUGIN_PAGE_REPORT, "report-id",
1344 reportId, nullptr)};
1345 DEBUG( "plugin_page: %p", plugin_page );
1346 DEBUG( "set %d on page %p", reportId, plugin_page );
1347 return GNC_PLUGIN_PAGE( plugin_page );
1348}

◆ gnc_plugin_page_report_raise_editor()

void gnc_plugin_page_report_raise_editor ( SCM report)

Definition at line 1375 of file gnc-plugin-page-report.cpp.

1376{
1377 SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
1378 SCM editor = scm_call_1(get_editor, report);
1379#define FUNC_NAME "gtk_window_present"
1380 auto w{static_cast<GtkWidget *>(SWIG_MustGetPtr(editor, SWIG_TypeQuery("_p_GtkWidget"), 1, 0))};
1381#undef FUNC_NAME
1382 gtk_window_present(GTK_WINDOW(w));
1383}

◆ gnc_plugin_page_report_reload()

void gnc_plugin_page_report_reload ( GncPluginPageReport * report)

Definition at line 1455 of file gnc-plugin-page-report.cpp.

1456{
1457 gnc_plugin_page_report_reload_cb (nullptr, nullptr, report);
1458}

◆ gnc_plugin_page_report_remove_edited_report()

void gnc_plugin_page_report_remove_edited_report ( GncPluginPageReportPrivate * priv,
SCM report )

Definition at line 1351 of file gnc-plugin-page-report.cpp.

1353{
1354 SCM new_edited = scm_delete(priv->edited_reports, report);
1355 if (priv->edited_reports != SCM_EOL)
1356 scm_gc_unprotect_object(priv->edited_reports);
1357 priv->edited_reports = new_edited;
1358 if (new_edited != SCM_EOL)
1359 scm_gc_protect_object(priv->edited_reports);
1360}