1 /* 2 * my-conn-proxy.h - header for a simple subclass of TpConnection 3 * 4 * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/> 5 * 6 * Copying and distribution of this file, with or without modification, 7 * are permitted in any medium without royalty provided the copyright 8 * notice and this notice are preserved. 9 */ 10 11 #ifndef __TP_TESTS_MY_CONN_PROXY_H__ 12 #define __TP_TESTS_MY_CONN_PROXY_H__ 13 14 #include <glib-object.h> 15 #include <telepathy-glib/telepathy-glib.h> 16 17 18 G_BEGIN_DECLS 19 20 typedef struct _TpTestsMyConnProxy TpTestsMyConnProxy; 21 typedef struct _TpTestsMyConnProxyClass TpTestsMyConnProxyClass; 22 typedef struct _TpTestsMyConnProxyPrivate TpTestsMyConnProxyPrivate; 23 24 struct _TpTestsMyConnProxyClass { 25 TpConnectionClass parent_class; 26 }; 27 28 typedef enum 29 { 30 BEFORE_CONNECTED_STATE_UNPREPARED = 0, 31 BEFORE_CONNECTED_STATE_NOT_CONNECTED, 32 BEFORE_CONNECTED_STATE_CONNECTED, 33 } TpTestsMyConnProxyBeforeConnectedState; 34 35 36 struct _TpTestsMyConnProxy { 37 TpConnection parent; 38 39 gboolean retry_feature_success; 40 TpTestsMyConnProxyBeforeConnectedState before_connected_state; 41 }; 42 43 GType tp_tests_my_conn_proxy_get_type (void); 44 45 /* TYPE MACROS */ 46 #define TP_TESTS_TYPE_MY_CONN_PROXY \ 47 (tp_tests_my_conn_proxy_get_type ()) 48 #define TP_TESTS_MY_CONN_PROXY(obj) \ 49 (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_MY_CONN_PROXY, \ 50 TpTestsMyConnProxy)) 51 #define TP_TESTS_MY_CONN_PROXY_CLASS(klass) \ 52 (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_MY_CONN_PROXY, \ 53 TpTestsMyConnProxyClass)) 54 #define TP_TESTS_SIMPLE_IS_MY_CONN_PROXY(obj) \ 55 (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_MY_CONN_PROXY)) 56 #define TP_TESTS_SIMPLE_IS_MY_CONN_PROXY_CLASS(klass) \ 57 (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_MY_CONN_PROXY)) 58 #define TP_TESTS_MY_CONN_PROXY_GET_CLASS(obj) \ 59 (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_MY_CONN_PROXY, \ 60 TpTestsMyConnProxyClass)) 61 62 /* Core feature */ 63 #define TP_TESTS_MY_CONN_PROXY_FEATURE_CORE \ 64 (tp_tests_my_conn_proxy_get_feature_quark_core ()) 65 GQuark tp_tests_my_conn_proxy_get_feature_quark_core (void) G_GNUC_CONST; 66 67 /* No depends */ 68 #define TP_TESTS_MY_CONN_PROXY_FEATURE_A \ 69 (tp_tests_my_conn_proxy_get_feature_quark_a ()) 70 GQuark tp_tests_my_conn_proxy_get_feature_quark_a (void) G_GNUC_CONST; 71 72 /* Depends on A */ 73 #define TP_TESTS_MY_CONN_PROXY_FEATURE_B \ 74 (tp_tests_my_conn_proxy_get_feature_quark_b ()) 75 GQuark tp_tests_my_conn_proxy_get_feature_quark_b (void) G_GNUC_CONST; 76 77 /* Depends on an unimplemented iface */ 78 #define TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE \ 79 (tp_tests_my_conn_proxy_get_feature_quark_wrong_iface ()) 80 GQuark tp_tests_my_conn_proxy_get_feature_quark_wrong_iface (void) G_GNUC_CONST; 81 82 /* Depends on WRONG_IFACE */ 83 #define TP_TESTS_MY_CONN_PROXY_FEATURE_BAD_DEP \ 84 (tp_tests_my_conn_proxy_get_feature_quark_bad_dep ()) 85 GQuark tp_tests_my_conn_proxy_get_feature_quark_bad_dep (void) G_GNUC_CONST; 86 87 /* Fail during preparation */ 88 #define TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL \ 89 (tp_tests_my_conn_proxy_get_feature_quark_fail ()) 90 GQuark tp_tests_my_conn_proxy_get_feature_quark_fail (void) G_GNUC_CONST; 91 92 /* Depends on FAIL */ 93 #define TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL_DEP \ 94 (tp_tests_my_conn_proxy_get_feature_quark_fail_dep ()) 95 GQuark tp_tests_my_conn_proxy_get_feature_quark_fail_dep (void) G_GNUC_CONST; 96 97 /* Fail at first attempt but succeed after */ 98 #define TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY \ 99 (tp_tests_my_conn_proxy_get_feature_quark_retry ()) 100 GQuark tp_tests_my_conn_proxy_get_feature_quark_retry (void) G_GNUC_CONST; 101 102 /* Depends on FEATURE_RETRY */ 103 #define TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP \ 104 (tp_tests_my_conn_proxy_get_feature_quark_retry_dep ()) 105 GQuark tp_tests_my_conn_proxy_get_feature_quark_retry_dep (void) G_GNUC_CONST; 106 107 /* Can be prepared before the connection is connected and block announcing the 108 * connected state */ 109 #define TP_TESTS_MY_CONN_PROXY_FEATURE_BEFORE_CONNECTED \ 110 (tp_tests_my_conn_proxy_get_feature_quark_before_connected ()) 111 GQuark tp_tests_my_conn_proxy_get_feature_quark_before_connected (void) G_GNUC_CONST; 112 113 #define TP_TESTS_MY_CONN_PROXY_IFACE_LATER "org.freedesktop.Telepathy.Conncetion.Interface.Test.Later" 114 115 /* Need the interface TP_TESTS_MY_CONN_PROXY_IFACE_LATER to be prepared but 116 * this interface is not in the initial set of interfaces of the connection. 117 * It is added when the connection is connected. */ 118 #define TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER \ 119 (tp_tests_my_conn_proxy_get_feature_quark_interface_later ()) 120 GQuark tp_tests_my_conn_proxy_get_feature_quark_interface_later (void) G_GNUC_CONST; 121 122 G_END_DECLS 123 124 #endif /* #ifndef __TP_TESTS_MY_CONN_PROXY_H__ */ 125