Remove more public Setter/Getter APIs from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / size-negotiation / size-negotiation-example.cpp
1 /*
2  * Copyright (c) 2017 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 #include "shared/view.h"
19 #include <dali/dali.h>
20 #include <dali-toolkit/dali-toolkit.h>
21 #include <dali-toolkit/devel-api/controls/popup/popup.h>
22 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
23
24 using namespace Dali;
25
26 using Dali::Toolkit::TextLabel;
27
28 struct ButtonItem
29 {
30   const char* name;
31   const char* text;
32 };
33
34 namespace
35 {
36
37 const char* const BACKGROUND_IMAGE = DEMO_IMAGE_DIR "background-gradient.jpg";
38 const char* const TOOLBAR_IMAGE = DEMO_IMAGE_DIR "top-bar.png";
39 const char* const IMAGE = DEMO_IMAGE_DIR "background-magnifier.jpg";
40
41 const char* const TOOLBAR_TITLE = "Negotiate Size";
42
43 // This example contains size negotiation tests for TableView and Popup.
44 const char* const TABLEVIEW_BUTTON_1CELL_ID = "TABLEVIEW_BUTTON_1CELL";
45 const char* const TABLEVIEW_BUTTON_3CELL_ID = "TABLEVIEW_BUTTON_3CELL";
46 const char* const TABLEVIEW_BUTTON_3X3CELL_ID = "TABLEVIEW_BUTTON_3X3CELL";
47 const char* const TABLEVIEW_BUTTON_FIXED1_ID = "TABLEVIEW_BUTTON_FIXED1";
48 const char* const TABLEVIEW_BUTTON_FIXED2_ID = "TABLEVIEW_BUTTON_FIXED2";
49 const char* const TABLEVIEW_BUTTON_FIT1_ID = "TABLEVIEW_BUTTON_FIT1";
50 const char* const TABLEVIEW_BUTTON_FIT2_ID = "TABLEVIEW_BUTTON_FIT2";
51 const char* const TABLEVIEW_BUTTON_NATURAL1_ID = "TABLEVIEW_BUTTON_NATURAL1";
52 const char* const TABLEVIEW_BUTTON_NATURAL2_ID = "TABLEVIEW_BUTTON_NATURAL2";
53 const char* const TABLEVIEW_BUTTON_NATURAL3_ID = "TABLEVIEW_BUTTON_NATURAL3";
54 const char* const POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID = "POPUP_BUTTON_CONTENT_IMAGE_SCALE";
55 const char* const POPUP_BUTTON_CONTENT_IMAGE_FIT_ID = "POPUP_BUTTON_CONTENT_IMAGE_FIT";
56 const char* const POPUP_BUTTON_CONTENT_IMAGE_FILL_ID = "POPUP_BUTTON_CONTENT_IMAGE_FILL";
57
58 const ButtonItem TABLEVIEW_BUTTON_ITEMS[] = {
59     { TABLEVIEW_BUTTON_1CELL_ID,                    "1 Cell" },
60     { TABLEVIEW_BUTTON_3CELL_ID,                    "3 Cell" },
61     { TABLEVIEW_BUTTON_3X3CELL_ID,                  "3x3 Cells" },
62     { TABLEVIEW_BUTTON_FIXED1_ID,                   "Fixed 1" },
63     { TABLEVIEW_BUTTON_FIXED2_ID,                   "Fixed 2" },
64     { TABLEVIEW_BUTTON_FIT1_ID,                     "Fit Top Bottom" },
65     { TABLEVIEW_BUTTON_FIT2_ID,                     "Fit Middle" },
66     { TABLEVIEW_BUTTON_NATURAL1_ID,                 "Natural 1" },
67     { TABLEVIEW_BUTTON_NATURAL2_ID,                 "Natural 2" },
68     { TABLEVIEW_BUTTON_NATURAL3_ID,                 "Natural 3" },
69     { POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID,          "Image Scale" },
70     { POPUP_BUTTON_CONTENT_IMAGE_FIT_ID,            "Image Fit" },
71     { POPUP_BUTTON_CONTENT_IMAGE_FILL_ID,           "Image Fill" },
72 };
73
74 const unsigned int TABLEVIEW_BUTTON_ITEMS_COUNT = sizeof( TABLEVIEW_BUTTON_ITEMS ) / sizeof( TABLEVIEW_BUTTON_ITEMS[0] );
75
76
77 Actor CreateSolidColor( Vector4 color )
78 {
79   Toolkit::Control control = Toolkit::Control::New();
80
81   Property::Map map;
82   map[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::COLOR;
83   map[ Toolkit::ColorVisual::Property::MIX_COLOR ] = color;
84   control.SetProperty( Toolkit::Control::Property::BACKGROUND, map );
85
86   return control;
87 }
88
89 }  // anonymous namespace
90
91
92 /**
93  * This example shows the usage of size negotiation.
94  */
95 class SizeNegotiationController: public ConnectionTracker, public Toolkit::ItemFactory
96 {
97 public:
98
99   SizeNegotiationController( Application& application )
100     : mApplication( application )
101   {
102     // Connect to the Application's Init signal
103     mApplication.InitSignal().Connect( this, &SizeNegotiationController::Create );
104   }
105
106   ~SizeNegotiationController()
107   {
108     // Nothing to do here
109   }
110
111   void Create( Application& application )
112   {
113     // The Init signal is received once (only) during the Application lifetime
114     Stage stage = Stage::GetCurrent();
115
116     // Respond to key events if not handled
117     stage.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
118
119     // Creates a default view with a default tool bar.
120     // The view is added to the stage.
121     mContentLayer = DemoHelper::CreateView( application,
122                                             mView,
123                                             mToolBar,
124                                             BACKGROUND_IMAGE,
125                                             TOOLBAR_IMAGE,
126                                             std::string("") );
127
128     mTitleActor = DemoHelper::CreateToolBarLabel( "CUSTOM_TOOLBAR_TITLE" );
129     mTitleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, TOOLBAR_TITLE );
130
131     // Add title to the tool bar.
132     const float padding( DemoHelper::DEFAULT_VIEW_STYLE.mToolBarPadding );
133     mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::Padding( padding, padding, padding, padding ) );
134
135     mItemView = Toolkit::ItemView::New( *this );
136     mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
137     mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
138     mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
139
140     // Use a grid layout for tests
141     Vector2 stageSize = stage.GetSize();
142     Toolkit::ItemLayoutPtr gridLayout = Toolkit::DefaultItemLayout::New( Toolkit::DefaultItemLayout::LIST );
143     Vector3 itemSize;
144     gridLayout->GetItemSize( 0, Vector3( stageSize ), itemSize );
145     itemSize.height = stageSize.y / 10;
146     gridLayout->SetItemSize( itemSize );
147     mItemView.AddLayout( *gridLayout );
148
149     mItemView.ActivateLayout( 0, Vector3(stageSize.x, stageSize.y, stageSize.x), 0.0f );
150
151     mContentLayer.Add( mItemView );
152   }
153
154   void StagePopup( Toolkit::Popup popup )
155   {
156     Stage::GetCurrent().Add( popup );
157     popup.SetDisplayState( Toolkit::Popup::SHOWN );
158   }
159
160   void OnPopupOutsideTouched()
161   {
162     if( mPopup )
163     {
164       mPopup.SetDisplayState( Toolkit::Popup::HIDDEN );
165     }
166   }
167
168   void PopupHidden()
169   {
170     if( mPopup )
171     {
172       mPopup.Unparent();
173       mPopup.Reset();
174     }
175   }
176
177   Toolkit::Popup CreatePopup()
178   {
179     Stage stage = Stage::GetCurrent();
180     const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f;
181
182     Toolkit::Popup popup = Toolkit::Popup::New();
183     popup.SetProperty( Dali::Actor::Property::NAME, "popup" );
184     popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
185     popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
186     popup.SetSize( POPUP_WIDTH_DP, 0.0f );
187     popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false );
188
189     popup.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::OnPopupOutsideTouched );
190     popup.HiddenSignal().Connect( this, &SizeNegotiationController::PopupHidden );
191
192     return popup;
193   }
194
195   bool OnButtonClicked( Toolkit::Button button )
196   {
197     if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_1CELL_ID )
198     {
199       mPopup = CreatePopup();
200       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
201       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
202
203       Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
204       table.SetProperty( Dali::Actor::Property::NAME, "TABLEVIEW_BUTTON_1CELL_ID" );
205       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
206
207       Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
208       backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
209       table.Add( backing );
210
211       mPopup.Add( table );
212
213       StagePopup( mPopup );
214     }
215     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3CELL_ID )
216     {
217       mPopup = CreatePopup();
218       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
219       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
220
221       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
222       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
223
224       {
225         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
226         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
227         table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 0 ) );
228       }
229       {
230         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
231         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
232         table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 0 ) );
233       }
234       {
235         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
236         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
237         table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 0 ) );
238       }
239
240       mPopup.SetContent( table );
241
242       StagePopup( mPopup );
243     }
244     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3X3CELL_ID )
245     {
246       mPopup = CreatePopup();
247       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
248       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
249
250       Toolkit::TableView table = Toolkit::TableView::New( 3, 3 );
251       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
252
253       // Column 0
254       {
255         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
256         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
257         table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 0 ) );
258       }
259       {
260         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
261         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
262         table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 0 ) );
263       }
264       {
265         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
266         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
267         table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 0 ) );
268       }
269
270       // Column 1
271       {
272         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
273         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
274         table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 1 ) );
275       }
276       {
277         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
278         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
279         table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 1 ) );
280       }
281       {
282         Actor backing = CreateSolidColor( Vector4( 0.0f, 0.0f, 1.0f, 1.0f ) );
283         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
284         table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 1 ) );
285       }
286
287       // Column 2
288       {
289         Actor backing = CreateSolidColor( Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) );
290         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
291         table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 2 ) );
292       }
293       {
294         Actor backing = CreateSolidColor( Vector4( 0.5f, 0.5f, 0.5f, 1.0f ) );
295         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
296         table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 2 ) );
297       }
298       {
299         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.5f, 0.0f, 1.0f ) );
300         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
301         table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 2 ) );
302       }
303
304       mPopup.Add( table );
305
306       StagePopup( mPopup );
307     }
308     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED1_ID )
309     {
310       mPopup = CreatePopup();
311       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
312       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
313
314       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
315       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
316       table.SetFixedHeight( 0, 50.0f );
317
318       {
319         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
320         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
321         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
322         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
323         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
324         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
325         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
326         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
327         backing.Add( text );
328         table.Add( backing );
329       }
330       {
331         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
332         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
333         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
334         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
335         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
336         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
337         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
338         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
339         backing.Add( text );
340         table.Add( backing );
341       }
342       {
343         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
344         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
345         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
346         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
347         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
348         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
349         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
350         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
351         backing.Add( text );
352         table.Add( backing );
353       }
354
355       mPopup.Add( table );
356
357       StagePopup( mPopup );
358     }
359     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED2_ID )
360     {
361       mPopup = CreatePopup();
362       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
363       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
364
365       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
366       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
367       table.SetFixedHeight( 0, 50.0f );
368       table.SetFixedHeight( 2, 50.0f );
369
370       {
371         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
372         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
373         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
374         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
375         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
376         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
377         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
378         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
379         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
380
381         backing.Add( text );
382         table.Add( backing );
383       }
384       {
385         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
386         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
387         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
388         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
389         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
390         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
391         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
392         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
393         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
394
395         backing.Add( text );
396         table.Add( backing );
397       }
398       {
399         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
400         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
401         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
402         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
403         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
404         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
405         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
406         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
407         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
408
409         backing.Add( text );
410         table.Add( backing );
411       }
412
413       mPopup.Add( table );
414
415       StagePopup( mPopup );
416     }
417     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT1_ID )
418     {
419       mPopup = CreatePopup();
420       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
421       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
422
423       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
424       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
425       table.SetFitHeight( 0 );
426       table.SetFitHeight( 2 );
427
428       {
429         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
430         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
431         backing.SetSize( 0.0f, 100.0f );
432
433         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
434         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
435         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
436         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
437         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
438         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
439         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
440
441         backing.Add( text );
442
443         table.Add( backing );
444       }
445       {
446         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
447         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
448
449         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
450         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
451         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
452         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
453         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
454         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
455         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
456
457         backing.Add( text );
458
459         table.Add( backing );
460       }
461       {
462         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
463         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
464         backing.SetSize( 0.0f, 100.0f );
465
466         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
467         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
468         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
469         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
470         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
471         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
472         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
473
474         backing.Add( text );
475
476         table.Add( backing );
477       }
478
479       mPopup.Add( table );
480
481       StagePopup( mPopup );
482     }
483     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT2_ID )
484     {
485       mPopup = CreatePopup();
486       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
487       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
488
489       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
490       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
491       table.SetFitHeight( 1 );
492
493       {
494         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
495         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
496
497         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
498         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
499         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
500         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
501         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
502         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
503         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
504
505         backing.Add( text );
506
507         table.Add( backing );
508       }
509       {
510         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
511         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
512         backing.SetSize( 0.0f, 200.0f );
513
514         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
515         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
516         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
517         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
518         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
519
520         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
521         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
522         backing.Add( text );
523
524         table.Add( backing );
525       }
526       {
527         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
528         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
529
530         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
531         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
532         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
533         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
534         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
535         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
536         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
537
538         backing.Add( text );
539
540         table.Add( backing );
541       }
542
543       mPopup.Add( table );
544
545       StagePopup( mPopup );
546     }
547     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL1_ID )
548     {
549       mPopup = CreatePopup();
550       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
551       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) );
552       mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
553
554       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
555       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
556       table.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
557       table.SetFitHeight( 0 );
558       table.SetFitHeight( 1 );
559       table.SetFitHeight( 2 );
560
561       {
562         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
563         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
564         backing.SetSize( 0.0f, 100.0f );
565
566         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
567         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
568         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
569         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
570         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
571         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
572         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
573
574         backing.Add( text );
575
576         table.Add( backing );
577       }
578       {
579         Actor backing = CreateSolidColor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
580         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
581         backing.SetSize( 0.0f, 200.0f );
582
583         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
584         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
585         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
586         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
587         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
588         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
589         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
590
591         backing.Add( text );
592
593         table.Add( backing );
594       }
595       {
596         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
597         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
598         backing.SetSize( 0.0f, 300.0f );
599
600         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
601         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
602         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
603         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
604         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
605         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
606         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
607
608         backing.Add( text );
609
610         table.Add( backing );
611       }
612
613       mPopup.Add( table );
614
615       StagePopup( mPopup );
616     }
617     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL2_ID )
618     {
619       mPopup = CreatePopup();
620       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
621       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) );
622       mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
623
624       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
625       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
626       table.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
627       table.SetFitHeight( 0 );
628       table.SetFitHeight( 1 );
629
630       {
631         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
632         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
633         backing.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
634         backing.SetSize( 0.0f, 100.0f );
635
636         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
637         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
638         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
639         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
640         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
641         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
642         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
643
644         backing.Add( text );
645
646         table.Add( backing );
647       }
648       {
649         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
650         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
651         backing.SetSize( 0.0f, 200.0f );
652
653         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
654         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
655         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
656         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
657         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
658         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
659         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
660
661         backing.Add( text );
662
663         table.Add( backing );
664       }
665
666       mPopup.Add( table );
667
668       StagePopup( mPopup );
669     }
670     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL3_ID )
671     {
672       mPopup = CreatePopup();
673       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
674       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 1.0f, 1.0f ) );
675       mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
676
677       Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
678       table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
679       table.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
680       table.SetFixedHeight( 0, 20.0f );
681       table.SetFitHeight( 1 );
682
683       {
684         Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
685         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
686
687         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
688         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
689         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
690         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
691         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
692         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
693         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
694
695         backing.Add( text );
696
697         table.Add( backing );
698       }
699       {
700         Actor backing = CreateSolidColor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
701         backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
702         backing.SetSize( 0.0f, 200.0f );
703
704         Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
705         text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
706         text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
707         text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
708         text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
709         text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
710         text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
711
712         backing.Add( text );
713
714         table.Add( backing );
715       }
716       mPopup.Add( table );
717
718       StagePopup( mPopup );
719     }
720     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
721     {
722       mPopup = CreatePopup();
723       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
724       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
725
726       Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
727       image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
728
729       mPopup.Add( image );
730
731       StagePopup( mPopup );
732     }
733     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
734     {
735       mPopup = CreatePopup();
736       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
737       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
738
739       Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
740       image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
741       image.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
742
743       mPopup.Add( image );
744
745       StagePopup( mPopup );
746     }
747     else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
748     {
749       mPopup = CreatePopup();
750       mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
751       mPopup.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75f, 0.5f, 1.0f ) );
752
753       Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE );
754       image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
755       image.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FILL_WITH_ASPECT_RATIO );
756
757       mPopup.Add( image );
758
759       StagePopup( mPopup );
760     }
761
762     return true;
763   }
764
765   void OnKeyEvent( const KeyEvent& event )
766   {
767     if( event.state == KeyEvent::Down )
768     {
769       if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
770       {
771         // Exit application when click back or escape.
772         mApplication.Quit();
773       }
774     }
775   }
776
777 public: // From ItemFactory
778
779   /**
780    * @brief Return the number of items to display in the item view
781    *
782    * @return Return the number of items to display
783    */
784   virtual unsigned int GetNumberOfItems()
785   {
786     return TABLEVIEW_BUTTON_ITEMS_COUNT;
787   }
788
789   /**
790    * @brief Create a new item to populate the item view with
791    *
792    * @param[in] itemId The index of the item to create
793    * @return Return the created actor for the given ID
794    */
795   virtual Actor NewItem(unsigned int itemId)
796   {
797     Toolkit::PushButton popupButton = Toolkit::PushButton::New();
798     popupButton.SetProperty( Dali::Actor::Property::NAME, TABLEVIEW_BUTTON_ITEMS[ itemId ].name );
799     popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text );
800     popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
801
802     popupButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
803
804     return popupButton;
805   }
806
807 private:
808
809   Application&       mApplication;
810   Toolkit::Control   mView;                  ///< The View instance.
811   Toolkit::ToolBar   mToolBar;               ///< The View's Toolbar.
812   Layer              mContentLayer;          ///< Content layer.
813
814   Toolkit::TextLabel mTitleActor;            ///< Title text.
815   Toolkit::Popup     mMenu;                  ///< The navigation menu.
816   Toolkit::Popup     mPopup;                 ///< The current example popup.
817
818   Toolkit::ItemView  mItemView;              ///< ItemView to hold test images.
819
820 };
821
822 int DALI_EXPORT_API main( int argc, char **argv )
823 {
824   Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
825   SizeNegotiationController test( application );
826   application.MainLoop();
827   return 0;
828 }