1 /* Mission Control plugin API - internals, for MC to use for account storage
2  *
3  * Copyright © 2010 Nokia Corporation
4  * Copyright © 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_ACCOUNT_MANAGER_H
22 #define MCP_ACCOUNT_MANAGER_H
23 
24 #ifndef _MCP_IN_MISSION_CONTROL_PLUGINS_H
25 #error Use <mission-control-plugins/mission-control-plugins.h> instead
26 #endif
27 
28 G_BEGIN_DECLS
29 
30 typedef struct _McpAccountManager McpAccountManager;
31 typedef struct _McpAccountManagerIface McpAccountManagerIface;
32 
33 #define MCP_TYPE_ACCOUNT_MANAGER (mcp_account_manager_get_type ())
34 
35 #define MCP_ACCOUNT_MANAGER(o) \
36   (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_ACCOUNT_MANAGER, \
37       McpAccountManager))
38 
39 #define MCP_IS_ACCOUNT_MANAGER(o) \
40   (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_ACCOUNT_MANAGER))
41 
42 #define MCP_ACCOUNT_MANAGER_GET_IFACE(o) \
43   (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_ACCOUNT_MANAGER, \
44       McpAccountManagerIface))
45 
46 GType mcp_account_manager_get_type (void) G_GNUC_CONST;
47 
48 void mcp_account_manager_set_value (const McpAccountManager *mcpa,
49     const gchar *account,
50     const gchar *key,
51     const gchar *value);
52 
53 void mcp_account_manager_set_attribute (const McpAccountManager *mcpa,
54     const gchar *account,
55     const gchar *attribute,
56     GVariant *value,
57     McpAttributeFlags flags);
58 
59 void mcp_account_manager_set_parameter (const McpAccountManager *mcpa,
60     const gchar *account,
61     const gchar *parameter,
62     GVariant *value,
63     McpParameterFlags flags);
64 
65 gchar * mcp_account_manager_get_value (const McpAccountManager *mcpa,
66     const gchar *account,
67     const gchar *key);
68 
69 gboolean mcp_account_manager_parameter_is_secret (const McpAccountManager *mcpa,
70     const gchar *account,
71     const gchar *key);
72 
73 void mcp_account_manager_parameter_make_secret (const McpAccountManager *mcpa,
74     const gchar *account,
75     const gchar *key);
76 
77 gchar * mcp_account_manager_get_unique_name (McpAccountManager *mcpa,
78     const gchar *manager,
79     const gchar *protocol,
80     const GHashTable *params);
81 
82 GStrv mcp_account_manager_list_keys (const McpAccountManager *mcpa,
83     const gchar *account);
84 
85 gchar *mcp_account_manager_escape_value_for_keyfile (
86     const McpAccountManager *mcpa,
87     const GValue *value);
88 
89 gchar *mcp_account_manager_escape_variant_for_keyfile (
90     const McpAccountManager *mcpa,
91     GVariant *variant);
92 
93 gboolean mcp_account_manager_unescape_value_from_keyfile (
94     const McpAccountManager *mcpa,
95     const gchar *escaped,
96     GValue *value,
97     GError **error);
98 
99 gboolean mcp_account_manager_init_value_for_attribute (
100     const McpAccountManager *mcpa,
101     GValue *value,
102     const gchar *attribute);
103 
104 G_END_DECLS
105 
106 #endif
107