2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include <dali-toolkit/public-api/controls/popup/popup.h>
19 #include <dali-toolkit/internal/controls/popup/popup-impl.h>
20 #include <dali-toolkit/public-api/controls/buttons/button.h>
30 ///////////////////////////////////////////////////////////////////////////////////////////////////
32 ///////////////////////////////////////////////////////////////////////////////////////////////////
34 const char* const Popup::SIGNAL_TOUCHED_OUTSIDE = "touched-outside";
35 const char* const Popup::SIGNAL_HIDDEN = "hidden";
41 Popup::Popup( const Popup& handle )
46 Popup& Popup::operator=( const Popup& handle )
50 Control::operator=( handle );
55 Popup::Popup(Internal::Popup& implementation)
56 : Control(implementation)
60 Popup::Popup( Dali::Internal::CustomActor* internal )
63 VerifyCustomActorPointer<Internal::Popup>(internal);
68 return Internal::Popup::New();
75 Popup Popup::DownCast( BaseHandle handle )
77 return Control::DownCast<Popup, Internal::Popup>(handle);
80 void Popup::SetBackgroundImage( Actor image )
82 GetImpl(*this).SetBackgroundImage( image );
85 void Popup::SetTitle( const std::string& text )
87 GetImpl(*this).SetTitle( text );
90 void Popup::SetTitle( TextView titleActor )
92 GetImpl(*this).SetTitle( titleActor );
95 TextView Popup::GetTitle() const
97 return GetImpl(*this).GetTitle();
100 void Popup::AddButton( Button button )
102 GetImpl(*this).AddButton( button );
105 void Popup::SetState( PopupState state )
107 GetImpl(*this).SetState( state );
110 void Popup::SetState( PopupState state, float duration )
112 GetImpl(*this).SetState( state, duration );
115 Popup::PopupState Popup::GetState() const
117 return GetImpl(*this).GetState();
122 GetImpl(*this).SetState( POPUP_SHOW );
127 GetImpl(*this).SetState( POPUP_HIDE );
130 void Popup::ShowTail(const Vector3& position)
132 GetImpl(*this).ShowTail( position );
135 void Popup::HideTail()
137 GetImpl(*this).HideTail();
140 Popup::TouchedOutsideSignalV2& Popup::OutsideTouchedSignal()
142 return GetImpl(*this).OutsideTouchedSignal();
145 Popup::HiddenSignalV2& Popup::HiddenSignal()
147 return GetImpl(*this).HiddenSignal();
150 } // namespace Toolkit