1 | /* libsecret - GLib wrapper for Secret Service |
2 | * |
3 | * Copyright 2011 Red Hat Inc. |
4 | * |
5 | * This program is free software: you can redistribute it and/or modify |
6 | * it under the terms of the GNU Lesser General Public License as published |
7 | * by the Free Software Foundation; either version 2.1 of the licence or (at |
8 | * your option) any later version. |
9 | * |
10 | * See the included COPYING file for more information. |
11 | * |
12 | * Author: Stef Walter <stefw@gnome.org> |
13 | */ |
14 | |
15 | #if !defined (__SECRET_INSIDE_HEADER__) && !defined (SECRET_COMPILATION) |
16 | #error "Only <libsecret/secret.h> can be included directly." |
17 | #endif |
18 | |
19 | #ifndef __SECRET_SCHEMA_H__ |
20 | #define __SECRET_SCHEMA_H__ |
21 | |
22 | #include <glib.h> |
23 | #include <glib-object.h> |
24 | |
25 | G_BEGIN_DECLS |
26 | |
27 | typedef enum { |
28 | SECRET_SCHEMA_ATTRIBUTE_STRING = 0, |
29 | SECRET_SCHEMA_ATTRIBUTE_INTEGER = 1, |
30 | SECRET_SCHEMA_ATTRIBUTE_BOOLEAN = 2, |
31 | } SecretSchemaAttributeType; |
32 | |
33 | typedef struct { |
34 | const gchar* name; |
35 | SecretSchemaAttributeType type; |
36 | } SecretSchemaAttribute; |
37 | |
38 | typedef enum { |
39 | SECRET_SCHEMA_NONE = 0, |
40 | SECRET_SCHEMA_DONT_MATCH_NAME = 1 << 1 |
41 | } SecretSchemaFlags; |
42 | |
43 | typedef struct { |
44 | const gchar *name; |
45 | SecretSchemaFlags flags; |
46 | SecretSchemaAttribute attributes[32]; |
47 | |
48 | /* <private> */ |
49 | gint reserved; |
50 | gpointer reserved1; |
51 | gpointer reserved2; |
52 | gpointer reserved3; |
53 | gpointer reserved4; |
54 | gpointer reserved5; |
55 | gpointer reserved6; |
56 | gpointer reserved7; |
57 | } SecretSchema; |
58 | |
59 | GType secret_schema_get_type (void) G_GNUC_CONST; |
60 | |
61 | SecretSchema * secret_schema_new (const gchar *name, |
62 | SecretSchemaFlags flags, |
63 | ...) G_GNUC_NULL_TERMINATED; |
64 | |
65 | SecretSchema * secret_schema_newv (const gchar *name, |
66 | SecretSchemaFlags flags, |
67 | GHashTable *attribute_names_and_types); |
68 | |
69 | SecretSchema * secret_schema_ref (SecretSchema *schema); |
70 | |
71 | void secret_schema_unref (SecretSchema *schema); |
72 | |
73 | GType secret_schema_attribute_get_type (void) G_GNUC_CONST; |
74 | |
75 | G_END_DECLS |
76 | |
77 | #endif /* __SECRET_SCHEMA_H___ */ |
78 | |