## GwyResultsExport

GwyResultsExport — Controls for value set export

## Functions

gchar * | (*GwyResultsFormatFunc) ()
GtkWidget * | gwy_results_export_new ()
void | gwy_results_export_set_format ()
GwyResultsReportType | gwy_results_export_get_format ()
void | gwy_results_export_set_results ()
GwyResults * | gwy_results_export_get_results ()
void | gwy_results_export_set_format_func ()
void | gwy_results_export_set_title ()
void | gwy_results_export_set_style ()
GwyResultsExportStyle | gwy_results_export_get_style ()
void | gwy_results_export_set_actions_sensitive ()
void | gwy_results_fill_filename ()
void | gwy_results_fill_data_name ()
void | gwy_results_fill_graph_curve ()
void | gwy_results_fill_lawn_curve ()

## Signals

void | copy | Action
void | format-changed | Action
void | save | Action

## Types and Values

enum | GwyResultsExportStyle
struct | GwyResultsExport
struct | GwyResultsExportClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── GwyResultsExport

## Implemented Interfaces

GwyResultsExport implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

    #include <libgwyapp/gwyapp.h>

## Description

## Functions

### GwyResultsFormatFunc()

    gchar *
    (*GwyResultsFormatFunc) (gpointer user_data);

The type of result formatting function.

#### Parameters

user_data | Data passed to `gwy_results_export_set_format_func()`. |

#### Returns

Formatted report as a newly allocated string. GwyResultsExport will free it using `g_free()` after saving it to a file or copying to the clipboard.

### gwy_results_export_new()

    GtkWidget *
    gwy_results_export_new (GwyResultsReportType format);

Creates new controls for result set export.

#### Parameters

format | Format to select. |

#### Returns

A newly created result set export widget.

### gwy_results_export_set_format()

    void
    gwy_results_export_set_format (GwyResultsExport *rexport,
                                   GwyResultsReportType format);

Sets the selected format in result set export controls.

#### Parameters

rexport | Controls for result set export. |
format | Format to select. |

### gwy_results_export_get_format()

    GwyResultsReportType
    gwy_results_export_get_format (GwyResultsExport *rexport);

Gets the selected format in result set export controls.

#### Parameters

rexport | Controls for result set export. |

#### Returns

Currently selected format.

### gwy_results_export_set_results()

    void
    gwy_results_export_set_results (GwyResultsExport *rexport,
                                    GwyResults *results);

Sets the set of scalar values to save or copy by result set export controls.

If you supply a result set to save or copy `rexport` handles the Save and Copy buttons itself. So you do not need to connect to the "copy" and "save" signals, except if you need to ensure `results` are updated.

#### Parameters

rexport | Controls for result set export. |
results | Set of reported scalar values. May be `NULL` to unset. |

### gwy_results_export_get_results()

    GwyResults *
    gwy_results_export_get_results (GwyResultsExport *rexport);

Gets the set of scalar values to save or copy by result set export controls.

#### Parameters

rexport | Controls for result set export. |

#### Returns

The GwyResults object, or `NULL`.

### gwy_results_export_set_format_func()

    void
    gwy_results_export_set_format_func (GwyResultsExport *rexport,
                                        GwyResultsFormatFunc func,
                                        gpointer user_data);

Sets the report formatting function for result set export controls.

Setting the formatting function allows automated handling of Copy and Save buttons, even when there is not GwyResults object. It is intended to be used with `GWY_RESULTS_EXPORT_FIXED_FORMAT`. However, it takes precedence even when a GwyResults object is set.

#### Parameters

rexport | Controls for result set export. |
func | The formatting function. |
user_data | Data passed to `func` . |

### gwy_results_export_set_title()

    void
    gwy_results_export_set_title (GwyResultsExport *rexport,
                                  const gchar *title);

Sets the title of file save dialogue for result set export controls.

#### Parameters

rexport | Controls for result set export. |
title | File save dialogue title (or `NULL` to use the default). |

### gwy_results_export_set_style()

    void
    gwy_results_export_set_style (GwyResultsExport *rexport,
                                  GwyResultsExportStyle style);

Sets the report style for result set export controls.

The report style determines which controls will be shown. For `GWY_RESULTS_EXPORT_FIXED_FORMAT` only the action buttons are shown. Tabular data (`GWY_RESULTS_EXPORT_TABULAR_DATA`) do not have the `GWY_RESULTS_REPORT_COLON` option. The default style `GWY_RESULTS_EXPORT_PARAMETERS` have the full controls.

#### Parameters

rexport | Controls for result set export. |
style | Report style. |

### gwy_results_export_get_style()

    GwyResultsExportStyle
    gwy_results_export_get_style (GwyResultsExport *rexport);

Gets the report style for result set export controls.

See `gwy_results_export_set_style()` for discussion.

#### Parameters

rexport | Controls for result set export. |

#### Returns

The style of the results export controls.

### gwy_results_export_set_actions_sensitive()

    void
    gwy_results_export_set_actions_sensitive
                                   (GwyResultsExport *rexport,
                                    gboolean sensitive);

Makes the action buttons (copy and save) sensitive or insensitive.

This is generally preferred to making the entire widget insensitive as the format can be selected independently on whether there is already anything to export.

#### Parameters

rexport | Controls for result set export. |
sensitive | `TRUE` to make the action buttons sensitive, `FALSE` to make them insensitive. |

### gwy_results_fill_filename()

    void
    gwy_results_fill_filename (GwyResults *results,
                               const gchar *resid,
                               GwyFile *file);

Fills data file name in a set of reported scalar values.

This is a helper function for GwyResults. If `file` has no file name associated the value `id` is set to N.A.

#### Parameters

results | Set of reported scalar values. |
resid | Value identifier. |
file | Data container corresponding to a file. |

### gwy_results_fill_data_name()

    void
    gwy_results_fill_data_name (GwyResults *results,
                                const gchar *resid,
                                GwyFile *file,
                                GwyDataKind data_kind,
                                gint dataid);

Fills the name of a data object in a set of reported scalar values.

This is a helper function for GwyResults to fill names of images or graphs. If the data object has no title, the associated the value `id` is set to N.A.

#### Parameters

results | Set of reported scalar values. |
resid | String value identifier. |
file | Data container corresponding to a file. |
data_kind | Type of the data object. |
dataid | Numerical id of the object. |

### gwy_results_fill_graph_curve()

    void
    gwy_results_fill_graph_curve (GwyResults *results,
                                  const gchar *resid,
                                  GwyGraphCurveModel *curvemodel);

Fills graph curve description in a set of reported scalar values.

This is a helper function for GwyResults.

#### Parameters

results | Set of reported scalar values. |
resid | String value identifier. |
curvemodel | A graph curve model. |

### gwy_results_fill_lawn_curve()

    void
    gwy_results_fill_lawn_curve (GwyResults *results,
                                 const gchar *resid,
                                 GwyLawn *lawn,
                                 gint i);

Fills lawn curve description in a set of reported scalar values.

This is a helper function for GwyResults.

#### Parameters

results | Set of reported scalar values. |
resid | String value identifier. |
lawn | Curve map data object. |
i | Curve number in `lawn` . |

## Types and Values

### enum GwyResultsExportStyle

#### Members

GWY_RESULTS_EXPORT_PARAMETERS |  |
GWY_RESULTS_EXPORT_TABULAR_DATA |  |
GWY_RESULTS_EXPORT_FIXED_FORMAT |  |

### struct GwyResultsExport

    struct GwyResultsExport;

### struct GwyResultsExportClass

    struct GwyResultsExportClass {
        GtkBoxClass parent_class;

        /* Signals */
        void (*copy)(GwyResultsExport *results_export);
        void (*save)(GwyResultsExport *results_export);
        void (*format_changed)(GwyResultsExport *results_export);
    };

## Signal Details

### The `“copy”` signal

    void
    user_function (GwyResultsExport *rexport,
                   gpointer          user_data)

The ::copy signal is emitted when user presses the Copy button.

#### Parameters

rexport | The GwyResultsExport which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“format-changed”` signal

    void
    user_function (GwyResultsExport *rexport,
                   gpointer          user_data)

The ::format-changed signal is emitted when the selected format changes.

#### Parameters

rexport | The GwyResultsExport which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“save”` signal

    void
    user_function (GwyResultsExport *rexport,
                   gpointer          user_data)

The ::save signal is emitted when user presses the Save button.

#### Parameters

rexport | The GwyResultsExport which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Action