1 /*
2  * Nautilus-Actions
3  * A Nautilus extension which offers configurable context menu actions.
4  *
5  * Copyright (C) 2005 The GNOME Foundation
6  * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
7  * Copyright (C) 2009-2014 Pierre Wieser and others (see AUTHORS)
8  *
9  * Nautilus-Actions is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of
12  * the License, or (at your option) any later version.
13  *
14  * Nautilus-Actions is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with Nautilus-Actions; see the file COPYING. If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  * Authors:
24  *   Frederic Ruaudel <grumz@grumz.net>
25  *   Rodrigo Moya <rodrigo@gnome-db.org>
26  *   Pierre Wieser <pwieser@trychlos.org>
27  *   ... and many others (see AUTHORS)
28  */
29 
30 #ifndef __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__
31 #define __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__
32 
33 /**
34  * SECTION: data-boxed
35  * @title: NADataBoxed
36  * @short_description: The Data Factory Element Class Definition
37  * @include: nautilus-actions/na-data-boxed.h
38  *
39  * The object which encapsulates an elementary data of #NAIFactoryObject.
40  * A #NADataBoxed object has a type and a value.
41  *
42  * #NADataBoxed class is derived from #NABoxed one, and implements the same
43  * types that those defined in na-data-types.h.
44  *
45  * Additionally, #NADataBoxed class holds the #NADataDef data definition
46  * suitable for a NAFactoryObject object. It such provides default value
47  * and validity status.
48  *
49  * Since: 2.30
50  */
51 
52 #include <glib-object.h>
53 
54 #include "na-boxed.h"
55 #include "na-data-def.h"
56 
57 G_BEGIN_DECLS
58 
59 #define NA_TYPE_DATA_BOXED                ( na_data_boxed_get_type())
60 #define NA_DATA_BOXED( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, NA_TYPE_DATA_BOXED, NADataBoxed ))
61 #define NA_DATA_BOXED_CLASS( klass )      ( G_TYPE_CHECK_CLASS_CAST( klass, NA_TYPE_DATA_BOXED, NADataBoxedClass ))
62 #define NA_IS_DATA_BOXED( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_TYPE_DATA_BOXED ))
63 #define NA_IS_DATA_BOXED_CLASS( klass )   ( G_TYPE_CHECK_CLASS_TYPE(( klass ), NA_TYPE_DATA_BOXED ))
64 #define NA_DATA_BOXED_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), NA_TYPE_DATA_BOXED, NADataBoxedClass ))
65 
66 typedef struct _NADataBoxedPrivate        NADataBoxedPrivate;
67 
68 typedef struct {
69 	/*< private >*/
70 	NABoxed             parent;
71 	NADataBoxedPrivate *private;
72 }
73 	NADataBoxed;
74 
75 typedef struct _NADataBoxedClassPrivate   NADataBoxedClassPrivate;
76 
77 typedef struct {
78 	/*< private >*/
79 	NABoxedClass             parent;
80 	NADataBoxedClassPrivate *private;
81 }
82 	NADataBoxedClass;
83 
84 GType            na_data_boxed_get_type( void );
85 
86 NADataBoxed     *na_data_boxed_new            ( const NADataDef *def );
87 
88 const NADataDef *na_data_boxed_get_data_def   ( const NADataBoxed *boxed );
89 void             na_data_boxed_set_data_def   ( NADataBoxed *boxed, const NADataDef *def );
90 
91 GParamSpec      *na_data_boxed_get_param_spec ( const NADataDef *def );
92 
93 gboolean         na_data_boxed_is_default     ( const NADataBoxed *boxed );
94 gboolean         na_data_boxed_is_valid       ( const NADataBoxed *boxed );
95 
96 /* These functions are deprecated starting with 3.1.0
97  */
98 #ifdef NA_ENABLE_DEPRECATED
99 gboolean         na_data_boxed_are_equal      ( const NADataBoxed *a, const NADataBoxed *b );
100 void             na_data_boxed_dump           ( const NADataBoxed *boxed );
101 gchar           *na_data_boxed_get_as_string  ( const NADataBoxed *boxed );
102 void             na_data_boxed_get_as_value   ( const NADataBoxed *boxed, GValue *value );
103 void            *na_data_boxed_get_as_void    ( const NADataBoxed *boxed );
104 void             na_data_boxed_set_from_boxed ( NADataBoxed *boxed, const NADataBoxed *value );
105 void             na_data_boxed_set_from_string( NADataBoxed *boxed, const gchar *value );
106 void             na_data_boxed_set_from_value ( NADataBoxed *boxed, const GValue *value );
107 void             na_data_boxed_set_from_void  ( NADataBoxed *boxed, const void *value );
108 #endif /* NA_ENABLE_DEPRECATED */
109 
110 G_END_DECLS
111 
112 #endif /* __NAUTILUS_ACTIONS_API_NA_DATA_BOXED_H__ */
113