4 * Copyright (c) 2010 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Tarun Kumar <tarun.kr@samsung.com>, Sukumar Moharana <msukumar@samsung.com>, Wonyoung Lee <wy1115.lee@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __ACCOUNT_PRIVATE_TYPES_H__
23 #define __ACCOUNT_PRIVATE_TYPES_H__
34 #define _ACCOUNT_FREE(ptr) \
41 #define _ACCOUNT_GFREE(ptr) \
47 #define ACCOUNT_DB_NAME "/opt/dbspace/.account.db"
48 #define ACCOUNT_TABLE "account"
49 #define CAPABILITY_TABLE "capability"
50 #define ACCOUNT_SQLITE_SEQ "sqlite_sequence"
51 #define ACCOUNT_SQL_LEN_MAX 1024
52 #define ACCOUNT_TABLE_TOTAL_COUNT 2
54 typedef struct _account_s
64 char* domain_name; /*< domain name [Ex: google, facebook, twitter, samsung, ...] */
65 /*int service_type;*/ /* ACCOUNT_CATEGORY*/
68 int user_data_int[USER_INT_CNT];
69 char* user_data_txt[USER_TXT_CNT];
70 GSList* capablity_list;
74 typedef struct _capability_s
82 }account_capability_s;
85 * @brief Enumarations for account handle fields.
89 ACCOUNT_FIELD_NONE = -1,
91 ACCOUNT_FIELD_USER_NAME,
92 ACCOUNT_FIELD_EMAIL_ADDRESS,
93 ACCOUNT_FIELD_DISPLAY_NAME,
94 ACCOUNT_FIELD_ICON_PATH,
96 ACCOUNT_FIELD_PACKAGE_NAME,
97 ACCOUNT_FIELD_ACCESS_TOKEN,
98 ACCOUNT_FIELD_DOMAIN_NAME,
99 ACCOUNT_FIELD_AUTH_TYPE,
100 ACCOUNT_FIELD_SECRET,
101 ACCOUNT_FIELD_USER_TEXT_0,
102 ACCOUNT_FIELD_USER_TEXT_1,
103 ACCOUNT_FIELD_USER_TEXT_2,
104 ACCOUNT_FIELD_USER_TEXT_3,
105 ACCOUNT_FIELD_USER_TEXT_4,
106 ACCOUNT_FIELD_USER_INT_0,
107 ACCOUNT_FIELD_USER_INT_1,
108 ACCOUNT_FIELD_USER_INT_2,
109 ACCOUNT_FIELD_USER_INT_3,
110 ACCOUNT_FIELD_USER_INT_4,
111 ACCOUNT_DB_FIELD_END,
115 * @brief Enumarations for capability fields.
119 CAPABILITY_FIELD_NONE = -1,
121 CAPABILITY_FIELD_KEY,
122 CAPABILITY_FIELD_VALUE,
123 CAPABILITY_FIELD_PACKAGE_NAME,
124 CAPABILITY_FIELD_USER_NAME,
125 CAPABILITY_FIELD_ACCOUNT_ID,
126 CAPABILITY_FIELD_END,
130 typedef sqlite3_stmt* account_stmt;
132 #define ACCOUNT_SCHEMA "create table %s \n"\
134 "_id INTEGER PRIMARY KEY AUTOINCREMENT, "\
136 "email_address TEXT, "\
137 "display_name TEXT, "\
140 "package_name TEXT, "\
141 "access_token TEXT, "\
142 "domain_name TEXT, "\
143 "auth_type INTEGER, "\
145 "txt_custom0 TEXT, "\
146 "txt_custom1 TEXT, "\
147 "txt_custom2 TEXT, "\
148 "txt_custom3 TEXT, "\
149 "txt_custom4 TEXT, "\
150 "int_custom0 INTEGER, "\
151 "int_custom1 INTEGER, "\
152 "int_custom2 INTEGER, "\
153 "int_custom3 INTEGER, "\
154 "int_custom4 INTEGER "\
157 #define CAPABILITY_SCHEMA "create table %s \n"\
159 "_id INTEGER PRIMARY KEY AUTOINCREMENT, "\
162 "package_name TEXT, "\
164 "account_id INTEGER "\
167 typedef struct GSList account_iterator_s;
173 #endif /* __SLP_ACCOUNT_PRIVATE_TYPES_H__*/