2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
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>
29 ///////////////////////////////////////////////////////////////////////////////////////////////////
31 ///////////////////////////////////////////////////////////////////////////////////////////////////
33 const char* const Popup::SIGNAL_TOUCHED_OUTSIDE = "touched-outside";
34 const char* const Popup::SIGNAL_HIDDEN = "hidden";
40 Popup::Popup( const Popup& handle )
45 Popup& Popup::operator=( const Popup& handle )
49 Control::operator=( handle );
54 Popup::Popup(Internal::Popup& implementation)
55 : Control(implementation)
59 Popup::Popup( Dali::Internal::CustomActor* internal )
62 VerifyCustomActorPointer<Internal::Popup>(internal);
67 return Internal::Popup::New();
74 Popup Popup::DownCast( BaseHandle handle )
76 return Control::DownCast<Popup, Internal::Popup>(handle);
79 void Popup::SetBackgroundImage( Actor image )
81 GetImpl(*this).SetBackgroundImage( image );
84 void Popup::SetTitle( const std::string& text )
86 GetImpl(*this).SetTitle( text );
89 void Popup::SetTitle( TextView titleActor )
91 GetImpl(*this).SetTitle( titleActor );
94 TextView Popup::GetTitle() const
96 return GetImpl(*this).GetTitle();
99 void Popup::AddButton( Button button )
101 GetImpl(*this).AddButton( button );
104 void Popup::SetState( PopupState state )
106 GetImpl(*this).SetState( state );
109 void Popup::SetState( PopupState state, float duration )
111 GetImpl(*this).SetState( state, duration );
114 Popup::PopupState Popup::GetState() const
116 return GetImpl(*this).GetState();
121 GetImpl(*this).SetState( POPUP_SHOW );
126 GetImpl(*this).SetState( POPUP_HIDE );
129 void Popup::ShowTail(const Vector3& position)
131 GetImpl(*this).ShowTail( position );
134 void Popup::HideTail()
136 GetImpl(*this).HideTail();
139 Popup::TouchedOutsideSignalV2& Popup::OutsideTouchedSignal()
141 return GetImpl(*this).OutsideTouchedSignal();
144 Popup::HiddenSignalV2& Popup::HiddenSignal()
146 return GetImpl(*this).HiddenSignal();
149 } // namespace Toolkit