device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm / nm-object-private.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /*
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.
7  *
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.
12  *
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.
17  *
18  * Copyright 2008 - 2011 Red Hat, Inc.
19  */
20
21 #ifndef __NM_OBJECT_PRIVATE_H__
22 #define __NM_OBJECT_PRIVATE_H__
23
24 #include "nm-default.h"
25 #include "nm-object.h"
26
27 typedef gboolean (*PropertyMarshalFunc) (NMObject *, GParamSpec *, GVariant *, gpointer);
28
29 typedef GObject * (*NMObjectCreatorFunc) (GDBusConnection *, const char *);
30
31 typedef struct {
32         const char *name;
33         gpointer field;
34         PropertyMarshalFunc func;
35         GType object_type;
36         const char *signal_prefix;
37 } NMPropertiesInfo;
38
39 void _nm_object_register_properties (NMObject *object,
40                                      const char *interface,
41                                      const NMPropertiesInfo *info);
42
43 void     _nm_object_reload_properties_async  (NMObject *object,
44                                               GCancellable *cancellable,
45                                               GAsyncReadyCallback callback,
46                                               gpointer user_data);
47 gboolean _nm_object_reload_properties_finish (NMObject *object,
48                                               GAsyncResult *result,
49                                               GError **error);
50
51 void _nm_object_queue_notify (NMObject *object, const char *property);
52
53 void _nm_object_suppress_property_updates (NMObject *object, gboolean suppress);
54
55 /* DBus property accessors */
56
57 void _nm_object_reload_property (NMObject *object,
58                                  const char *interface,
59                                  const char *prop_name);
60
61 void _nm_object_set_property (NMObject *object,
62                               const char *interface,
63                               const char *prop_name,
64                               const char *format_string,
65                               ...);
66
67 /* object demarshalling support */
68 typedef GType (*NMObjectDecideTypeFunc) (GVariant *);
69
70 void _nm_object_register_type_func (GType base_type,
71                                     NMObjectDecideTypeFunc type_func,
72                                     const char *interface,
73                                     const char *property);
74
75 #define NM_OBJECT_NM_RUNNING "nm-running-internal"
76 gboolean _nm_object_get_nm_running (NMObject *self);
77
78 void _nm_object_class_add_interface (NMObjectClass *object_class,
79                                      const char    *interface);
80 GDBusProxy *_nm_object_get_proxy (NMObject   *object,
81                                   const char *interface);
82
83 #endif /* __NM_OBJECT_PRIVATE_H__ */