1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301 USA.
18 * Copyright 2008 - 2011 Red Hat, Inc.
21 #ifndef NM_OBJECT_PRIVATE_H
22 #define NM_OBJECT_PRIVATE_H
24 #include "nm-default.h"
25 #include "nm-object.h"
27 void _nm_object_ensure_inited (NMObject *object);
29 typedef gboolean (*PropertyMarshalFunc) (NMObject *, GParamSpec *, GValue *, gpointer);
31 typedef GObject * (*NMObjectCreatorFunc) (DBusGConnection *, const char *);
36 PropertyMarshalFunc func;
38 const char *signal_prefix;
41 DBusGProxy *_nm_object_new_proxy (NMObject *self,
43 const char *interface);
45 void _nm_object_register_properties (NMObject *object,
47 const NMPropertiesInfo *info);
49 gboolean _nm_object_reload_properties (NMObject *object, GError **error);
51 void _nm_object_reload_properties_async (NMObject *object,
52 GAsyncReadyCallback callback,
54 gboolean _nm_object_reload_properties_finish (NMObject *object,
58 void _nm_object_queue_notify (NMObject *object, const char *property);
60 void _nm_object_suppress_property_updates (NMObject *object, gboolean suppress);
62 /* DBus property accessors */
64 void _nm_object_reload_property (NMObject *object,
65 const char *interface,
66 const char *prop_name);
68 void _nm_object_set_property (NMObject *object,
69 const char *interface,
70 const char *prop_name,
73 static inline const GPtrArray *
74 handle_ptr_array_return (GPtrArray *array)
76 /* zero-length is special-case; return NULL */
77 if (!array || !array->len)
82 /* object demarshalling support */
83 typedef GType (*NMObjectTypeFunc) (DBusGConnection *, const char *);
84 typedef void (*NMObjectTypeCallbackFunc) (GType, gpointer);
85 typedef void (*NMObjectTypeAsyncFunc) (DBusGConnection *, const char *, NMObjectTypeCallbackFunc, gpointer);
87 void _nm_object_register_type_func (GType base_type, NMObjectTypeFunc type_func,
88 NMObjectTypeAsyncFunc type_async_func);
90 #endif /* NM_OBJECT_PRIVATE_H */