1 /* Mission Control plugin API - internals, for MC to use 2 * 3 * Copyright © 2009-2010 Nokia Corporation 4 * Copyright © 2009-2010 Collabora Ltd. 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 #ifndef MCP_IMPLEMENTATION_H 22 #define MCP_IMPLEMENTATION_H 23 24 #include <mission-control-plugins/mission-control-plugins.h> 25 26 G_BEGIN_DECLS 27 28 struct _McpRequestIface { 29 GTypeInterface parent; 30 31 /* Account */ 32 const gchar * (*get_account_path) (McpRequest *self); 33 const gchar * (*get_protocol) (McpRequest *self); 34 const gchar * (*get_cm_name) (McpRequest *self); 35 36 gint64 (*get_user_action_time) (McpRequest *self); 37 guint (*get_n_requests) (McpRequest *self); 38 GHashTable * (*ref_nth_request) (McpRequest *self, guint n); 39 40 void (*deny) (McpRequest *self, GQuark domain, gint code, 41 const gchar *message); 42 43 /* Delay the request */ 44 McpRequestDelay * (*start_delay) (McpRequest *self); 45 void (*end_delay) (McpRequest *self, 46 McpRequestDelay *delay); 47 }; 48 49 struct _McpDispatchOperationIface { 50 GTypeInterface parent; 51 52 /* Account and Connection */ 53 const gchar * (*get_account_path) (McpDispatchOperation *self); 54 const gchar * (*get_connection_path) (McpDispatchOperation *self); 55 const gchar * (*get_protocol) (McpDispatchOperation *self); 56 const gchar * (*get_cm_name) (McpDispatchOperation *self); 57 58 /* Channels */ 59 guint (*get_n_channels) (McpDispatchOperation *self); 60 const gchar * (*get_nth_channel_path) (McpDispatchOperation *self, 61 guint n); 62 GHashTable * (*ref_nth_channel_properties) (McpDispatchOperation *self, 63 guint n); 64 65 /* Delay the dispatch */ 66 McpDispatchOperationDelay * (*start_delay) (McpDispatchOperation *self); 67 void (*end_delay) (McpDispatchOperation *self, 68 McpDispatchOperationDelay *delay); 69 70 /* Close */ 71 void (*leave_channels) (McpDispatchOperation *self, 72 gboolean wait_for_observers, TpChannelGroupChangeReason reason, 73 const gchar *message); 74 void (*close_channels) (McpDispatchOperation *self, 75 gboolean wait_for_observers); 76 void (*destroy_channels) (McpDispatchOperation *self, 77 gboolean wait_for_observers); 78 }; 79 80 struct _McpAccountManagerIface { 81 GTypeInterface parent; 82 83 void (*set_value) (const McpAccountManager *ma, 84 const gchar *acct, 85 const gchar *key, 86 const gchar *value); 87 88 gchar * (*get_value) (const McpAccountManager *ma, 89 const gchar *acct, 90 const gchar *key); 91 92 gboolean (*is_secret) (const McpAccountManager *ma, 93 const gchar *acct, 94 const gchar *key); 95 96 void (* make_secret) (const McpAccountManager *ma, 97 const gchar *acct, 98 const gchar *key); 99 100 gchar * (* unique_name) (const McpAccountManager *ma, 101 const gchar *manager, 102 const gchar *protocol, 103 const GHashTable *params); 104 105 GStrv (* list_keys) (const McpAccountManager *ma, 106 const gchar *acct); 107 108 gchar * (* escape_value_for_keyfile) (const McpAccountManager *mcpa, 109 const GValue *value); 110 111 gboolean (* unescape_value_from_keyfile) (const McpAccountManager *mcpa, 112 const gchar *escaped, 113 GValue *value, 114 GError **error); 115 116 gboolean (* init_value_for_attribute) (const McpAccountManager *mcpa, 117 GValue *value, 118 const gchar *attribute); 119 120 gchar * (* escape_variant_for_keyfile) (const McpAccountManager *mcpa, 121 GVariant *variant); 122 123 void (* set_attribute) (const McpAccountManager *mcpa, 124 const gchar *account, 125 const gchar *attribute, 126 GVariant *value, 127 McpAttributeFlags flags); 128 129 void (* set_parameter) (const McpAccountManager *mcpa, 130 const gchar *account, 131 const gchar *parameter, 132 GVariant *value, 133 McpParameterFlags flags); 134 }; 135 136 G_END_DECLS 137 138 #endif 139