Fixed message typo.
[captive.git] / src / libcaptive / client / parent-connector.h
1 /* $Id$
2  * Include file for fs object sandbox parents reconnections to their sandbox slave peers
3  * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
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
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #ifndef _CAPTIVE_CLIENT_PRIV_PARENT_CONNECTOR_H
21 #define _CAPTIVE_CLIENT_PRIV_PARENT_CONNECTOR_H 1
22
23
24 #include <glib/gmacros.h>
25 #include <glib/gtypes.h>
26 #include <glib-object.h>
27 #include <orbit/orb-core/corba-defs.h>
28 #include "vfs-parent.h"
29
30
31 G_BEGIN_DECLS
32
33 #define CAPTIVE_TYPE_PARENT_CONNECTOR           (captive_parent_connector_get_type ())
34 #define CAPTIVE_PARENT_CONNECTOR(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR, CaptiveParentConnector))
35 #define CAPTIVE_PARENT_CONNECTOR_CLASS(obj)     (G_TYPE_CHECK_CLASS_CAST ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR, CaptiveParentConnectorIface))
36 #define CAPTIVE_IS_PARENT_CONNECTOR(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR))
37 #define CAPTIVE_IS_PARENT_CONNECTOR_CLASS(obj)  (G_TYPE_CHECK_CLASS_TYPE ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR))
38 #define CAPTIVE_PARENT_CONNECTOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CAPTIVE_TYPE_PARENT_CONNECTOR, CaptiveParentConnectorIface))
39 typedef struct _CaptiveParentConnector      CaptiveParentConnector;
40 typedef struct _CaptiveParentConnectorIface CaptiveParentConnectorIface;
41
42
43 GType captive_parent_connector_get_type(void);
44
45 struct _CaptiveParentConnectorIface {
46         GTypeInterface g_iface;
47
48         GnomeVFSResult (*open)(CaptiveParentConnector *captive_parent_connector);
49         GnomeVFSResult (*close)(CaptiveParentConnector *captive_parent_connector);
50         G_CONST_RETURN gchar *(*get_pathname)(CaptiveParentConnector *captive_parent_connector);
51         };
52
53 typedef enum {
54         CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,
55         CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF,
56         CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY,
57         } CaptiveParentConnectorFlagWant;
58
59 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED \
60                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* vfs */ \
61                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \
62                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF  /* dirty */
63 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_BROKEN \
64                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* vfs */ \
65                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \
66                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON   /* dirty */
67 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED \
68                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* vfs */ \
69                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \
70                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY  /* dirty */
71 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_CLEAN \
72                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* vfs */ \
73                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \
74                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF  /* dirty */
75 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY \
76                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* vfs */ \
77                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \
78                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON   /* dirty */
79 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_CLOSED_DIRTY_OR_OPENED_DIRTY \
80                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* vfs */ \
81                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY, /* corba_object */ \
82                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON   /* dirty */
83 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED_OR_CLOSED_CLEAN \
84                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY, /* vfs */ \
85                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \
86                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF  /* dirty */
87 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_DISCONNECTED_OR_BROKEN_OR_CLOSED \
88                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY, /* vfs */ \
89                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF, /* corba_object */ \
90                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY  /* dirty */
91 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED \
92                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* vfs */ \
93                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* corba_object */ \
94                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ANY  /* dirty */
95 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED_CLEAN \
96                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* vfs */ \
97                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* corba_object */ \
98                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_OFF  /* dirty */
99 #define CAPTIVE_PARENT_CONNECTOR_FLAGS_OPENED_DIRTY \
100                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* vfs */ \
101                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON,  /* corba_object */ \
102                 CAPTIVE_PARENT_CONNECTOR_FLAG_WANT_ON   /* dirty */
103
104 void captive_parent_connector_init(CaptiveParentConnector *captive_parent_connector,
105                         CORBA_Object *corba_objectp,CaptiveVfsParentObject *captive_vfs_parent_object);
106 gboolean captive_parent_connector_dispose(CaptiveParentConnector *captive_parent_connector);
107 void captive_parent_connector_finalize(CaptiveParentConnector *captive_parent_connector);
108 GnomeVFSResult captive_parent_connector_connect(CaptiveParentConnector *captive_parent_connector);
109 GnomeVFSResult captive_parent_connector_open(CaptiveParentConnector *captive_parent_connector);
110 GnomeVFSResult captive_parent_connector_close(CaptiveParentConnector *captive_parent_connector);
111 void captive_parent_connector_set_dirty(CaptiveParentConnector *captive_parent_connector);
112 CaptiveVfsParentObject *captive_parent_connector_get_captive_vfs_parent_object
113                 (CaptiveParentConnector *captive_parent_connector);
114 CORBA_Object captive_parent_connector_get_corba_object(CaptiveParentConnector *captive_parent_connector);
115 gboolean captive_parent_connector_get_dirty(CaptiveParentConnector *captive_parent_connector);
116 gboolean captive_parent_connector_is_state(CaptiveParentConnector *captive_parent_connector,
117                 CaptiveParentConnectorFlagWant vfs_want,
118                 CaptiveParentConnectorFlagWant corba_object_want,CaptiveParentConnectorFlagWant dirty_want);
119
120 G_END_DECLS
121
122
123 #endif /* _CAPTIVE_CLIENT_PRIV_PARENT_CONNECTOR_H */