Split dali-toolkit into Base & Optional
[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 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 // CLASS HEADER
18
19 #include "tool-bar.h"
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24
25 #include <dali/integration-api/debug.h>
26 #include <dali-toolkit/internal/controls/tool-bar/tool-bar-impl.h>
27
28 namespace Dali
29 {
30
31 namespace Toolkit
32 {
33
34 const Toolkit::Alignment::Padding ToolBar::DEFAULT_PADDING( 0.f, 0.f, 0.f, 0.f );
35
36 ToolBar::ToolBar()
37 {
38 }
39
40 ToolBar::ToolBar( const ToolBar& handle )
41 : Control( handle )
42 {
43 }
44
45 ToolBar& ToolBar::operator=( const ToolBar& handle )
46 {
47   if( &handle != this )
48   {
49     Control::operator=( handle );
50   }
51   return *this;
52 }
53
54 ToolBar::~ToolBar()
55 {
56 }
57
58 ToolBar ToolBar::New()
59 {
60   return Internal::ToolBar::New();
61 }
62
63 ToolBar ToolBar::DownCast( BaseHandle handle )
64 {
65   return Control::DownCast<ToolBar, Internal::ToolBar>(handle);
66 }
67
68 void ToolBar::SetBackground( Actor background )
69 {
70   GetImpl( *this ).SetBackground( background );
71 }
72
73 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
74 {
75   GetImpl( *this ).AddControl( control, relativeSize, alignment, padding );
76 }
77
78 void ToolBar::RemoveControl( Actor control )
79 {
80   GetImpl( *this ).RemoveControl( control );
81 }
82
83 ToolBar::ToolBar( Internal::ToolBar& implementation )
84 : Control( implementation )
85 {
86 }
87
88 ToolBar::ToolBar( Dali::Internal::CustomActor* internal )
89 : Control( internal )
90 {
91   VerifyCustomActorPointer<Internal::ToolBar>(internal);
92 }
93
94 } // namespace Toolkit
95
96 } // namespace Dali