1
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3
* gnm-sheet-slicer-combo.c: Model for in cell combo for data slicers
5
* Copyright (C) Jody Goldberg <jody@gnome.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
#include <gnumeric-config.h>
24
#include "gnm-sheet-slicer-combo.h"
25
#include "go-data-slicer-field.h"
26
#include "widgets/gnm-cell-combo-foo-view.h"
27
#include "widgets/gnm-sheet-slicer-combo-foo-view.h"
29
#include <gsf/gsf-impl-utils.h>
37
gnm_sheet_slicer_combo_finalize (GObject *object)
40
GnmSheetSlicerCombo *sscombo = GNM_SHEET_SLICER_COMBO (object);
44
parent = g_type_class_peek (gnm_cell_combo_get_type ());
45
parent->finalize (object);
49
gnm_sheet_slicer_combo_init (SheetObject *so)
53
static SheetObjectView *
54
gnm_sheet_slicer_combo_foo_view_new (SheetObject *so, SheetObjectViewContainer *container)
56
return gnm_cell_combo_foo_view_new (so,
57
gnm_sheet_slicer_combo_foo_view_get_type (), container);
61
gnm_sheet_slicer_combo_set_property (GObject *obj, guint property_id,
62
GValue const *value, GParamSpec *pspec)
64
GnmSheetSlicerCombo *sscombo = (GnmSheetSlicerCombo *)obj;
66
switch (property_id) {
67
case PROP_FIELD : sscombo->dsf = g_value_get_object (value); break;
69
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
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 : g_value_set_object (value, (GObject *) (sscombo->dsf)); break;
81
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
85
gnm_sheet_slicer_combo_class_init (GObjectClass *gobject_class)
87
SheetObjectClass *so_class = SHEET_OBJECT_CLASS (gobject_class);
88
gobject_class->set_property = gnm_sheet_slicer_combo_set_property;
89
gobject_class->get_property = gnm_sheet_slicer_combo_get_property;
90
gobject_class->finalize = gnm_sheet_slicer_combo_finalize;
91
so_class->new_view = gnm_sheet_slicer_combo_foo_view_new;
93
g_object_class_install_property (gobject_class, PROP_FIELD,
94
g_param_spec_object ("field", NULL, NULL, GO_DATA_SLICER_FIELD_TYPE,
95
GSF_PARAM_STATIC | G_PARAM_READWRITE));
98
typedef GnmCellComboClass GnmSheetSlicerComboClass;
99
GSF_CLASS (GnmSheetSlicerCombo, gnm_sheet_slicer_combo,
100
gnm_sheet_slicer_combo_class_init, gnm_sheet_slicer_combo_init,
101
gnm_cell_combo_get_type ())