Update Spanish translation
[gnumeric.git] / src / gnm-sheet-slicer-combo.c
blobdbb3c59b2b8ed3be6f7a4078a9aa73be8d19859d
1 /*
2 * gnm-sheet-slicer-combo.c: Model for in cell combo for data slicers
4 * Copyright (C) Jody Goldberg <jody@gnome.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
20 #include <gnumeric-config.h>
21 #include <gnumeric.h>
22 #include <gnm-sheet-slicer-combo.h>
23 #include <go-data-slicer-field.h>
24 #include <widgets/gnm-cell-combo-view.h>
25 #include <widgets/gnm-sheet-slicer-combo-view.h>
27 #include <gsf/gsf-impl-utils.h>
29 enum {
30 PROP_0,
31 PROP_FIELD
34 static GObjectClass *gssc_parent_klass;
36 static void
37 gnm_sheet_slicer_combo_finalize (GObject *object)
39 #if 0
40 GnmSheetSlicerCombo *sscombo = GNM_SHEET_SLICER_COMBO (object);
41 #endif
43 gssc_parent_klass->finalize (object);
46 static void
47 gnm_sheet_slicer_combo_init (SheetObject *so)
51 static SheetObjectView *
52 gnm_sheet_slicer_combo_foo_view_new (SheetObject *so, SheetObjectViewContainer *container)
54 return gnm_cell_combo_view_new (so,
55 gnm_sheet_slicer_combo_view_get_type (), container);
58 static void
59 gnm_sheet_slicer_combo_set_property (GObject *obj, guint property_id,
60 GValue const *value, GParamSpec *pspec)
62 GnmSheetSlicerCombo *sscombo = (GnmSheetSlicerCombo *)obj;
64 switch (property_id) {
65 case PROP_FIELD:
66 sscombo->dsf = g_value_get_object (value);
67 break;
68 default:
69 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
73 static void
74 gnm_sheet_slicer_combo_get_property (GObject *obj, guint property_id,
75 GValue *value, GParamSpec *pspec)
77 GnmSheetSlicerCombo const *sscombo = (GnmSheetSlicerCombo const *)obj;
78 switch (property_id) {
79 case PROP_FIELD:
80 g_value_set_object (value, (GObject *) (sscombo->dsf));
81 break;
82 default:
83 G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
87 static void
88 gnm_sheet_slicer_combo_class_init (GObjectClass *gobject_class)
90 SheetObjectClass *so_class = GNM_SO_CLASS (gobject_class);
92 gssc_parent_klass = g_type_class_peek_parent (gobject_class);
94 gobject_class->set_property = gnm_sheet_slicer_combo_set_property;
95 gobject_class->get_property = gnm_sheet_slicer_combo_get_property;
96 gobject_class->finalize = gnm_sheet_slicer_combo_finalize;
97 so_class->new_view = gnm_sheet_slicer_combo_foo_view_new;
99 g_object_class_install_property (gobject_class, PROP_FIELD,
100 g_param_spec_object ("field", NULL, NULL, GO_DATA_SLICER_FIELD_TYPE,
101 GSF_PARAM_STATIC | G_PARAM_READWRITE));
104 typedef GnmCellComboClass GnmSheetSlicerComboClass;
105 GSF_CLASS (GnmSheetSlicerCombo, gnm_sheet_slicer_combo,
106 gnm_sheet_slicer_combo_class_init, gnm_sheet_slicer_combo_init,
107 gnm_cell_combo_get_type ())