Klocwork fixes.
[platform/core/uifw/dali-core.git] / dali / public-api / object / constrainable.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 #include <dali/public-api/object/constrainable.h>
18 #include <dali/public-api/animation/constraint.h>
19 #include <dali/public-api/animation/active-constraint.h>
20 #include <dali/internal/event/common/proxy-object.h>
21 #include <dali/internal/event/animation/constraint-impl.h>
22 #include <dali/internal/event/object/custom-object-internal.h>
23
24 namespace Dali
25 {
26
27 Constrainable Constrainable::New()
28 {
29   return Constrainable( Internal::CustomObject::New() );
30 }
31
32 Constrainable::Constrainable(Dali::Internal::Object* handle)
33 : Handle(handle)
34 {
35 }
36
37 Constrainable::Constrainable()
38 {
39 }
40
41 Constrainable Constrainable::DownCast( BaseHandle handle )
42 {
43   return Constrainable( dynamic_cast<Dali::Internal::ProxyObject*>(handle.GetObjectPtr()) );
44 }
45
46 Constrainable::~Constrainable()
47 {
48 }
49
50 Constrainable::Constrainable(const Constrainable& handle)
51 : Handle(handle)
52 {
53 }
54
55 ActiveConstraint Constrainable::ApplyConstraint( Constraint constraint )
56 {
57   return GetImplementation(*this).ApplyConstraint(GetImplementation(constraint));
58 }
59
60 void Constrainable::RemoveConstraint(ActiveConstraint activeConstraint)
61 {
62   GetImplementation(*this).RemoveConstraint( activeConstraint );
63 }
64
65 void Constrainable::RemoveConstraints()
66 {
67   GetImplementation(*this).RemoveConstraints();
68 }
69
70 } // Dali