dfd8d11ba45d5e7439c37923673d3a3da45d6007
[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
23 namespace Dali
24 {
25
26 Constrainable::Constrainable(Dali::Internal::Object* handle)
27 : Handle(handle)
28 {
29 }
30
31 Constrainable::Constrainable()
32 {
33 }
34
35 Constrainable::~Constrainable()
36 {
37 }
38
39 Constrainable::Constrainable(const Constrainable& handle)
40 : Handle(handle)
41 {
42 }
43
44 Constrainable& Constrainable::operator=(const Handle& rhs)
45 {
46   if( this != &rhs )
47   {
48     Handle::operator=(rhs);
49   }
50
51   return *this;
52 }
53
54 ActiveConstraint Constrainable::ApplyConstraint( Constraint constraint )
55 {
56   return GetImplementation(*this).ApplyConstraint(GetImplementation(constraint));
57 }
58
59 void Constrainable::RemoveConstraint(ActiveConstraint activeConstraint)
60 {
61   GetImplementation(*this).RemoveConstraint( activeConstraint );
62 }
63
64 void Constrainable::RemoveConstraints()
65 {
66   GetImplementation(*this).RemoveConstraints();
67 }
68
69 } // Dali