2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include <FBaseSysLog.h>
19 #include <FSecAccessController.h>
20 #include <FLocLocationCriteria.h>
21 #include <FSec_AccessControlTypes.h>
23 using namespace Tizen::Security;
25 namespace Tizen { namespace Locations
28 LocationCriteria::LocationCriteria(void)
29 : Tizen::Base::Object()
30 , __accuracy(LOC_ACCURACY_ANY)
35 LocationCriteria::LocationCriteria(const LocationCriteria& rhs)
36 : Tizen::Base::Object()
37 , __accuracy(rhs.__accuracy)
42 LocationCriteria::~LocationCriteria(void)
47 LocationCriteria::Equals(const Base::Object& rhs) const
49 const LocationCriteria* pRhs = dynamic_cast< const LocationCriteria* >(&rhs);
56 if (__accuracy != pRhs->__accuracy)
65 LocationCriteria::GetHashCode(void) const
69 hashCode = __accuracy * 37;
75 LocationCriteria::SetAccuracy(LocationAccuracy accuracy)
77 SysTryReturn(NID_LOC, accuracy >= LOC_ACCURACY_FINEST && accuracy <= LOC_ACCURACY_ANY, E_INVALID_ARG, E_INVALID_ARG,
78 "[E_INVALID_ARG] The accuracy value is out of range.");
80 __accuracy = accuracy;
85 LocationCriteria::GetAccuracy(void) const
91 LocationCriteria::operator =(const LocationCriteria& rhs)
98 __accuracy = rhs.__accuracy;