1 /* 2 * account-request.h - object for a currently non-existent account to create 3 * 4 * Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/> 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 */ 20 21 #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) 22 #error "Only <telepathy-glib/telepathy-glib.h> and <telepathy-glib/telepathy-glib-dbus.h> can be included directly." 23 #endif 24 25 #ifndef TP_ACCOUNT_REQUEST_H 26 #define TP_ACCOUNT_REQUEST_H 27 28 #include <telepathy-glib/account-manager.h> 29 #include <telepathy-glib/defs.h> 30 #include <telepathy-glib/protocol.h> 31 32 G_BEGIN_DECLS 33 34 typedef struct _TpAccountRequest TpAccountRequest; 35 typedef struct _TpAccountRequestClass TpAccountRequestClass; 36 typedef struct _TpAccountRequestPrivate TpAccountRequestPrivate; 37 38 struct _TpAccountRequest { 39 /*<private>*/ 40 GObject parent; 41 TpAccountRequestPrivate *priv; 42 }; 43 44 struct _TpAccountRequestClass { 45 /*<private>*/ 46 GObjectClass parent_class; 47 GCallback _padding[7]; 48 }; 49 50 GType tp_account_request_get_type (void); 51 52 #define TP_TYPE_ACCOUNT_REQUEST \ 53 (tp_account_request_get_type ()) 54 #define TP_ACCOUNT_REQUEST(obj) \ 55 (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ACCOUNT_REQUEST, \ 56 TpAccountRequest)) 57 #define TP_ACCOUNT_REQUEST_CLASS(klass) \ 58 (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_ACCOUNT_REQUEST, \ 59 TpAccountRequestClass)) 60 #define TP_IS_ACCOUNT_REQUEST(obj) \ 61 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ACCOUNT_REQUEST)) 62 #define TP_IS_ACCOUNT_REQUEST_CLASS(klass) \ 63 (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_ACCOUNT_REQUEST)) 64 #define TP_ACCOUNT_REQUEST_GET_CLASS(obj) \ 65 (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ACCOUNT_REQUEST, \ 66 TpAccountRequestClass)) 67 68 _TP_AVAILABLE_IN_0_20 69 TpAccountRequest * tp_account_request_new ( 70 TpAccountManager *account_manager, 71 const gchar *manager, 72 const gchar *protocol, 73 const gchar *display_name) G_GNUC_WARN_UNUSED_RESULT; 74 75 _TP_AVAILABLE_IN_0_20 76 TpAccountRequest * tp_account_request_new_from_protocol ( 77 TpAccountManager *account_manager, 78 TpProtocol *protocol, 79 const gchar *display_name) G_GNUC_WARN_UNUSED_RESULT; 80 81 _TP_AVAILABLE_IN_0_20 82 void tp_account_request_set_display_name (TpAccountRequest *self, 83 const gchar *name); 84 85 _TP_AVAILABLE_IN_0_20 86 void tp_account_request_set_icon_name (TpAccountRequest *self, 87 const gchar *icon); 88 89 _TP_AVAILABLE_IN_0_20 90 void tp_account_request_set_nickname (TpAccountRequest *self, 91 const gchar *nickname); 92 93 _TP_AVAILABLE_IN_0_20 94 void tp_account_request_set_requested_presence (TpAccountRequest *self, 95 TpConnectionPresenceType presence, 96 const gchar *status, const gchar *message); 97 98 _TP_AVAILABLE_IN_0_20 99 void tp_account_request_set_automatic_presence (TpAccountRequest *self, 100 TpConnectionPresenceType presence, 101 const gchar *status, const gchar *message); 102 103 _TP_AVAILABLE_IN_0_20 104 void tp_account_request_set_enabled (TpAccountRequest *self, 105 gboolean enabled); 106 107 _TP_AVAILABLE_IN_0_20 108 void tp_account_request_set_connect_automatically (TpAccountRequest *self, 109 gboolean connect_automatically); 110 111 _TP_AVAILABLE_IN_0_20 112 void tp_account_request_add_supersedes (TpAccountRequest *self, 113 const gchar *superseded_path); 114 115 _TP_AVAILABLE_IN_0_20 116 void tp_account_request_set_avatar (TpAccountRequest *self, 117 const guchar *avatar, gsize len, const gchar *mime_type); 118 119 _TP_AVAILABLE_IN_0_20 120 void tp_account_request_set_service (TpAccountRequest *self, 121 const gchar *service); 122 123 _TP_AVAILABLE_IN_0_20 124 void tp_account_request_set_storage_provider (TpAccountRequest *self, 125 const gchar *provider); 126 127 /* parameters */ 128 _TP_AVAILABLE_IN_0_20 129 void tp_account_request_set_parameter (TpAccountRequest *self, 130 const gchar *key, 131 GVariant *value); 132 133 _TP_AVAILABLE_IN_0_20 134 void tp_account_request_unset_parameter (TpAccountRequest *self, 135 const gchar *key); 136 137 _TP_AVAILABLE_IN_0_20 138 void tp_account_request_set_parameter_string (TpAccountRequest *self, 139 const gchar *key, 140 const gchar *value); 141 142 /* create it */ 143 _TP_AVAILABLE_IN_0_20 144 void tp_account_request_create_account_async (TpAccountRequest *self, 145 GAsyncReadyCallback callback, 146 gpointer user_data); 147 148 _TP_AVAILABLE_IN_0_20 149 TpAccount * tp_account_request_create_account_finish (TpAccountRequest *self, 150 GAsyncResult *result, 151 GError **error) G_GNUC_WARN_UNUSED_RESULT; 152 153 G_END_DECLS 154 155 #endif 156