Split dali-toolkit into Base & Optional
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / controls / popup / popup.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-toolkit/public-api/controls/popup/popup.h>
18 #include <dali-toolkit/internal/controls/popup/popup-impl.h>
19 #include <dali-toolkit/public-api/controls/buttons/button.h>
20
21 using namespace Dali;
22
23 namespace Dali
24 {
25
26 namespace Toolkit
27 {
28
29 ///////////////////////////////////////////////////////////////////////////////////////////////////
30 // Popup
31 ///////////////////////////////////////////////////////////////////////////////////////////////////
32
33 const char* const Popup::SIGNAL_TOUCHED_OUTSIDE = "touched-outside";
34 const char* const Popup::SIGNAL_HIDDEN = "hidden";
35
36 Popup::Popup()
37 {
38 }
39
40 Popup::Popup( const Popup& handle )
41 : Control( handle )
42 {
43 }
44
45 Popup& Popup::operator=( const Popup& handle )
46 {
47   if( &handle != this )
48   {
49     Control::operator=( handle );
50   }
51   return *this;
52 }
53
54 Popup::Popup(Internal::Popup& implementation)
55 : Control(implementation)
56 {
57 }
58
59 Popup::Popup( Dali::Internal::CustomActor* internal )
60 : Control( internal )
61 {
62   VerifyCustomActorPointer<Internal::Popup>(internal);
63 }
64
65 Popup Popup::New()
66 {
67   return Internal::Popup::New();
68 }
69
70 Popup::~Popup()
71 {
72 }
73
74 Popup Popup::DownCast( BaseHandle handle )
75 {
76   return Control::DownCast<Popup, Internal::Popup>(handle);
77 }
78
79 void Popup::SetBackgroundImage( Actor image )
80 {
81   GetImpl(*this).SetBackgroundImage( image );
82 }
83
84 void Popup::SetTitle( const std::string& text )
85 {
86   GetImpl(*this).SetTitle( text );
87 }
88
89 void Popup::SetTitle( TextView titleActor )
90 {
91   GetImpl(*this).SetTitle( titleActor );
92 }
93
94 TextView Popup::GetTitle() const
95 {
96   return GetImpl(*this).GetTitle();
97 }
98
99 void Popup::AddButton( Button button )
100 {
101   GetImpl(*this).AddButton( button );
102 }
103
104 void Popup::SetState( PopupState state )
105 {
106   GetImpl(*this).SetState( state );
107 }
108
109 void Popup::SetState( PopupState state, float duration )
110 {
111   GetImpl(*this).SetState( state, duration );
112 }
113
114 Popup::PopupState Popup::GetState() const
115 {
116   return GetImpl(*this).GetState();
117 }
118
119 void Popup::Show()
120 {
121   GetImpl(*this).SetState( POPUP_SHOW );
122 }
123
124 void Popup::Hide()
125 {
126   GetImpl(*this).SetState( POPUP_HIDE );
127 }
128
129 void Popup::ShowTail(const Vector3& position)
130 {
131   GetImpl(*this).ShowTail( position );
132 }
133
134 void Popup::HideTail()
135 {
136   GetImpl(*this).HideTail();
137 }
138
139 Popup::TouchedOutsideSignalV2& Popup::OutsideTouchedSignal()
140 {
141   return GetImpl(*this).OutsideTouchedSignal();
142 }
143
144 Popup::HiddenSignalV2& Popup::HiddenSignal()
145 {
146   return GetImpl(*this).HiddenSignal();
147 }
148
149 } // namespace Toolkit
150
151 } // namespace Dali