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