Tizen 2.1 base
[platform/core/system/sync-agent.git] / include / device-manager / mdm_type.h
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef MDM_TYPE_H_
19 #define MDM_TYPE_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif                          /* __cplusplus */
24
25 /**
26  * @file mdm_type.h
27  * @brief       Provides definition of mdm status enum and various enum related to the password
28  */
29
30 /** @addtogroup device_manager
31  *      @{
32  */
33
34 /**
35  * Function which is called when status is changed
36  *
37  * @param[in] status mdm status
38  * @param[in] userdata user data
39  *
40  * @return
41  *
42  * @par Since:
43  *
44  *
45  * @see dm_register_mdm_callback(int, sync_agent_dm_mdm_event_e, sync_agent_device_manager_cb, void*)
46  *
47  */
48         typedef int (*sync_agent_device_manager_cb) (int status, void *userdata);
49
50 /**
51  * Enumerations of mdm status
52  */
53         typedef enum {
54                 sync_agent_dm_mdm_status_e_ERROR = -1,
55
56                 SYNC_AGENT_DM_MDM_ALLOWED = 0,
57                 SYNC_AGENT_DM_MDM_RESTRICTED = 1,
58
59                 SYNC_AGENT_DM_MDM_ENABLED = 0,
60                 SYNC_AGENT_DM_MDM_DISABLED = 1,
61
62                 SYNC_AGENT_DM_MDM_FALSE = 0,
63                 SYNC_AGENT_DM_MDM_TRUE = 1,
64
65                 SYNC_AGENT_DM_MDM_BT_ALLOWED = 0,    /**<  */
66                 SYNC_AGENT_DM_MDM_BT_RESTRICTED = 1,
67                 SYNC_AGENT_DM_MDM_BT_HANDSFREE_ONLY = 2,
68         } sync_agent_dm_mdm_status_e;
69
70 /**
71  * Enumerations of password quality
72  */
73         typedef enum {
74                 SYNC_AGENT_DM_MDM_PWD_QUALITY_UNSPECIFIED,
75                                                         /**< No requirements for password. */
76                 SYNC_AGENT_DM_MDM_PWD_QUALITY_SOMETHING,        /**< Some kind password is required, but doesn't care what it is */
77                 SYNC_AGENT_DM_MDM_PWD_QUALITY_NUMERIC,  /**< Containing at least numeric characters */
78                 SYNC_AGENT_DM_MDM_PWD_QUALITY_ALPHABETIC,       /**< Containing at least alphabetic (or other symbol) characters */
79                 SYNC_AGENT_DM_MDM_PWD_QUALITY_ALPHANUMERIC,
80                                                         /**< Containing at least numeric and alphabetic characters */
81         } sync_agent_dm_mdm_pwd_quality_type_e;
82
83 /**
84  * Enumerations of password change status
85  */
86         typedef enum {
87                 SYNC_AGENT_DM_MDM_PWD_CHANGED,
88                                        /**< Password successfully set or changed */
89                 SYNC_AGENT_DM_MDM_PWD_FAILED,
90                                       /**< Device unlock failed */
91                 SYNC_AGENT_DM_MDM_PWD_SUCCEEDED,
92                                          /**< Device unlock succeeded */
93                 SYNC_AGENT_DM_MDM_PWD_EXPIRED,
94                                        /**< Password expired */
95
96                 SYNC_AGENT_DM_MDM_RECOVERY_PASSWORD_FAILED,
97                                                     /**< Device unlock failed by Password recovery */
98                 SYNC_AGENT_DM_MDM_RECOVERY_PASSWORD_SUCCEEDED,
99                                                        /**< Device unlock succeeded by Password recovery */
100
101                 SYNC_AGENT_DM_MDM_PWD_QUALITY_CHANGED,
102                                                /**< Password quality successfully changed */
103                 SYNC_AGENT_DM_MDM_PWD_MIN_LENGTH_CHANGED,
104                                                   /**< Password min_length successfully changed */
105                 SYNC_AGENT_DM_MDM_PWD_COMPLEX_CHAR_CHANGED,
106                                                     /**< Password complex_char successfully changed */
107                 SYNC_AGENT_DM_MDM_PWD_PATTERN_CHANGED,
108                                                /**< Password pattern successfully changed */
109
110                 SYNC_AGENT_DM_MDM_PWD_STATUS_MAX
111         } sync_agent_dm_mdm_password_status_e;
112
113 /**
114  * Enumerations of password policy
115  */
116         typedef struct _sync_agent_dm_mdm_password_policy_s {
117                 int quality;
118                      /**< pwd quailty passwd length , refer to mdm_password_quality_t */
119                 int min_length;
120                         /**< minimum passwd length */
121                 int max_num_wipe;
122                           /**< maximum fail for wipe */
123                 int expire;
124                     /**< expire time */
125                 int min_complex;
126                          /**< minimum complex */
127                 int history_cnt;
128                          /**< history count */
129                 int recoverable;
130                          /**< password recovery enabled */
131         } sync_agent_dm_mdm_password_policy_s;
132
133 /**
134  *      @}
135  */
136
137 #ifdef __cplusplus
138 }
139 #endif                          /* __cplusplus */
140 #endif                          /* MDM_TYPE_H_ */