[dali_2.1.31] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-Text-Ellipsis.cpp
1 /*
2  * Copyright (c) 2022 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 <iostream>
19 #include <stdlib.h>
20 #include <unistd.h>
21
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <toolkit-text-utils.h>
25 #include <dali-toolkit/internal/text/font-description-run.h>
26 #include <dali-toolkit/internal/text/rendering/text-typesetter.h>
27 #include <dali-toolkit/internal/text/rendering/view-model.h>
28 #include <dali-toolkit/internal/text/controller/text-controller.h>
29 #include <dali-toolkit/internal/text/text-view.h>
30
31
32 using namespace Dali;
33 using namespace Toolkit;
34 using namespace Text;
35
36
37 namespace
38 {
39
40   const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
41
42   struct ElideData
43   {
44     std::string                                                description;
45     std::string                                                text;
46     bool                                                       isMultiLines;
47     DevelText::LineWrap::Mode                                  lineWrapMode;
48     DevelText::EllipsisPosition::Type                          ellipsisPosition;
49     bool                                                       isMarkup;
50     Vector2                                                    size;
51     unsigned int                                               numberOfLines;
52     unsigned int                                               numberOfGlyphs;
53     float*                                                     positions;
54   };
55
56
57   bool ElideTestViewModel( const ElideData& data )
58   {
59     std::cout << "  testing : " << data.description << std::endl;
60
61     // Load some fonts.
62     TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
63     fontClient.SetDpi( 93u, 93u );
64
65     char* pathNamePtr = get_current_dir_name();
66     const std::string pathName( pathNamePtr );
67     free( pathNamePtr );
68
69     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
70     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
71     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
72
73     // Creates a text controller.
74     ControllerPtr controller = Controller::New();
75
76     // Tests the rendering controller has been created.
77     TypesetterPtr typesetter = Typesetter::New(controller->GetTextModel());
78     DALI_TEST_CHECK(typesetter);
79
80     // Tests the view model has been created.
81     ViewModel* model = typesetter->GetViewModel();
82     DALI_TEST_CHECK(model);
83
84     // Configures the text controller similarly to the text-label.
85     ConfigureTextLabel( controller );
86
87     // Sets a text and relais-out.
88     controller->SetMarkupProcessorEnabled( data.isMarkup );
89
90     controller->SetMultiLineEnabled( data.isMultiLines );
91     controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
92     controller->SetEllipsisPosition( data.ellipsisPosition );
93
94     controller->SetText(data.text);
95     controller->Relayout( data.size );
96
97     // Elide the glyphs.
98     model->ElideGlyphs();
99
100     if( data.numberOfLines != model->GetNumberOfLines() )
101     {
102       std::cout << "  different number of lines : " << model->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
103       return false;
104     }
105
106     Length numberOfGlyphs = model->GetNumberOfGlyphs();
107
108     if( data.numberOfGlyphs != numberOfGlyphs )
109     {
110       std::cout << "  different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
111       return false;
112     }
113
114     const Vector2* const layoutBuffer              = model->GetLayout();
115     const Length         numberOfLines             = model->GetNumberOfLines();
116     const GlyphIndex     startIndexOfGlyphs        = model->GetStartIndexOfElidedGlyphs();
117     const GlyphIndex     endIndexOfGlyphs          = model->GetEndIndexOfElidedGlyphs();
118     const GlyphIndex     firstMiddleIndexOfGlyphs  = model->GetFirstMiddleIndexOfElidedGlyphs();
119
120
121     //Test total height of lines is fit inside Controller's size
122     Length heightOfLines = 0;
123     for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
124     {
125         const LineRun& tempLine         = *( model->GetLines() + lineIndex);
126         heightOfLines+= (tempLine.ascender - tempLine.descender);
127     }
128
129     if(heightOfLines > data.size.height)
130     {
131         std::cout << "The heightOfLines should be less than height of controller.";
132         std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <<std::endl;
133         return false;
134     }
135
136     if( numberOfLines != 0u )
137     {
138       Length   elidedLineIndex    = 0u;
139       for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
140       {
141           const LineRun& tempLine         = *( model->GetLines() + elidedLineIndex);
142           if(tempLine.ellipsis)
143           {
144             elidedLineIndex = lineIndex;
145             break;
146           }
147       }
148       const LineRun& elidedLine                   = *( model->GetLines() + elidedLineIndex);
149       Length         numberOfLineGlyphs           = 0u;
150       Length         numberOfLineGlyphsSecondHalf = 0u;
151
152       switch(data.ellipsisPosition)
153       {
154         case DevelText::EllipsisPosition::START:
155         {
156           numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
157           break;
158         }
159         case DevelText::EllipsisPosition::MIDDLE:
160         {
161           numberOfLineGlyphs = firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u ;
162           break;
163         }
164         case DevelText::EllipsisPosition::END:
165         default:
166         {
167           numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
168           break;
169         }
170       }
171
172       unsigned int index = 0u;
173       for( ; index < numberOfLineGlyphs; ++index )
174       {
175         if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
176         {
177           std::cout << "  different layout :";
178           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
179           {
180             std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
181           }
182           std::cout << std::endl;
183           std::cout << "          expected :";
184           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
185           {
186             std::cout << " " << *( data.positions + i );
187           }
188           std::cout << std::endl;
189           return false;
190         }
191       }
192
193
194       for( ; index < numberOfLineGlyphsSecondHalf; ++index )
195       {
196         if( *( data.positions + index ) != floor(elidedLine.alignmentOffset + ( *( layoutBuffer + index ) ).x ) )
197         {
198           std::cout << "  different layout :";
199           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
200           {
201             std::cout << " " << floor( elidedLine.alignmentOffset + ( *( layoutBuffer + i ) ).x );
202           }
203           std::cout << std::endl;
204           std::cout << "          expected :";
205           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
206           {
207             std::cout << " " << *( data.positions + i );
208           }
209           std::cout << std::endl;
210           return false;
211         }
212       }
213
214     }
215
216     return true;
217   }
218
219   bool ElideTestTextView( const ElideData& data )
220   {
221     std::cout << "  testing : " << data.description << std::endl;
222
223     // Load some fonts.
224     TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
225     fontClient.SetDpi( 93u, 93u );
226
227     char* pathNamePtr = get_current_dir_name();
228     const std::string pathName( pathNamePtr );
229     free( pathNamePtr );
230
231     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" );
232     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
233     fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
234
235     // Creates a text controller.
236     ControllerPtr controller = Controller::New();
237
238     if(data.isMultiLines)
239     {
240        // Configures the text controller similarly to the text-editor.
241        ConfigureTextEditor( controller );
242        controller->SetVerticalScrollEnabled( false );
243     }
244     else
245     {
246       // Configures the text controller similarly to the text-field.
247       ConfigureTextField( controller );
248     }
249
250     controller->SetDefaultFontFamily("TizenSansRegular");
251     controller->SetDefaultFontSize(12.0f, Text::Controller::POINT_SIZE);
252
253     controller->SetMultiLineEnabled( data.isMultiLines );
254     controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
255
256     // Sets a text and relais-out.
257     controller->SetMarkupProcessorEnabled( data.isMarkup );
258
259     controller->SetTextElideEnabled( true );
260     controller->SetEllipsisPosition( data.ellipsisPosition );
261
262     controller->SetText( data.text );
263     controller->Relayout( data.size );
264
265     // Get view to elide the glyphs.
266     Text::ViewInterface& view = controller->GetView();
267
268     Length numberOfGlyphs = view.GetNumberOfGlyphs();
269
270     if(numberOfGlyphs == 0u)
271     {
272       return data.numberOfGlyphs == 0u;
273     }
274
275     Vector<GlyphInfo> glyphs;
276     glyphs.Resize(numberOfGlyphs);
277
278     Vector<Vector2> positions;
279     positions.Resize(numberOfGlyphs);
280
281     float alignmentOffset = 0u;
282     numberOfGlyphs = view.GetGlyphs(glyphs.Begin(),
283                                     positions.Begin(),
284                                     alignmentOffset,
285                                     0u,
286                                     numberOfGlyphs);
287
288     glyphs.Resize(numberOfGlyphs);
289     positions.Resize(numberOfGlyphs);
290
291
292     if( data.numberOfGlyphs != numberOfGlyphs )
293     {
294       std::cout << "  different number of glyphs : " << numberOfGlyphs << ", expected : " << data.numberOfGlyphs << std::endl;
295       return false;
296     }
297
298     // Tests the text model has been created.
299     const ModelInterface* textModel  = controller->GetTextModel();
300     DALI_TEST_CHECK(textModel);
301
302     if( data.numberOfLines != textModel->GetNumberOfLines() )
303     {
304       std::cout << "  different number of lines : " << textModel->GetNumberOfLines() << ", expected : " << data.numberOfLines << std::endl;
305       return false;
306     }
307
308     const Length     numberOfLines             = textModel->GetNumberOfLines();
309     const GlyphIndex startIndexOfGlyphs        = textModel->GetStartIndexOfElidedGlyphs();
310     const GlyphIndex endIndexOfGlyphs          = textModel->GetEndIndexOfElidedGlyphs();
311     const GlyphIndex firstMiddleIndexOfGlyphs  = textModel->GetFirstMiddleIndexOfElidedGlyphs();
312     const GlyphIndex secondMiddleIndexOfGlyphs = textModel->GetSecondMiddleIndexOfElidedGlyphs();
313
314     //Test total height of lines is fit inside Controller's size
315     Length heightOfLines = 0;
316     for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
317     {
318         const LineRun& tempLine         = *( textModel->GetLines() + lineIndex);
319         heightOfLines+= (tempLine.ascender - tempLine.descender);
320     }
321
322     if(heightOfLines > data.size.height)
323     {
324         std::cout << "The heightOfLines should be less than height of controller.";
325         std::cout << " The heightOfLines is "<< heightOfLines << "and the height of controller is "<< data.size.height <<std::endl;
326         return false;
327     }
328
329     if( numberOfLines != 0u )
330     {
331       Length   elidedLineIndex    = 0u;
332       for(Length lineIndex=0u; lineIndex < numberOfLines; lineIndex++)
333       {
334           const LineRun& tempLine         = *( textModel->GetLines() + lineIndex);
335           if(tempLine.ellipsis)
336           {
337             elidedLineIndex = lineIndex;
338             break;
339           }
340       }
341       const LineRun& elidedLine         = *( textModel->GetLines() + elidedLineIndex);
342
343       Length         numberOfLineGlyphs           = 0u;
344       Length         numberOfLineGlyphsSecondHalf = 0u;
345
346       switch(data.ellipsisPosition)
347       {
348         case DevelText::EllipsisPosition::START:
349         {
350           numberOfLineGlyphs = elidedLine.glyphRun.numberOfGlyphs - ( startIndexOfGlyphs - elidedLine.glyphRun.glyphIndex);
351           break;
352         }
353         case DevelText::EllipsisPosition::MIDDLE:
354         {
355           numberOfLineGlyphs = firstMiddleIndexOfGlyphs == elidedLine.glyphRun.glyphIndex ? 0u : (firstMiddleIndexOfGlyphs - elidedLine.glyphRun.glyphIndex +1u);
356
357           if(elidedLine.isSplitToTwoHalves)
358           {
359             numberOfLineGlyphsSecondHalf = (elidedLine.glyphRunSecondHalf.glyphIndex + elidedLine.glyphRunSecondHalf.numberOfGlyphs) - secondMiddleIndexOfGlyphs ;
360
361           }
362           break;
363         }
364         case DevelText::EllipsisPosition::END:
365         default:
366         {
367           numberOfLineGlyphs = endIndexOfGlyphs - elidedLine.glyphRun.glyphIndex + 1u;
368           break;
369         }
370       }
371
372
373       unsigned int index = 0u;
374       for(  ; index < numberOfLineGlyphs; ++index )
375       {
376
377         if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
378         {
379           std::cout << "  different layout :";
380           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
381           {
382             std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
383           }
384           std::cout << std::endl;
385           std::cout << "          expected :";
386           for( unsigned int i = 0; i < numberOfLineGlyphs; ++i )
387           {
388             std::cout << " " << *( data.positions + i );
389           }
390           std::cout << std::endl;
391           return false;
392         }
393       }
394
395       for( ; index < numberOfLineGlyphsSecondHalf; ++index )
396       {
397         if( *( data.positions + index ) != floor( elidedLine.alignmentOffset + positions[index].x ))
398         {
399           std::cout << "  different layout :";
400           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
401           {
402             std::cout << " " << floor( elidedLine.alignmentOffset + positions[i].x );
403           }
404           std::cout << std::endl;
405           std::cout << "          expected :";
406           for( unsigned int i = 0; i < numberOfLineGlyphsSecondHalf; ++i )
407           {
408             std::cout << " " << *( data.positions + i );
409           }
410           std::cout << std::endl;
411           return false;
412         }
413       }
414     }
415
416     return true;
417   }
418
419 }
420
421 int UtcDaliTextLabelElideTextLocation(void)
422 {
423   tet_infoline(" UtcDaliTextLabelElideTextLocation ");
424
425   Size textSize00( 100.f, 100.f );
426
427   Size  textSize01( 120.0f, 50.0f );
428   float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
429
430   Size  textSize02( 120.0f, 50.0f );
431   float positions02[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 49.0f, 59.0f, 69.0f, 79.0f, 90.0f };
432
433   Size  textSize03( 120.0f, 60.0f );
434   float positions03[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 63.0f, 73.0f, 82.0f, 0.0f, 14.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 88.0f };
435
436   Size  textSize04( 120.0f, 60.0f );
437   float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f, 103.0f, 109.0f, 0.0f, 14.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f, 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
438
439   Size  textSize05( 110.0f, 60.0f );
440   float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 0.0f, 8.0f, 19.0f, 25.0f, 30.0f, 44.0f, 54.0f, 63.0f, 68.0f, 82.0f, 93.0f, 0.0f, 8.0f, 19.0f, 33.0f, 42.0f, 48.0f, 59.0f, 69.0f, 74.0f, 78.0f };
441
442   Size  textSize06( 110.0f, 60.0f );
443   float positions06[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 63.0f, 73.0f, 82.0f, 0.0f, 14.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 77.0f };
444
445   Size  textSize07( 120.0f, 50.0f );
446   float positions07[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
447
448   Size  textSize08( 120.0f, 50.0f );
449   float positions08[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
450
451   Size  textSize09( 120.0f, 60.0f );
452   float positions09[] = { 8.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 87.0f, 97.0f, 102.0f, 105.0f, 115.0f };
453
454   Size  textSize10( 120.0f, 60.0f );
455   float positions10[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
456
457   Size  textSize11( 100.0f, 60.0f );
458   float positions11[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
459
460   Size  textSize12( 100.0f, 60.0f );
461   float positions12[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
462
463   Size  textSize13( 120.0f, 60.0f );
464   float positions13[] = { 118.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 46.0f, 37.0f, 31.0f, 22.0f, 7.0f };
465
466   Size  textSize14( 120.0f, 60.0f );
467   float positions14[] = { 115.0f, 108.0f, 94.0f, 86.0f, 77.0f, 71.0f, 61.0f, 56.0f, 51.0f, 43.0f, 34.0f, 30.0f, 112.0f, 104.0f, 94.0f, 89.0f, 87.0f, 81.0f, 77.0f, 67.0f, 59.0f, 54.0f, 45.0f, 38.0f, 34.0f, 30.0f, 142.0f, 131.0f, 126.0f, 121.0f, 119.0f, 109.0f, 105.0f, 91.0f, 83.0f, 74.0f, 72.0f, 66.0f, 60.0f, 55.0f, 46.0f, 32.0f };
468
469   Size  textSize15( 110.0f, 60.0f );
470   float positions15[] = { 108.0f, 101.0f, 87.0f, 79.0f, 70.0f, 64.0f, 54.0f, 49.0f, 44.0f, 36.0f, 27.0f, 21.0f, 12.0f, 4.0f, 96.0f, 91.0f, 89.0f, 83.0f, 79.0f, 69.0f, 61.0f, 56.0f, 47.0f, 40.0f, 36.0f, 30.0f, 27.0f, 16.0f, 11.0f, 6.0f, 4.0f, 102.0f, 98.0f, 84.0f, 75.0f, 66.0f, 64.0f, 58.0f, 53.0f, 47.0f, 38.0f, 25.0f, 22.0f, 5.0f };
471
472   Size  textSize16( 110.0f, 60.0f );
473   float positions16[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 35.0f, 28.0f, 24.0f, 20.0f, 116.0f, 104.0f, 99.0f, 95.0f, 92.0f, 83.0f, 79.0f, 65.0f, 56.0f, 48.0f, 45.0f, 39.0f, 24.0f };
474
475   Size  textSize17( 110.0f, 60.0f );
476   float positions17[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 35.0f, 28.0f, 24.0f, 20.0f, 116.0f, 104.0f, 99.0f, 95.0f, 92.0f, 83.0f, 79.0f, 65.0f, 56.0f, 48.0f, 45.0f, 39.0f, 24.0f };
477
478   Size  textSize18( 120.0f, 60.0f );
479   float positions18[] = { 89.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 28.0f, 25.0f, 14.0f, 7.0f, 0.0f };
480
481   Size  textSize19( 120.0f, 60.0f );
482   float positions19[] = { 103.0f, 91.0f, 86.0f, 84.0f, 78.0f, 74.0f, 64.0f, 56.0f, 51.0f, 42.0f, 35.0f, 31.0f, 27.0f };
483
484   Size  textSize20( 110.0f, 60.0f );
485   float positions20[] = { 89.0f, 82.0f, 78.0f, 68.0f, 60.0f, 55.0f, 46.0f, 39.0f, 35.0f, 29.0f, 26.0f, 15.0f, 10.0f, 5.0f, 3.0f };
486
487   Size  textSize21( 110.0f, 60.0f );
488   float positions21[] = { 93.0f, 81.0f, 76.0f, 74.0f, 68.0f, 64.0f, 54.0f, 46.0f, 41.0f, 32.0f, 25.0f, 21.0f, 17.0f };
489
490   Size  textSize22( 110.0f, 60.0f );
491   float positions22[] = { 93.0f, 81.0f, 76.0f, 74.0f, 68.0f, 64.0f, 54.0f, 46.0f, 41.0f, 32.0f, 25.0f, 21.0f, 17.0f };
492
493   Size  textSize23( 120.0f, 50.0f );
494   float positions23[] = { 0.0f, 11.0f, 20.0f, 32.0f, 44.0f };
495
496   Size  textSize24( 120.0f, 50.0f );
497   float positions24[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
498
499   Size  textSize25( 120.0f, 60.0f );
500   float positions25[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 64.0f };
501
502   Size  textSize26( 120.0f, 60.0f );
503   float positions26[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f, 103.0f, 109.0f, 0.0f, 14.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 86.0f };
504
505   Size  textSize27( 110.0f, 60.0f );
506   float positions27[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 0.0f, 8.0f, 19.0f, 25.0f, 30.0f, 44.0f, 54.0f, 63.0f, 69.0f };
507
508   Size  textSize28( 110.0f, 60.0f );
509   float positions28[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f, 8.0f, 18.0f, 27.0f, 38.0f, 44.0f, 49.0f, 64.0f };
510
511   Size  textSize29( 120.0f, 60.0f );
512   float positions29[] = { 115.0f, 108.0f, 94.0f, 86.0f, 78.0f, 72.0f, 61.0f };
513
514   Size  textSize30( 120.0f, 60.0f );
515   float positions30[] = { 115.0f, 108.0f, 94.0f, 86.0f, 77.0f, 71.0f, 61.0f, 56.0f, 51.0f, 43.0f, 34.0f, 30.0f, 112.0f, 104.0f, 94.0f, 89.0f, 87.0f, 81.0f, 77.0f, 67.0f, 59.0f, 54.0f, 34.0f };
516
517   Size  textSize31( 110.0f, 60.0f );
518   float positions31[] = { 108.0f, 101.0f, 87.0f, 79.0f, 70.0f, 64.0f, 54.0f, 49.0f, 44.0f, 36.0f, 27.0f, 21.0f, 12.0f, 4.0f, 96.0f, 91.0f, 89.0f, 83.0f, 79.0f, 69.0f, 61.0f, 56.0f, 47.0f, 40.0f, 36.0f, 30.0f, 27.0f, 11.0f };
519
520   Size  textSize32( 110.0f, 60.0f );
521   float positions32[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 24.0f };
522
523   Size  textSize33( 110.0f, 60.0f );
524   float positions33[] = { 105.0f, 98.0f, 84.0f, 76.0f, 67.0f, 61.0f, 51.0f, 46.0f, 41.0f, 33.0f, 24.0f, 20.0f, 102.0f, 94.0f, 84.0f, 79.0f, 77.0f, 71.0f, 67.0f, 57.0f, 49.0f, 44.0f, 24.0f };
525
526   Size  textSize34( 120.0f, 30.0f );
527   float positions34[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
528
529   Size  textSize35( 120.0f, 30.0f );
530   float positions35[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
531
532   Size  textSize36( 120.0f, 30.0f );
533   float positions36[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
534
535   Size  textSize37(145.0f, 30.0f);
536   float positions37[] = {131.0f, 126.0f, 121.0f, 116.0f, 108.0f, 103.0f, 93.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f};
537
538   Size  textSize38(145.0f, 30.0f);
539   float positions38[] = {51.0f, 66.0f, 71.0f, 79.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 27.0f, 23.0f, 14.0f, 10.0f, 0.0f};
540
541   struct ElideData data[] =
542     {
543       {"void text",
544        "",
545        false,
546        DevelText::LineWrap::WORD,
547        DevelText::EllipsisPosition::END,
548        false,
549        textSize00,
550        0u,
551        0u,
552        nullptr},
553
554       {"void text",
555        "",
556        false,
557        DevelText::LineWrap::WORD,
558        DevelText::EllipsisPosition::START,
559        false,
560        textSize00,
561        0u,
562        0u,
563        nullptr},
564
565       {"void text",
566        "",
567        false,
568        DevelText::LineWrap::WORD,
569        DevelText::EllipsisPosition::MIDDLE,
570        false,
571        textSize00,
572        0u,
573        0u,
574        nullptr},
575
576       //END LTR cases
577       {
578         "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
579         "A0123456789 B0123456789 C0123456789 D0123456789 ",
580         false,
581         DevelText::LineWrap::WORD,
582         DevelText::EllipsisPosition::END,
583         false,
584         textSize01,
585         1u,
586         10u,
587         positions01},
588
589       {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
590        "A0123456789 B0123456789 C0123456789 D0123456789 ",
591        true,
592        DevelText::LineWrap::WORD,
593        DevelText::EllipsisPosition::END,
594        false,
595        textSize02,
596        2u,
597        22u,
598        positions02},
599
600       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
601        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
602        true,
603        DevelText::LineWrap::WORD,
604        DevelText::EllipsisPosition::END,
605        false,
606        textSize03,
607        3u,
608        29u,
609        positions03},
610
611       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
612        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
613        true,
614        DevelText::LineWrap::CHARACTER,
615        DevelText::EllipsisPosition::END,
616        false,
617        textSize04,
618        3u,
619        40u,
620        positions04},
621
622       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
623        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
624        true,
625        DevelText::LineWrap::HYPHENATION,
626        DevelText::EllipsisPosition::END,
627        false,
628        textSize05,
629        3u,
630        32u,
631        positions05},
632
633       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
634        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
635        true,
636        DevelText::LineWrap::MIXED,
637        DevelText::EllipsisPosition::END,
638        false,
639        textSize06,
640        3u,
641        28u,
642        positions06},
643
644       //START LTR cases
645       {
646         "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
647         "A0123456789 B0123456789 C0123456789 D0123456789 ",
648         false,
649         DevelText::LineWrap::WORD,
650         DevelText::EllipsisPosition::START,
651         false,
652         textSize07,
653         1u,
654         11u,
655         positions07,
656
657       },
658
659       {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
660        "A0123456789 B0123456789 C0123456789 D0123456789 ",
661        true,
662        DevelText::LineWrap::WORD,
663        DevelText::EllipsisPosition::START,
664        false,
665        textSize08,
666        2u,
667        23u,
668        positions08},
669
670       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
671        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
672        true,
673        DevelText::LineWrap::WORD,
674        DevelText::EllipsisPosition::START,
675        false,
676        textSize09,
677        3u,
678        33u,
679        positions09},
680
681       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
682        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
683        true,
684        DevelText::LineWrap::CHARACTER,
685        DevelText::EllipsisPosition::START,
686        false,
687        textSize10,
688        3u,
689        37u,
690        positions10},
691
692       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
693        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
694        true,
695        DevelText::LineWrap::HYPHENATION,
696        DevelText::EllipsisPosition::START,
697        false,
698        textSize11,
699        3u,
700        25u,
701        positions11},
702
703       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
704        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
705        true,
706        DevelText::LineWrap::MIXED,
707        DevelText::EllipsisPosition::START,
708        false,
709        textSize12,
710        3u,
711        25u,
712        positions12},
713
714       //END RTL cases
715       {
716         "EllipsisPosition: TextLabel: SingleLine RTL END",
717         "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
718         false,
719         DevelText::LineWrap::WORD,
720         DevelText::EllipsisPosition::END,
721         false,
722         textSize13,
723         1u,
724         14u,
725         positions13},
726
727       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
728        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
729        true,
730        DevelText::LineWrap::WORD,
731        DevelText::EllipsisPosition::END,
732        false,
733        textSize14,
734        3u,
735        42u,
736        positions14},
737
738       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
739        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
740        true,
741        DevelText::LineWrap::CHARACTER,
742        DevelText::EllipsisPosition::END,
743        false,
744        textSize15,
745        3u,
746        44u,
747        positions15},
748
749       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
750        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
751        true,
752        DevelText::LineWrap::HYPHENATION,
753        DevelText::EllipsisPosition::END,
754        false,
755        textSize16,
756        3u,
757        39u,
758        positions16},
759
760       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
761        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
762        true,
763        DevelText::LineWrap::MIXED,
764        DevelText::EllipsisPosition::END,
765        false,
766        textSize17,
767        3u,
768        39u,
769        positions17},
770
771       //START RTL cases
772       {
773         "EllipsisPosition: TextLabel: SingleLine RTL START",
774         "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
775         false,
776         DevelText::LineWrap::WORD,
777         DevelText::EllipsisPosition::START,
778         false,
779         textSize18,
780         1u,
781         13u,
782         positions18},
783
784       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
785        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
786        true,
787        DevelText::LineWrap::WORD,
788        DevelText::EllipsisPosition::START,
789        false,
790        textSize19,
791        3u,
792        33u,
793        positions19},
794
795       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
796        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
797        true,
798        DevelText::LineWrap::CHARACTER,
799        DevelText::EllipsisPosition::START,
800        false,
801        textSize20,
802        3u,
803        30u,
804        positions20},
805
806       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
807        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
808        true,
809        DevelText::LineWrap::HYPHENATION,
810        DevelText::EllipsisPosition::START,
811        false,
812        textSize21,
813        3u,
814        33u,
815        positions21},
816
817       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
818        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
819        true,
820        DevelText::LineWrap::MIXED,
821        DevelText::EllipsisPosition::START,
822        false,
823        textSize22,
824        3u,
825        33u,
826        positions22},
827
828       //MIDDLE LTR cases
829       {
830         "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
831         "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
832         false,
833         DevelText::LineWrap::WORD,
834         DevelText::EllipsisPosition::MIDDLE,
835         false,
836         textSize23,
837         1u,
838         10u,
839         positions23},
840
841       {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
842        "A0123456789 B0123456789 C0123456789 D0123456789 ",
843        true,
844        DevelText::LineWrap::WORD,
845        DevelText::EllipsisPosition::MIDDLE,
846        false,
847        textSize24,
848        2u,
849        22u,
850        positions24},
851
852       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
853        "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
854        true,
855        DevelText::LineWrap::WORD,
856        DevelText::EllipsisPosition::MIDDLE,
857        false,
858        textSize25,
859        3u,
860        24u,
861        positions25},
862
863       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
864        "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
865        true,
866        DevelText::LineWrap::CHARACTER,
867        DevelText::EllipsisPosition::MIDDLE,
868        false,
869        textSize26,
870        3u,
871        36u,
872        positions26},
873
874       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
875        "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
876        true,
877        DevelText::LineWrap::HYPHENATION,
878        DevelText::EllipsisPosition::MIDDLE,
879        false,
880        textSize27,
881        3u,
882        27u,
883        positions27},
884
885       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
886        "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
887        true,
888        DevelText::LineWrap::MIXED,
889        DevelText::EllipsisPosition::MIDDLE,
890        false,
891        textSize28,
892        3u,
893        24u,
894        positions28},
895
896       //MIDDLE RTL cases
897       {
898         "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
899         "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
900         false,
901         DevelText::LineWrap::WORD,
902         DevelText::EllipsisPosition::MIDDLE,
903         false,
904         textSize29,
905         1u,
906         13u,
907         positions29},
908
909       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
910        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
911        true,
912        DevelText::LineWrap::WORD,
913        DevelText::EllipsisPosition::MIDDLE,
914        false,
915        textSize30,
916        3u,
917        31u,
918        positions30},
919
920       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
921        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
922        true,
923        DevelText::LineWrap::CHARACTER,
924        DevelText::EllipsisPosition::MIDDLE,
925        false,
926        textSize31,
927        3u,
928        29u,
929        positions31},
930
931       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
932        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
933        true,
934        DevelText::LineWrap::HYPHENATION,
935        DevelText::EllipsisPosition::MIDDLE,
936        false,
937        textSize32,
938        3u,
939        31u,
940        positions32},
941
942       {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
943        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
944        true,
945        DevelText::LineWrap::MIXED,
946        DevelText::EllipsisPosition::MIDDLE,
947        false,
948        textSize33,
949        3u,
950        31u,
951        positions33},
952
953       {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
954        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
955        true,
956        DevelText::LineWrap::WORD,
957        DevelText::EllipsisPosition::END,
958        false,
959        textSize34,
960        1u,
961        13u,
962        positions34},
963
964       {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
965        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
966        true,
967        DevelText::LineWrap::WORD,
968        DevelText::EllipsisPosition::START,
969        false,
970        textSize35,
971        1u,
972        11u,
973        positions35},
974
975       {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
976        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
977        true,
978        DevelText::LineWrap::WORD,
979        DevelText::EllipsisPosition::MIDDLE,
980        false,
981        textSize36,
982        1u,
983        12u,
984        positions36},
985
986       {"EllipsisPosition: TextLabel: Mixed Directions Languages END",
987        "سیٹنگیں Projector سیٹنگیں",
988        false,
989        DevelText::LineWrap::WORD,
990        DevelText::EllipsisPosition::END,
991        false,
992        textSize37,
993        1u,
994        16u,
995        positions37},
996
997       {"EllipsisPosition: TextLabel: Mixed Directions Languages START",
998        "سیٹنگیں Projector سیٹنگیں",
999        false,
1000        DevelText::LineWrap::WORD,
1001        DevelText::EllipsisPosition::START,
1002        false,
1003        textSize38,
1004        1u,
1005        17u,
1006        positions38},
1007
1008     };
1009   const unsigned int numberOfTests = 41u;
1010
1011   for( unsigned int index = 0u; index < numberOfTests; ++index )
1012   {
1013     ToolkitTestApplication application;
1014     if( !ElideTestViewModel( data[index] ) )
1015     {
1016       tet_result(TET_FAIL);
1017     }
1018   }
1019
1020   tet_result(TET_PASS);
1021   END_TEST;
1022 }
1023
1024
1025 int UtcDaliTextFieldlElideTextLocation(void)
1026 {
1027   tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
1028
1029   Size textSize00( 100.f, 100.f );
1030
1031   Size  textSize01( 120.0f, 50.0f );
1032   float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1033
1034   Size  textSize02( 120.0f, 50.0f );
1035   float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
1036
1037   Size  textSize03( 120.0f, 50.0f );
1038   float positions03[] = { 117.0f, 111.0f, 97.0f, 88.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 31.0f, 22.0f, 7.0f };
1039
1040   Size  textSize04( 120.0f, 50.0f );
1041   float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1042
1043   Size  textSize05( 120.0f, 50.0f );
1044   float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1045
1046   Size  textSize06( 120.0f, 50.0f );
1047   float positions06[] = { 90.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 29.0f, 26.0f, 15.0f, 7.0f, 0.0f };
1048
1049   Size  textSize07( 120.0f, 50.0f );
1050   float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f };
1051
1052   Size  textSize08( 120.0f, 50.0f );
1053   float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1054
1055   Size  textSize09( 120.0f, 50.0f );
1056   float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f };
1057
1058   Size  textSize10( 120.0f, 50.0f );
1059   float positions10[] = { 121.0f, 116.0f, 111.0f, 106.0f, 101.0f, 96.0f, 92.0f, 87.0f, 83.0f, 77.0f, 63.0f, 55.0f, 46.0f, 40.0f, 30.0f, 16.0f };
1060
1061   Size  textSize11( 120.0f, 50.0f );
1062   float positions11[] = { 93.0f, 77.0f, 74.0f, 63.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 24.0f, 19.0f, 14.0f, 9.0f, 5.0f };
1063
1064   Size  textSize12( 120.0f, 50.0f );
1065   float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f };
1066
1067   Size  textSize13(145.0f, 30.0f);
1068   float positions13[] = {131.0f, 126.0f, 121.0f, 117.0f, 108.0f, 104.0f, 94.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f};
1069
1070   Size  textSize14(145.0f, 30.0f);
1071   float positions14[] = {51.0f, 66.0f, 71.0f, 80.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 28.0f, 23.0f, 14.0f, 10.0f, 0.0f};
1072
1073   struct ElideData data[] =
1074     {
1075       {"void text",
1076        "",
1077        false,
1078        DevelText::LineWrap::WORD,
1079        DevelText::EllipsisPosition::END,
1080        false,
1081        textSize00,
1082        0u,
1083        0u,
1084        nullptr},
1085
1086       {"void text",
1087        "",
1088        false,
1089        DevelText::LineWrap::WORD,
1090        DevelText::EllipsisPosition::START,
1091        false,
1092        textSize00,
1093        0u,
1094        0u,
1095        nullptr},
1096
1097       {"void text",
1098        "",
1099        false,
1100        DevelText::LineWrap::WORD,
1101        DevelText::EllipsisPosition::MIDDLE,
1102        false,
1103        textSize00,
1104        0u,
1105        0u,
1106        nullptr},
1107
1108       {"EllipsisPosition: TextField: Basic case SingleLine LTR END",
1109        "A0123456789 B0123456789 C0123456789 D0123456789 ",
1110        false,
1111        DevelText::LineWrap::WORD,
1112        DevelText::EllipsisPosition::END,
1113        false,
1114        textSize01,
1115        1u,
1116        10u,
1117        positions01},
1118
1119       {"EllipsisPosition: TextField: SingleLine LTR END",
1120        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
1121        false,
1122        DevelText::LineWrap::WORD,
1123        DevelText::EllipsisPosition::END,
1124        false,
1125        textSize02,
1126        1u,
1127        13u,
1128        positions02},
1129
1130       {"EllipsisPosition: TextField: SingleLine RTL END",
1131        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1132        false,
1133        DevelText::LineWrap::WORD,
1134        DevelText::EllipsisPosition::END,
1135        false,
1136        textSize03,
1137        1u,
1138        14u,
1139        positions03},
1140
1141       {"EllipsisPosition: TextField: Basic case SingleLine LTR START",
1142        "A0123456789 B0123456789 C0123456789 D0123456789 ",
1143        false,
1144        DevelText::LineWrap::WORD,
1145        DevelText::EllipsisPosition::START,
1146        false,
1147        textSize04,
1148        1u,
1149        11u,
1150        positions04},
1151
1152       {"EllipsisPosition: TextField: SingleLine LTR START",
1153        "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
1154        false,
1155        DevelText::LineWrap::WORD,
1156        DevelText::EllipsisPosition::START,
1157        false,
1158        textSize05,
1159        1u,
1160        11u,
1161        positions05},
1162
1163       {"EllipsisPosition: TextField: SingleLine RTL START",
1164        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1165        false,
1166        DevelText::LineWrap::WORD,
1167        DevelText::EllipsisPosition::START,
1168        false,
1169        textSize06,
1170        1u,
1171        13u,
1172        positions06},
1173
1174       {"EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
1175        "A0123456789 B0123456789 C0123456789 D0123456789 ",
1176        false,
1177        DevelText::LineWrap::WORD,
1178        DevelText::EllipsisPosition::MIDDLE,
1179        false,
1180        textSize07,
1181        1u,
1182        11u,
1183        positions07},
1184
1185       {"EllipsisPosition: TextField: SingleLine LTR MIDDLE",
1186        "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
1187        false,
1188        DevelText::LineWrap::WORD,
1189        DevelText::EllipsisPosition::MIDDLE,
1190        false,
1191        textSize08,
1192        1u,
1193        13u,
1194        positions08},
1195
1196       {"EllipsisPosition: TextField: SingleLine RTL MIDDLE",
1197        "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1198        false,
1199        DevelText::LineWrap::WORD,
1200        DevelText::EllipsisPosition::MIDDLE,
1201        false,
1202        textSize09,
1203        1u,
1204        13u,
1205        positions09},
1206
1207       {"EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
1208        "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1209        false,
1210        DevelText::LineWrap::WORD,
1211        DevelText::EllipsisPosition::END,
1212        false,
1213        textSize10,
1214        1u,
1215        16u,
1216        positions10},
1217
1218       {"EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
1219        "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1220        false,
1221        DevelText::LineWrap::WORD,
1222        DevelText::EllipsisPosition::START,
1223        false,
1224        textSize11,
1225        1u,
1226        15u,
1227        positions11},
1228
1229       {"EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
1230        "        السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة         ",
1231        false,
1232        DevelText::LineWrap::WORD,
1233        DevelText::EllipsisPosition::MIDDLE,
1234        false,
1235        textSize12,
1236        1u,
1237        20u,
1238        positions12},
1239
1240       {"EllipsisPosition: TextField: Mixed Directions Languages END",
1241        "سیٹنگیں Projector سیٹنگیں",
1242        false,
1243        DevelText::LineWrap::WORD,
1244        DevelText::EllipsisPosition::END,
1245        false,
1246        textSize13,
1247        1u,
1248        16,
1249        positions13},
1250
1251       {"EllipsisPosition: TextField: Mixed Directions Languages START",
1252        "سیٹنگیں Projector سیٹنگیں",
1253        false,
1254        DevelText::LineWrap::WORD,
1255        DevelText::EllipsisPosition::START,
1256        false,
1257        textSize14,
1258        1u,
1259        17,
1260        positions14},
1261
1262     };
1263
1264   const unsigned int numberOfTests = 17u;
1265
1266   for( unsigned int index = 0u; index < numberOfTests; ++index )
1267   {
1268     ToolkitTestApplication application;
1269     if( !ElideTestTextView( data[index] ) )
1270     {
1271       tet_result(TET_FAIL);
1272     }
1273   }
1274   tet_result(TET_PASS);
1275   END_TEST;
1276
1277 }
1278
1279
1280 int UtcDaliTextEditorElideTextLocation(void)
1281 {
1282   tet_infoline(" UtcDaliTextEditorElideTextLocation ");
1283
1284   Size textSize00( 100.f, 100.f );
1285
1286   Size  textSize01( 120.0f, 50.0f );
1287   float positions01[] =  { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f };
1288
1289   Size  textSize02( 120.0f, 60.0f );
1290   float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 0.0f };
1291
1292   Size  textSize03( 120.0f, 60.0f );
1293   float positions03[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 92.0f };
1294
1295   Size  textSize04( 110.0f, 60.0f );
1296   float positions04[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1297
1298   Size  textSize05( 110.0f, 60.0f );
1299   float positions05[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1300
1301   Size  textSize06( 120.0f, 50.0f );
1302   float positions06[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 70.0f, 80.0f, 90.0f, 100.0f, 109.0f };
1303
1304   Size  textSize07( 120.0f, 60.0f );
1305   float positions07[] = { 8.0f, 24.0f, 28.0f, 36.0f, 47.0f, 61.0f, 70.0f, 76.0f, 87.0f, 97.0f, 102.0f, 105.0f, 115.0f };
1306
1307   Size  textSize08( 120.0f, 60.0f );
1308   float positions08[] = { 8.0f, 24.0f, 33.0f, 38.0f, 52.0f, 63.0f, 66.0f, 75.0f, 85.0f, 99.0f, 109.0f };
1309
1310   Size  textSize09( 100.0f, 60.0f );
1311   float positions09[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f };
1312
1313   Size  textSize10( 100.0f, 60.0f );
1314   float positions10[] = { 4.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1315
1316   Size  textSize11( 120.0f, 60.0f );
1317   float positions11[] = { 117.0f, 111.0f, 97.0f, 89.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 32.0f, 112.0f, 103.0f, 94.0f, 89.0f };
1318
1319   Size  textSize12( 110.0f, 60.0f );
1320   float positions12[] = { 109.0f, 102.0f, 89.0f, 80.0f, 72.0f, 66.0f, 56.0f, 50.0f, 46.0f, 37.0f, 29.0f, 23.0f, 14.0f };
1321
1322   Size  textSize13( 110.0f, 60.0f );
1323   float positions13[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f, 57.0f, 53.0f, 44.0f, 36.0f, 31.0f, 111.0f };
1324
1325   Size  textSize14( 110.0f, 60.0f );
1326   float positions14[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f, 57.0f, 53.0f, 44.0f, 36.0f, 31.0f, 111.0f };
1327
1328   Size  textSize15( 120.0f, 60.0f );
1329   float positions15[] = { 130.0f, 118.0f, 113.0f, 111.0f, 105.0f, 101.0f, 91.0f, 83.0f, 78.0f, 69.0f, 62.0f, 58.0f, 54.0f };
1330
1331   Size  textSize16( 110.0f, 60.0f );
1332   float positions16[] = { 92.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 32.0f, 29.0f, 18.0f, 13.0f, 8.0f, 6.0f };
1333
1334   Size  textSize17( 110.0f, 60.0f );
1335   float positions17[] = { 110.0f, 98.0f, 93.0f, 91.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 34.0f };
1336
1337   Size  textSize18( 110.0f, 60.0f );
1338   float positions18[] = { 110.0f, 98.0f, 93.0f, 91.0f, 85.0f, 81.0f, 71.0f, 63.0f, 58.0f, 49.0f, 42.0f, 38.0f, 34.0f };
1339
1340   Size  textSize19( 120.0f, 50.0f );
1341   float positions19[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
1342
1343   Size  textSize20( 120.0f, 60.0f );
1344   float positions20[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1345
1346   Size  textSize21( 120.0f, 60.0f );
1347   float positions21[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f };
1348
1349   Size  textSize22( 110.0f, 60.0f );
1350   float positions22[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f };
1351
1352   Size  textSize23( 110.0f, 60.0f );
1353   float positions23[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1354
1355   Size  textSize24( 120.0f, 60.0f );
1356   float positions24[] = { 142.0f, 135.0f, 121.0f, 113.0f, 104.0f, 98.0f, 88.0f, 83.0f, 78.0f, 70.0f, 61.0f };
1357
1358   Size  textSize25( 110.0f, 60.0f );
1359   float positions25[] = { 111.0f, 104.0f, 90.0f, 82.0f, 73.0f, 67.0f, 57.0f, 52.0f, 47.0f, 39.0f, 30.0f, 24.0f, 15.0f, 7.0f };
1360
1361   Size  textSize26( 110.0f, 60.0f );
1362   float positions26[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1363
1364   Size  textSize27( 110.0f, 60.0f );
1365   float positions27[] = { 122.0f, 115.0f, 101.0f, 93.0f, 84.0f, 78.0f, 68.0f, 63.0f, 58.0f, 50.0f, 41.0f };
1366
1367   Size  textSize28( 120.0f, 30.0f );
1368   float positions28[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
1369
1370   Size  textSize29( 120.0f, 30.0f );
1371   float positions29[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
1372
1373   Size  textSize30( 120.0f, 30.0f );
1374   float positions30[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
1375
1376
1377   struct ElideData data[] =
1378   {
1379     {
1380       "void text",
1381       "",
1382       true,
1383       DevelText::LineWrap::WORD,
1384       DevelText::EllipsisPosition::END,
1385       false,
1386       textSize00,
1387       0u,
1388       0u,
1389       nullptr
1390     },
1391
1392     {
1393       "void text",
1394       "",
1395       true,
1396       DevelText::LineWrap::WORD,
1397       DevelText::EllipsisPosition::START,
1398       false,
1399       textSize00,
1400       0u,
1401       0u,
1402       nullptr
1403     },
1404
1405     {
1406       "void text",
1407       "",
1408       true,
1409       DevelText::LineWrap::WORD,
1410       DevelText::EllipsisPosition::MIDDLE,
1411       false,
1412       textSize00,
1413       0u,
1414       0u,
1415       nullptr
1416     },
1417
1418    //END LTR cases
1419
1420     {
1421       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR END",
1422       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1423       true,
1424       DevelText::LineWrap::WORD,
1425       DevelText::EllipsisPosition::END,
1426       false,
1427       textSize01,
1428       2u,
1429       22u,
1430       positions01
1431     },
1432
1433     {
1434       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR END",
1435       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1436       true,
1437       DevelText::LineWrap::WORD,
1438       DevelText::EllipsisPosition::END,
1439       false,
1440       textSize02,
1441       3u,
1442       29u,
1443       positions02
1444     },
1445
1446     {
1447       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR END",
1448       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1449       true,
1450       DevelText::LineWrap::CHARACTER,
1451       DevelText::EllipsisPosition::END,
1452       false,
1453       textSize03,
1454       3u,
1455       40u,
1456       positions03
1457     },
1458
1459     {
1460       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR END",
1461       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1462       true,
1463       DevelText::LineWrap::HYPHENATION,
1464       DevelText::EllipsisPosition::END,
1465       false,
1466       textSize04,
1467       3u,
1468       32u,
1469       positions04
1470     },
1471
1472     {
1473       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR END",
1474       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1475       true,
1476       DevelText::LineWrap::MIXED,
1477       DevelText::EllipsisPosition::END,
1478       false,
1479       textSize05,
1480       3u,
1481       28u,
1482       positions05
1483     },
1484
1485    //START LTR cases
1486
1487     {
1488       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR START",
1489       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1490       true,
1491       DevelText::LineWrap::WORD,
1492       DevelText::EllipsisPosition::START,
1493       false,
1494       textSize06,
1495       2u,
1496       23u,
1497       positions06
1498     },
1499
1500     {
1501       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR START",
1502       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1503       true,
1504       DevelText::LineWrap::WORD,
1505       DevelText::EllipsisPosition::START,
1506       false,
1507       textSize07,
1508       3u,
1509       33u,
1510       positions07
1511     },
1512
1513     {
1514       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR START",
1515       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1516       true,
1517       DevelText::LineWrap::CHARACTER,
1518       DevelText::EllipsisPosition::START,
1519       false,
1520       textSize08,
1521       3u,
1522       37u,
1523       positions08
1524     },
1525
1526     {
1527       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR START",
1528       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1529       true,
1530       DevelText::LineWrap::HYPHENATION,
1531       DevelText::EllipsisPosition::START,
1532       false,
1533       textSize09,
1534       3u,
1535       25u,
1536       positions09
1537     },
1538
1539     {
1540       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR START",
1541       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1542       true,
1543       DevelText::LineWrap::MIXED,
1544       DevelText::EllipsisPosition::START,
1545       false,
1546       textSize10,
1547       3u,
1548       25u,
1549       positions10
1550     },
1551
1552   //END RTL cases
1553
1554     {
1555       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL END",
1556       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1557       true,
1558       DevelText::LineWrap::WORD,
1559       DevelText::EllipsisPosition::END,
1560       false,
1561       textSize11,
1562       3u,
1563       42u,
1564       positions11
1565     },
1566
1567     {
1568       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL END",
1569       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1570       true,
1571       DevelText::LineWrap::CHARACTER,
1572       DevelText::EllipsisPosition::END,
1573       false,
1574       textSize12,
1575       3u,
1576       44u,
1577       positions12
1578     },
1579
1580     {
1581       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL END",
1582       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1583       true,
1584       DevelText::LineWrap::HYPHENATION,
1585       DevelText::EllipsisPosition::END,
1586       false,
1587       textSize13,
1588       3u,
1589       39u,
1590       positions13
1591     },
1592
1593     {
1594       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL END",
1595       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1596       true,
1597       DevelText::LineWrap::MIXED,
1598       DevelText::EllipsisPosition::END,
1599       false,
1600       textSize14,
1601       3u,
1602       39u,
1603       positions14
1604     },
1605
1606    //START RTL cases
1607
1608     {
1609       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL START",
1610       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1611       true,
1612       DevelText::LineWrap::WORD,
1613       DevelText::EllipsisPosition::START,
1614       false,
1615       textSize15,
1616       3u,
1617       33u,
1618       positions15
1619     },
1620
1621     {
1622       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL START",
1623       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1624       true,
1625       DevelText::LineWrap::CHARACTER,
1626       DevelText::EllipsisPosition::START,
1627       false,
1628       textSize16,
1629       3u,
1630       30u,
1631       positions16
1632     },
1633
1634     {
1635       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL START",
1636       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1637       true,
1638       DevelText::LineWrap::HYPHENATION,
1639       DevelText::EllipsisPosition::START,
1640       false,
1641       textSize17,
1642       3u,
1643       33u,
1644       positions17
1645     },
1646
1647     {
1648       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL START",
1649       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1650       true,
1651       DevelText::LineWrap::MIXED,
1652       DevelText::EllipsisPosition::START,
1653       false,
1654       textSize18,
1655       3u,
1656       33u,
1657       positions18
1658     },
1659
1660 //MIDDLE LTR cases
1661
1662     {
1663       "EllipsisPosition: TextEditor: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
1664       "A0123456789 B0123456789 C0123456789 D0123456789 ",
1665       true,
1666       DevelText::LineWrap::WORD,
1667       DevelText::EllipsisPosition::MIDDLE,
1668       false,
1669       textSize19,
1670       2u,
1671       22u,
1672       positions19
1673     },
1674
1675     {
1676       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD LTR MIDDLE",
1677       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1678       true,
1679       DevelText::LineWrap::WORD,
1680       DevelText::EllipsisPosition::MIDDLE,
1681       false,
1682       textSize20,
1683       3u,
1684       24u,
1685       positions20
1686     },
1687
1688     {
1689       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
1690       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1691       true,
1692       DevelText::LineWrap::CHARACTER,
1693       DevelText::EllipsisPosition::MIDDLE,
1694       false,
1695       textSize21,
1696       3u,
1697       36u,
1698       positions21
1699     },
1700
1701     {
1702       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
1703       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1704       true,
1705       DevelText::LineWrap::HYPHENATION,
1706       DevelText::EllipsisPosition::MIDDLE,
1707       false,
1708       textSize22,
1709       3u,
1710       27u,
1711       positions22
1712     },
1713
1714     {
1715       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED LTR MIDDLE",
1716       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1717       true,
1718       DevelText::LineWrap::MIXED,
1719       DevelText::EllipsisPosition::MIDDLE,
1720       false,
1721       textSize23,
1722       3u,
1723       24u,
1724       positions23
1725     },
1726
1727 //MIDDLE RTL cases
1728
1729     {
1730       "EllipsisPosition: TextEditor: Mulitlines LineWrap-WORD RTL MIDDLE",
1731       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1732       true,
1733       DevelText::LineWrap::WORD,
1734       DevelText::EllipsisPosition::MIDDLE,
1735       false,
1736       textSize24,
1737       3u,
1738       31u,
1739       positions24
1740     },
1741
1742     {
1743       "EllipsisPosition: TextEditor: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
1744       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1745       true,
1746       DevelText::LineWrap::CHARACTER,
1747       DevelText::EllipsisPosition::MIDDLE,
1748       false,
1749       textSize25,
1750       3u,
1751       29u,
1752       positions25
1753     },
1754
1755     {
1756       "EllipsisPosition: TextEditor: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
1757       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1758       true,
1759       DevelText::LineWrap::HYPHENATION,
1760       DevelText::EllipsisPosition::MIDDLE,
1761       false,
1762       textSize26,
1763       3u,
1764       31u,
1765       positions26
1766     },
1767
1768     {
1769       "EllipsisPosition: TextEditor: Mulitlines LineWrap-MIXED RTL MIDDLE",
1770       "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة",
1771       true,
1772       DevelText::LineWrap::MIXED,
1773       DevelText::EllipsisPosition::MIDDLE,
1774       false,
1775       textSize27,
1776       3u,
1777       31u,
1778       positions27
1779     },
1780
1781     {
1782       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR END",
1783       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1784       true,
1785       DevelText::LineWrap::WORD,
1786       DevelText::EllipsisPosition::END,
1787       false,
1788       textSize28,
1789       1u,
1790       13u,
1791       positions28
1792     },
1793
1794     {
1795       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR START",
1796       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1797       true,
1798       DevelText::LineWrap::WORD,
1799       DevelText::EllipsisPosition::START,
1800       false,
1801       textSize29,
1802       1u,
1803       11u,
1804       positions29
1805     },
1806
1807     {
1808       "EllipsisPosition: TextEditor: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
1809       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
1810       true,
1811       DevelText::LineWrap::WORD,
1812       DevelText::EllipsisPosition::MIDDLE,
1813       false,
1814       textSize30,
1815       1u,
1816       12u,
1817       positions30
1818     },
1819
1820   };
1821   const unsigned int numberOfTests = 33u;
1822
1823   for( unsigned int index = 0u; index < numberOfTests; ++index )
1824   {
1825     ToolkitTestApplication application;
1826     if( !ElideTestTextView( data[index] ) )
1827     {
1828       tet_result(TET_FAIL);
1829     }
1830   }
1831
1832   tet_result(TET_PASS);
1833   END_TEST;
1834 }