1 /* vi: set et sw=4 ts=8 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 8 -*- */
3 /*
4  * This file is part of mission-control
5  *
6  * Copyright (C) 2007-2009 Nokia Corporation.
7  *
8  * Contact: Naba Kumar  <naba.kumar@nokia.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public License
12  * version 2.1 as published by the Free Software Foundation.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  *
24  */
25 
26 #ifndef __MCD_CONNECTION_H__
27 #define __MCD_CONNECTION_H__
28 
29 #include <glib.h>
30 #include <glib-object.h>
31 #include <telepathy-glib/telepathy-glib.h>
32 
33 #include "connectivity-monitor.h" /* for McdInhibit */
34 #include "mcd-operation.h"
35 
36 G_BEGIN_DECLS
37 #define MCD_TYPE_CONNECTION            (mcd_connection_get_type())
38 #define MCD_CONNECTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MCD_TYPE_CONNECTION, McdConnection))
39 #define MCD_CONNECTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MCD_TYPE_CONNECTION, McdConnectionClass))
40 #define MCD_IS_CONNECTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MCD_TYPE_CONNECTION))
41 #define MCD_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MCD_TYPE_CONNECTION))
42 #define MCD_CONNECTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), MCD_TYPE_CONNECTION, McdConnectionClass))
43 
44 typedef struct _McdConnection McdConnection;
45 typedef struct _McdConnectionPrivate McdConnectionPrivate;
46 typedef struct _McdConnectionClass McdConnectionClass;
47 
48 #include "mcd-channel.h"
49 
50 struct _McdConnection
51 {
52     McdOperation parent;
53     McdConnectionPrivate *priv;
54 };
55 
56 struct _McdConnectionClass
57 {
58     McdOperationClass parent_class;
59 };
60 
61 #include "mcd-dispatcher.h"
62 
63 GType mcd_connection_get_type (void);
64 
65 const gchar *mcd_connection_get_object_path (McdConnection *connection);
66 const gchar *mcd_connection_get_name (McdConnection *connection);
67 
68 /* Return the connection's account */
69 McdAccount *mcd_connection_get_account (McdConnection * connection);
70 
71 TpConnection *mcd_connection_get_tp_connection (McdConnection *connection);
72 
73 gboolean mcd_connection_request_channel (McdConnection *connection,
74 					 McdChannel *channel);
75 
76 void mcd_connection_close (McdConnection *connection,
77                            McdInhibit *inhibit);
78 
79 McdChannel * mcd_connection_find_channel_by_path (McdConnection *connection,
80     const gchar *object_path);
81 
82 void mcd_connection_add_emergency_handle (McdConnection *self, TpHandle handle);
83 
84 G_END_DECLS
85 #endif /* __MCD_CONNECTION_H__ */
86