~ubuntu-branches/ubuntu/precise/telepathy-mission-control-5/precise

« back to all changes in this revision

Viewing changes to mission-control-plugins/account-storage.h

Tags: upstream-5.5.0
Import upstream version 5.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Mission Control plugin API - Account storage hook.
 
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_STORAGE_H
 
22
#define MCP_ACCOUNT_STORAGE_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
#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_READONLY -1
 
31
#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_DEFAULT   0
 
32
#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_NORMAL    100
 
33
#define MCP_ACCOUNT_STORAGE_PLUGIN_PRIO_KEYRING   10000
 
34
 
 
35
/* API for plugins to implement */
 
36
typedef struct _McpAccountStorage McpAccountStorage;
 
37
typedef struct _McpAccountStorageIface McpAccountStorageIface;
 
38
 
 
39
#define MCP_TYPE_ACCOUNT_STORAGE (mcp_account_storage_get_type ())
 
40
 
 
41
#define MCP_ACCOUNT_STORAGE(o) \
 
42
  (G_TYPE_CHECK_INSTANCE_CAST ((o), MCP_TYPE_ACCOUNT_STORAGE, \
 
43
      McpAccountStorage))
 
44
 
 
45
#define MCP_IS_ACCOUNT_STORAGE(o) \
 
46
  (G_TYPE_CHECK_INSTANCE_TYPE ((o), MCP_TYPE_ACCOUNT_STORAGE))
 
47
 
 
48
#define MCP_ACCOUNT_STORAGE_GET_IFACE(o) \
 
49
  (G_TYPE_INSTANCE_GET_INTERFACE ((o), MCP_TYPE_ACCOUNT_STORAGE, \
 
50
                                  McpAccountStorageIface))
 
51
 
 
52
GType mcp_account_storage_get_type (void) G_GNUC_CONST;
 
53
 
 
54
/* virtual methods */
 
55
void
 
56
mcp_account_storage_iface_set_priority (McpAccountStorageIface *iface,
 
57
    guint prio);
 
58
 
 
59
void mcp_account_storage_iface_set_name (McpAccountStorageIface *iface,
 
60
    const gchar *name);
 
61
 
 
62
void mcp_account_storage_iface_set_desc (McpAccountStorageIface *iface,
 
63
    const gchar *desc);
 
64
 
 
65
void mcp_account_storage_iface_implement_get (McpAccountStorageIface *iface,
 
66
    gboolean (*method) (
 
67
        const McpAccountStorage *,
 
68
        const McpAccountManager *,
 
69
        const gchar *,
 
70
        const gchar *));
 
71
 
 
72
void mcp_account_storage_iface_implement_set (McpAccountStorageIface *iface,
 
73
    gboolean (*method) (
 
74
        const McpAccountStorage *,
 
75
        const McpAccountManager *,
 
76
        const gchar *,
 
77
        const gchar *,
 
78
        const gchar *));
 
79
 
 
80
void mcp_account_storage_iface_implement_delete (McpAccountStorageIface *iface,
 
81
    gboolean (*method) (
 
82
        const McpAccountStorage *,
 
83
        const McpAccountManager *,
 
84
        const gchar *,
 
85
        const gchar *));
 
86
 
 
87
void mcp_account_storage_iface_implement_list (McpAccountStorageIface *iface,
 
88
    GList * (*method) (
 
89
        const McpAccountStorage *,
 
90
        const McpAccountManager *));
 
91
 
 
92
void
 
93
mcp_account_storage_iface_implement_commit (McpAccountStorageIface *iface,
 
94
    gboolean (*method) (const McpAccountStorage *, const McpAccountManager *am));
 
95
 
 
96
void
 
97
mcp_account_storage_iface_implement_ready (McpAccountStorageIface *iface,
 
98
    void (*method) (
 
99
        const McpAccountStorage *storage,
 
100
        const McpAccountManager *am));
 
101
 
 
102
gint mcp_account_storage_priority (const McpAccountStorage *storage);
 
103
 
 
104
gboolean mcp_account_storage_get (const McpAccountStorage *storage,
 
105
    McpAccountManager *am,
 
106
    const gchar *acct,
 
107
    const gchar *key);
 
108
 
 
109
gboolean mcp_account_storage_set (const McpAccountStorage *storage,
 
110
    const McpAccountManager *am,
 
111
    const gchar *acct,
 
112
    const gchar *key,
 
113
    const gchar *val);
 
114
 
 
115
gboolean mcp_account_storage_delete (const McpAccountStorage *storage,
 
116
    const McpAccountManager *am,
 
117
    const gchar *acct,
 
118
    const gchar *key);
 
119
 
 
120
void mcp_account_storage_ready (const McpAccountStorage *storage,
 
121
    const McpAccountManager *am);
 
122
 
 
123
gboolean
 
124
mcp_account_storage_commit (const McpAccountStorage *storage,
 
125
    const McpAccountManager *am);
 
126
 
 
127
GList *mcp_account_storage_list (const McpAccountStorage *storage,
 
128
    const McpAccountManager *am);
 
129
 
 
130
const gchar *mcp_account_storage_name (const McpAccountStorage *storage);
 
131
 
 
132
const gchar *mcp_account_storage_description (const McpAccountStorage *storage);
 
133
 
 
134
G_END_DECLS
 
135
 
 
136
#endif