1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
4
* Copyright (C) Philip Withnall 2008-2009 <philip@tecnocode.co.uk>
6
* Almanah 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 3 of the License, or
9
* (at your option) any later version.
11
* Almanah 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 Almanah. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef ALMANAH_DEFINITION_H
21
#define ALMANAH_DEFINITION_H
24
#include <glib-object.h>
30
ALMANAH_DEFINITION_UNKNOWN = 0,
31
ALMANAH_DEFINITION_FILE = 1,
32
ALMANAH_DEFINITION_NOTE,
33
ALMANAH_DEFINITION_URI,
34
ALMANAH_DEFINITION_CONTACT
35
} AlmanahDefinitionType;
37
#define ALMANAH_TYPE_DEFINITION (almanah_definition_get_type ())
38
#define ALMANAH_DEFINITION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ALMANAH_TYPE_DEFINITION, AlmanahDefinition))
39
#define ALMANAH_DEFINITION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ALMANAH_TYPE_DEFINITION, AlmanahDefinitionClass))
40
#define ALMANAH_IS_DEFINITION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ALMANAH_TYPE_DEFINITION))
41
#define ALMANAH_IS_DEFINITION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ALMANAH_TYPE_DEFINITION))
42
#define ALMANAH_DEFINITION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), ALMANAH_TYPE_DEFINITION, AlmanahDefinitionClass))
44
typedef struct _AlmanahDefinitionPrivate AlmanahDefinitionPrivate;
48
AlmanahDefinitionPrivate *priv;
54
AlmanahDefinitionType type_id;
56
const gchar *description;
57
const gchar *icon_name;
59
gboolean (*view) (AlmanahDefinition *definition);
60
void (*build_dialog) (AlmanahDefinition *definition, GtkVBox *parent_vbox);
61
void (*close_dialog) (AlmanahDefinition *definition, GtkVBox *parent_vbox);
62
void (*parse_text) (AlmanahDefinition *definition, const gchar *text);
63
gchar *(*get_blurb) (AlmanahDefinition *definition);
64
} AlmanahDefinitionClass;
66
GType almanah_definition_get_type (void);
68
AlmanahDefinition *almanah_definition_new (AlmanahDefinitionType type_id);
70
AlmanahDefinitionType almanah_definition_get_type_id (AlmanahDefinition *self);
71
const gchar *almanah_definition_get_name (AlmanahDefinition *self);
72
const gchar *almanah_definition_get_description (AlmanahDefinition *self);
73
const gchar *almanah_definition_get_icon_name (AlmanahDefinition *self);
75
gboolean almanah_definition_view (AlmanahDefinition *self);
76
void almanah_definition_build_dialog (AlmanahDefinition *self, GtkVBox *parent_vbox);
77
void almanah_definition_close_dialog (AlmanahDefinition *self, GtkVBox *parent_vbox);
78
void almanah_definition_parse_text (AlmanahDefinition *self, const gchar *text);
79
gchar *almanah_definition_get_blurb (AlmanahDefinition *self);
81
const gchar *almanah_definition_get_text (AlmanahDefinition *self);
82
void almanah_definition_set_text (AlmanahDefinition *self, const gchar *text);
84
const gchar *almanah_definition_get_value (AlmanahDefinition *self);
85
void almanah_definition_set_value (AlmanahDefinition *self, const gchar *value);
86
const gchar *almanah_definition_get_value2 (AlmanahDefinition *self);
87
void almanah_definition_set_value2 (AlmanahDefinition *self, const gchar *value);
89
void almanah_definition_populate_model (GtkListStore *list_store, guint type_id_column, guint name_column, guint icon_name_column);
93
#endif /* !ALMANAH_DEFINITION_H */