8181e684ed9b3b532ba81d7bccdacc281edb51f5
[platform/core/system/libtracker.git] / include / tracker.h
1 /*
2  * libtracker
3  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
19 #ifndef __LIBTRACKER_TRACKER_H__
20 #define __LIBTRACKER_TRACKER_H__
21
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26
27 /**
28  * @addtogroup  LIBTRACKER_MODULE
29  * @{
30  */
31
32 #include <tizen.h>
33
34 /**
35  * @brief  Enumeration of error codes for libtracker
36  */
37 typedef enum {
38         TRACKER_ERROR_NONE              = TIZEN_ERROR_NONE,              /**< Successful */
39         TRACKER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
40         TRACKER_ERROR_OUT_OF_MEMORY     = TIZEN_ERROR_OUT_OF_MEMORY,     /**< Out of memory */
41         TRACKER_ERROR_IO_ERROR          = TIZEN_ERROR_IO_ERROR,          /**< An input/output error occurred */
42         TRACKER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< No permission to use the API */
43         TRACKER_ERROR_NOT_SUPPORTED     = TIZEN_ERROR_NOT_SUPPORTED,     /**< The api is not supported */
44 } tracker_error_e;
45
46 typedef enum {
47         TRACKER_SERVICE_DOWNLOAD = 1 << 0, /**< download services */
48         TRACKER_SERVICE_MEDIA    = 1 << 1, /**< media operations */
49         TRACKER_SERVICE_NETWORK  = 1 << 2, /**< network services */
50         TRACKER_SERVICE_LOCATION = 1 << 3, /**< location services */
51         TRACKER_SERVICE_SENSOR   = 1 << 4, /**< sensor information */
52         TRACKER_SERVICE_IOT      = 1 << 5, /**< IoT services */
53 } tracker_service_e;
54
55 typedef enum {
56         TRACKER_TYPE_INVALID = -1,
57         TRACKER_TYPE_POWER_LOCK = 0,
58         TRACKER_TYPE_MAX
59 } tracker_type_e;
60
61 /**
62  * @brief   Gets the reference count of @a type tracker
63  * @since_tizen  3.0
64  * @param[in] type  Tracker type
65  * @param[out] count  The reference count of @a type tracker
66  * @return  @c 0 on success,
67  *          otherwise a negative error value
68  * @retval  #TRACKER_ERROR_NONE Successful
69  * @retval  #TRACKER_ERROR_INVALID_PARAMETER The input parameter is invalid
70  * @retval  #TRACKER_ERROR_PERMISSION_DENIED No permission to use the API
71  */
72 int tracker_get_ref_counter(tracker_type_e type, int *count);
73
74 /**
75  * @brief   Gets the total count of @a type tracker
76  * @since_tizen  3.0
77  * @param[in] type  Tracker type
78  * @param[out] count  The total count of @a type tracker
79  * @return  @c 0 on success,
80  *          otherwise a negative error value
81  * @retval  #TRACKER_ERROR_NONE Successful
82  * @retval  #TRACKER_ERROR_INVALID_PARAMETER The input parameter is invalid
83  * @retval  #TRACKER_ERROR_PERMISSION_DENIED No permission to use the API
84  */
85 int tracker_get_tick(tracker_type_e type, int *count);
86
87 /**
88  * @brief   Start tracking for information of services
89  * @details  This API should be used only in the framework, not in applications
90  * @since_tizen  3.0
91  * @param[in] services  The services to use internally
92  * @return  @c 0 on success,
93  *          otherwise a negative error value
94  * @retval  #TRACKER_ERROR_NONE Successful
95  * @retval  #TRACKER_ERROR_INVALID_PARAMETER The input parameter is invalid
96  * @retval  #TRACKER_ERROR_PERMISSION_DENIED No permission to use the API
97  */
98 int tracker_start_services(int services);
99
100 /**
101  * @brief   Stop tracking for information of services
102  * @details  This API should be used only in the framework, not in applications
103  * @since_tizen  3.0
104  * @param[in] services  The services not to use internally
105  * @return  @c 0 on success,
106  *          otherwise a negative error value
107  * @retval  #TRACKER_ERROR_NONE Successful
108  * @retval  #TRACKER_ERROR_INVALID_PARAMETER The input parameter is invalid
109  * @retval  #TRACKER_ERROR_PERMISSION_DENIED No permission to use the API
110  */
111 int tracker_stop_services(int services);
112
113 /**
114  * @}
115  */
116
117 #ifdef __cplusplus
118 }
119 #endif
120
121 #endif /* __LIBTRACKER_TRACKER_H__ */