File: bonobo-property-bag.h

package info (click to toggle)
bonobo 1.0.22-2.2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,412 kB
  • ctags: 5,445
  • sloc: ansic: 51,714; sh: 7,733; makefile: 1,425; yacc: 318; xml: 266; sed: 16
file content (136 lines) | stat: -rw-r--r-- 5,091 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
 * bonobo-property-bag.h: property bag object implementation.
 *
 * Authors:
 *   Nat Friedman  (nat@helixcode.com)
 *   Michael Meeks (michael@helixcode.com)
 *
 * Copyright 1999, 2000 Helix Code, Inc.
 */
#ifndef __BONOBO_PROPERTY_BAG_H__
#define __BONOBO_PROPERTY_BAG_H__

#include <bonobo/bonobo-xobject.h>

BEGIN_GNOME_DECLS

typedef struct _BonoboPropertyBagPrivate BonoboPropertyBagPrivate;
typedef struct _BonoboPropertyBag        BonoboPropertyBag;

/* Keep this enumeration synced with the docs in bonobo-property.idl */
typedef enum {
	BONOBO_PROPERTY_UNSTORED        = 1,
	BONOBO_PROPERTY_READABLE        = 2,
	BONOBO_PROPERTY_WRITEABLE       = 4,
	BONOBO_PROPERTY_USE_DEFAULT_OPT = 8,
	BONOBO_PROPERTY_NO_LISTENING    = 16
} BonoboPropertyFlags;

#include <bonobo/bonobo-arg.h>

typedef void (*BonoboPropertyGetFn) (BonoboPropertyBag *bag,
				     BonoboArg         *arg,
				     guint              arg_id,
				     CORBA_Environment *ev,
				     gpointer           user_data);
typedef void (*BonoboPropertySetFn) (BonoboPropertyBag *bag,
				     const BonoboArg   *arg,
				     guint              arg_id,
				     CORBA_Environment *ev,
				     gpointer           user_data);

#include <bonobo/bonobo-property.h>
#include <bonobo/bonobo-event-source.h>

struct _BonoboPropertyBag {
	BonoboXObject             parent;
	BonoboPropertyBagPrivate *priv;
	BonoboEventSource        *es;
};

typedef struct {
	BonoboXObjectClass        parent;

	POA_Bonobo_PropertyBag__epv epv;
} BonoboPropertyBagClass;

#define BONOBO_PROPERTY_BAG_TYPE                (bonobo_property_bag_get_type ())
#define BONOBO_PROPERTY_BAG(o)		        (GTK_CHECK_CAST ((o), BONOBO_PROPERTY_BAG_TYPE, BonoboPropertyBag))
#define BONOBO_PROPERTY_BAG_CLASS(k)		(GTK_CHECK_CLASS_CAST((k), BONOBO_PROPERTY_BAG_TYPE, BonoboPropertyBagClass))
#define BONOBO_IS_PROPERTY_BAG(o)		(GTK_CHECK_TYPE ((o), BONOBO_PROPERTY_BAG_TYPE))
#define BONOBO_IS_PROPERTY_BAG_CLASS(k)		(GTK_CHECK_CLASS_TYPE ((k), BONOBO_PROPERTY_BAG_TYPE))

GtkType		          bonobo_property_bag_get_type        (void);
BonoboPropertyBag	 *bonobo_property_bag_new	      (BonoboPropertyGetFn get_prop,
							       BonoboPropertySetFn set_prop,
							       gpointer            user_data);

BonoboPropertyBag	 *bonobo_property_bag_new_full	      (BonoboPropertyGetFn get_prop,
							       BonoboPropertySetFn set_prop,
							       BonoboEventSource  *event_source,
							       gpointer            user_data);

BonoboPropertyBag        *bonobo_property_bag_construct       (BonoboPropertyBag   *pb,
							       BonoboPropertyGetFn  get_prop,
							       BonoboPropertySetFn  set_prop,
							       BonoboEventSource   *event_source,
							       gpointer             user_data);

void                      bonobo_property_bag_add              (BonoboPropertyBag  *pb,
								const char         *name,
								int                 idx,
								BonoboArgType       type,
								BonoboArg          *default_value,
								const char         *docstring,
								BonoboPropertyFlags flags);

void                      bonobo_property_bag_add_full         (BonoboPropertyBag  *pb,
								const char         *name,
								int                 idx,
								BonoboArgType       type,
								BonoboArg          *default_value,
								const char         *docstring,
								BonoboPropertyFlags flags,
								BonoboPropertyGetFn get_prop,
								BonoboPropertySetFn set_prop,
								gpointer            user_data);

void                      bonobo_property_bag_add_gtk_args     (BonoboPropertyBag  *pb,
								GtkObject          *object);

BonoboArgType             bonobo_property_bag_get_property_type (BonoboPropertyBag *pb, 
								const char *name,
								CORBA_Environment *opt_ev);

/* Modifying properties. */		   		      
void		          bonobo_property_bag_set_value        (BonoboPropertyBag *pb,
								const char        *name,
								const BonoboArg   *value,
								CORBA_Environment *opt_ev);

BonoboArg                *bonobo_property_bag_get_value        (BonoboPropertyBag *pb, 
								const char *name, 
								CORBA_Environment *opt_ev);
BonoboArg                *bonobo_property_bag_get_default      (BonoboPropertyBag *pb, 
								const char *name, 
								CORBA_Environment *opt_ev);
const char	         *bonobo_property_bag_get_docstring    (BonoboPropertyBag *pb, 
								const char *name, 
								CORBA_Environment *opt_ev);
const BonoboPropertyFlags bonobo_property_bag_get_flags        (BonoboPropertyBag *pb,
								const char *name, 
								CORBA_Environment *opt_ev);

gboolean		  bonobo_property_bag_has_property     (BonoboPropertyBag *pb, 
								const char *name);
void                      bonobo_property_bag_notify_listeners (BonoboPropertyBag *pb,
								const char        *name,
								const BonoboArg   *new_value,
								CORBA_Environment *opt_ev);

/* A private function, only to be used by persistence implementations. */
GList                    *bonobo_property_bag_get_prop_list    (BonoboPropertyBag *pb);

END_GNOME_DECLS

#endif /* ! __BONOBO_PROPERTY_BAG_H__ */