Update to upstream 1.0.1
[profile/ivi/gsignond.git] / src / common / gsignond-identity-info-internal.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * This file is part of gsignond
5  *
6  * Copyright (C) 2012 Intel Corporation.
7  *
8  * Contact: Imran Zaman <imran.zaman@linux.intel.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA
24  */
25
26 #ifndef __GSIGNOND_IDENTITY_INFO_INTERNAL_H__
27 #define __GSIGNOND_IDENTITY_INFO_INTERNAL_H__
28
29 #include <glib.h>
30 #include "gsignond-identity-info.h"
31
32 G_BEGIN_DECLS
33
34 #define GSIGNOND_IDENTITY_INFO_NEW_IDENTITY         0
35
36 /*
37  * Identity info strings
38  * */
39 #define GSIGNOND_IDENTITY_INFO_ID                    "Id"
40 #define GSIGNOND_IDENTITY_INFO_USERNAME              "UserName"
41 #define GSIGNOND_IDENTITY_INFO_SECRET                "Secret"
42 #define GSIGNOND_IDENTITY_INFO_STORESECRET           "StoreSecret"
43 #define GSIGNOND_IDENTITY_INFO_CAPTION               "Caption"
44 #define GSIGNOND_IDENTITY_INFO_REALMS                "Realms"
45 #define GSIGNOND_IDENTITY_INFO_AUTHMETHODS           "AuthMethods"
46 #define GSIGNOND_IDENTITY_INFO_OWNER                 "Owner"
47 #define GSIGNOND_IDENTITY_INFO_ACL                   "ACL"
48 #define GSIGNOND_IDENTITY_INFO_TYPE                  "Type"
49 #define GSIGNOND_IDENTITY_INFO_REFCOUNT              "RefCount"
50 #define GSIGNOND_IDENTITY_INFO_VALIDATED             "Validated"
51 #define GSIGNOND_IDENTITY_INFO_USERNAME_IS_SECRET    "UserNameSecret"
52
53 #define GSIGNOND_IDENTITY_INFO_EDIT_FLAGS            "EditFlags"
54
55 typedef enum {
56     IDENTITY_INFO_PROP_NONE = 0x0000,
57     
58     /* Secret fields */
59     IDENTITY_INFO_PROP_USERNAME = 0x0001,
60     IDENTITY_INFO_PROP_SECRET = 0x0002,
61
62     IDENTITY_INFO_PROP_ID = 0x0004,
63     IDENTITY_INFO_PROP_TYPE = 0x0008,
64     IDENTITY_INFO_PROP_CAPTION = 0x0010,
65     IDENTITY_INFO_PROP_STORE_SECRET = 0x0020,
66     IDENTITY_INFO_PROP_USERNAME_IS_SECRET = 0x0040,
67     IDENTITY_INFO_PROP_OWNER = 0x0080,
68     IDENTITY_INFO_PROP_ACL = 0x0100,
69     IDENTITY_INFO_PROP_METHODS = 0x0200,
70     IDENTITY_INFO_PROP_REALMS = 0x0400,
71     IDENTITY_INFO_PROP_REF_COUNT = 0x0800,
72     IDENTITY_INFO_PROP_VALIDATED = 0x1000,
73
74     IDENTITY_INFO_PROP_MAX = 0x2000,
75     IDENTITY_INFO_PROP_ALL = 0x1ffff
76
77 } GSignondIdentityInfoPropFlags;
78
79 GSignondIdentityInfoPropFlags
80 gsignond_identity_info_get_edit_flags (GSignondIdentityInfo *info);
81
82 gboolean
83 gsignond_identity_info_set_edit_flags (GSignondIdentityInfo *info,
84                                        GSignondIdentityInfoPropFlags flags);
85
86 gboolean
87 gsignond_identity_info_reset_edit_flags (GSignondIdentityInfo *info,
88                                          GSignondIdentityInfoPropFlags flags);
89
90 gboolean
91 gsignond_identity_info_unset_edit_flags (GSignondIdentityInfo *info,
92                                          GSignondIdentityInfoPropFlags flags);
93
94 GSignondIdentityInfoPropFlags
95 gsignond_identity_info_selective_copy (GSignondIdentityInfo *dest,
96                                        const GSignondIdentityInfo *src,
97                                        GSignondIdentityInfoPropFlags flags);
98
99 void
100 gsignond_identity_info_remove_owner (GSignondIdentityInfo *info);
101
102 G_END_DECLS
103
104 #endif /* __GSIGNOND_IDENTITY_INFO_INTERNAL_H__ */