Tizen 2.0 Release
[framework/osp/locations.git] / inc / FLocLocationCriteria.h
1 //
2 // Open Service Platform
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 /**
19  * @file        FLocLocationCriteria.h
20  * @brief       This is the header file for the %LocationCriteria class.
21  *
22  * This header file contains the declarations of the %LocationCriteria class.
23  */
24
25 #ifndef _FLOC_LOCATION_CRITERIA_H_
26 #define _FLOC_LOCATION_CRITERIA_H_
27
28 #include <FBaseObject.h>
29 #include <FLocTypes.h>
30
31 namespace Tizen { namespace Locations
32 {
33
34 /**
35 * @class        LocationCriteria
36 * @brief        This class provides methods to specify the service quality that an application wants for the location provider.
37 *
38 * @since 2.0
39 *
40 * @final        This class is not intended for extension.
41 *
42 * The %LocationCriteria class provides methods to specify the service quality that an application wants for the location provider.
43 * The application specifies the location criteria based on its scenario and gives it to the location provider.
44 *
45 * The accuracy in the location criteria is for specifying the accuracy levels for the location provider.
46 * The accuracy @c LOC_ACCURACY_ANY is for getting locations of any accuracy that the location provider provides.
47 * The application can get more accurate locations as it takes higher accuracy levels from @c LOC_ACCURACY_ONE_KILOMETER,
48 * @c LOC_ACCURACY_HUNDRED_METERS, @c LOC_ACCURACY_TEN_METERS, and @c LOC_ACCURACY_FINEST.
49 * The application should be aware that higher accuracy levels makes the location provider run costly positioning systems more. Considering proper
50 * accuracy levels helps the system to provide efficient services to the user.
51 *
52 * @see          LocationProvider
53 */
54 class _OSP_EXPORT_ LocationCriteria
55         : public Tizen::Base::Object
56 {
57 public:
58         /**
59         * Initializes an instance of %LocationCriteria with the accuracy set to @c LOC_ACCURACY_ANY.
60         *
61         * @since 2.0
62         * @see          SetAccuracy()
63         */
64         LocationCriteria(void);
65
66         /**
67         * This is the copy constructor for the %LocationCriteria class.
68         *
69         * Copying of objects using this copy constructor is allowed.
70         *
71         * @since 2.0
72         *
73         * @param[in]    rhs     An instance of %LocationCriteria to copy
74         */
75         LocationCriteria(const LocationCriteria& rhs);
76
77         /**
78         * This destructor overrides Tizen::Base::Object::~Object().
79         *
80         * @since 2.0
81         */
82         virtual ~LocationCriteria(void);
83
84         /**
85         * Compares the calling instance with the specified instance for equality.
86         *
87         * @since 2.0
88         *
89         * @return       @c true if all the fields in the objects are equal, @n
90         *                       else @c false
91         * @param[in]    rhs     The object to compare
92         */
93         virtual bool Equals(const Tizen::Base::Object& rhs) const;
94
95         /**
96         * Gets the hash value of the calling instance.
97         *
98         * @since 2.0
99         *
100         * @return       The hash value of the calling instance
101         */
102         virtual int GetHashCode(void) const;
103
104         /**
105         * Sets the desired accuracy.
106         *
107         * @since 2.0
108         *
109         * @return       An error code
110         * @param[in]    accuracy        The desired accuracy
111         * @exception    E_SUCCESS       The method is successful.
112         * @exception    E_INVALID_ARG   The specified @c accuracy is invalid.
113         * @see          GetAccuracy()
114         */
115         result SetAccuracy(LocationAccuracy accuracy);
116
117         /**
118         * Gets the desired accuracy of this location criteria.
119         *
120         * @since 2.0
121         *
122         * @return       The accuracy of this location criteria
123         * @see          SetAccuracy()
124         */
125         LocationAccuracy GetAccuracy(void) const;
126
127         /**
128         * Copying of objects using this copy assignment operator is allowed.
129         *
130         * @since 2.0
131         *
132         * @return       A reference to the current instance
133         * @param[in]    rhs     An instance of %LocationCriteria to assign
134         */
135         LocationCriteria& operator =(const LocationCriteria& rhs);
136
137 private:
138         LocationAccuracy __accuracy;
139
140         class _LocationCriteriaImpl* __pImpl;
141         friend class _LocationCriteriaImpl;
142 }; // LocationCriteria
143 }} // Tizen::Locations
144 #endif // _FLOC_LOCATION_CRITERIA_H_