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";
35 const char* const Popup::PROPERTY_TITLE = "title";
36 const char* const Popup::PROPERTY_STATE = "state";
42 Popup::Popup( const Popup& handle )
47 Popup& Popup::operator=( const Popup& handle )
51 Control::operator=( handle );
56 Popup::Popup(Internal::Popup& implementation)
57 : Control(implementation)
61 Popup::Popup( Dali::Internal::CustomActor* internal )
64 VerifyCustomActorPointer<Internal::Popup>(internal);
69 return Internal::Popup::New();
76 Popup Popup::DownCast( BaseHandle handle )
78 return Control::DownCast<Popup, Internal::Popup>(handle);
81 void Popup::SetBackgroundImage( Actor image )
83 GetImpl(*this).SetBackgroundImage( image );
86 void Popup::SetTitle( const std::string& text )
88 GetImpl(*this).SetTitle( text );
91 void Popup::SetTitle( TextView titleActor )
93 GetImpl(*this).SetTitle( titleActor );
96 TextView Popup::GetTitle() const
98 return GetImpl(*this).GetTitle();
101 void Popup::AddButton( Button button )
103 GetImpl(*this).AddButton( button );
106 void Popup::SetState( PopupState state )
108 GetImpl(*this).SetState( state );
111 void Popup::SetState( PopupState state, float duration )
113 GetImpl(*this).SetState( state, duration );
116 Popup::PopupState Popup::GetState() const
118 return GetImpl(*this).GetState();
123 GetImpl(*this).SetState( POPUP_SHOW );
128 GetImpl(*this).SetState( POPUP_HIDE );
131 void Popup::ShowTail(const Vector3& position)
133 GetImpl(*this).ShowTail( position );
136 void Popup::HideTail()
138 GetImpl(*this).HideTail();
141 Popup::TouchedOutsideSignalV2& Popup::OutsideTouchedSignal()
143 return GetImpl(*this).OutsideTouchedSignal();
146 Popup::HiddenSignalV2& Popup::HiddenSignal()
148 return GetImpl(*this).HiddenSignal();
151 } // namespace Toolkit