policy: initialize object during GObject construction
[NetworkManager.git] / src / nm-policy.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* NetworkManager -- Network link manager
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Copyright (C) 2004 - 2010 Red Hat, Inc.
19  * Copyright (C) 2007 - 2008 Novell, Inc.
20  */
21
22 #ifndef __NETWORKMANAGER_POLICY_H__
23 #define __NETWORKMANAGER_POLICY_H__
24
25 #include "nm-default.h"
26
27 #define NM_TYPE_POLICY            (nm_policy_get_type ())
28 #define NM_POLICY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_POLICY, NMPolicy))
29 #define NM_POLICY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_POLICY, NMPolicyClass))
30 #define NM_IS_POLICY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_POLICY))
31 #define NM_IS_POLICY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_POLICY))
32 #define NM_POLICY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_POLICY, NMPolicyClass))
33
34 #define NM_POLICY_MANAGER               "manager"
35 #define NM_POLICY_SETTINGS              "settings"
36 #define NM_POLICY_DEFAULT_IP4_DEVICE    "default-ip4-device"
37 #define NM_POLICY_DEFAULT_IP6_DEVICE    "default-ip6-device"
38 #define NM_POLICY_ACTIVATING_IP4_DEVICE "activating-ip4-device"
39 #define NM_POLICY_ACTIVATING_IP6_DEVICE "activating-ip6-device"
40
41 struct _NMPolicy {
42         GObject parent;
43 };
44
45 typedef struct {
46         GObjectClass parent;
47
48 } NMPolicyClass;
49
50 GType nm_policy_get_type (void);
51
52 NMPolicy *nm_policy_new (NMManager *manager, NMSettings *settings);
53
54 NMDevice *nm_policy_get_default_ip4_device (NMPolicy *policy);
55 NMDevice *nm_policy_get_default_ip6_device (NMPolicy *policy);
56 NMDevice *nm_policy_get_activating_ip4_device (NMPolicy *policy);
57 NMDevice *nm_policy_get_activating_ip6_device (NMPolicy *policy);
58
59 #endif /* __NETWORKMANAGER_POLICY_H__ */