License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / tool-bar / tool-bar.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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
18 // CLASS HEADER
19
20 #include "tool-bar.h"
21
22 // EXTERNAL INCLUDES
23
24 // INTERNAL INCLUDES
25
26 #include <dali/integration-api/debug.h>
27 #include <dali-toolkit/internal/controls/tool-bar/tool-bar-impl.h>
28
29 namespace Dali
30 {
31
32 namespace Toolkit
33 {
34
35 const Toolkit::Alignment::Padding ToolBar::DEFAULT_PADDING( 0.f, 0.f, 0.f, 0.f );
36
37 ToolBar::ToolBar()
38 {
39 }
40
41 ToolBar::ToolBar( const ToolBar& handle )
42 : Control( handle )
43 {
44 }
45
46 ToolBar& ToolBar::operator=( const ToolBar& handle )
47 {
48   if( &handle != this )
49   {
50     Control::operator=( handle );
51   }
52   return *this;
53 }
54
55 ToolBar::~ToolBar()
56 {
57 }
58
59 ToolBar ToolBar::New()
60 {
61   return Internal::ToolBar::New();
62 }
63
64 ToolBar ToolBar::DownCast( BaseHandle handle )
65 {
66   return Control::DownCast<ToolBar, Internal::ToolBar>(handle);
67 }
68
69 void ToolBar::SetBackground( Actor background )
70 {
71   GetImpl( *this ).SetBackground( background );
72 }
73
74 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
75 {
76   GetImpl( *this ).AddControl( control, relativeSize, alignment, padding );
77 }
78
79 void ToolBar::RemoveControl( Actor control )
80 {
81   GetImpl( *this ).RemoveControl( control );
82 }
83
84 ToolBar::ToolBar( Internal::ToolBar& implementation )
85 : Control( implementation )
86 {
87 }
88
89 ToolBar::ToolBar( Dali::Internal::CustomActor* internal )
90 : Control( internal )
91 {
92   VerifyCustomActorPointer<Internal::ToolBar>(internal);
93 }
94
95 } // namespace Toolkit
96
97 } // namespace Dali