Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / controls / FUiCtrlExpandableEditArea.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FUiCtrlExpandableEditArea.cpp
20  * @brief       This file contains implementation of ExpandableEditArea class
21  */
22
23 #include <FBaseSysLog.h>
24 #include <FUiCtrlExpandableEditArea.h>
25 #include "FUiCtrl_ExpandableEditAreaImpl.h"
26
27 using namespace Tizen::Base;
28 using namespace Tizen::Base::Runtime;
29 using namespace Tizen::Graphics;
30 using namespace Tizen::Locales;
31 using namespace Tizen::Ui;
32 using namespace Tizen::Ui::Controls;
33
34 static const int MINIMUM_SIZE_VALUE = 0;
35 static const int MAXIMUM_SIZE_VALUE = 65535;
36 static const int MAX_EXPANDABLE_LINES = 100;
37
38 namespace Tizen { namespace Ui { namespace Controls
39 {
40
41 ExpandableEditArea::ExpandableEditArea(void)
42 {
43         // Nothing.
44 }
45
46 ExpandableEditArea::~ExpandableEditArea(void)
47 {
48         // Nothing.
49 }
50
51 result
52 ExpandableEditArea::Construct(const Rectangle& rect, ExpandableEditAreaStyle style,
53                                                           ExpandableEditAreaTitleStyle titleStyle,
54                                                           int maxExpandableLines)
55 {
56         result r = E_SUCCESS;
57
58         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
59         SysAssertf(pImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
60
61         SysTryReturnResult(NID_UI_CTRL, (maxExpandableLines > 0), E_INVALID_ARG, "Invalid argument is used. maxExpandableLines is less than zero");
62         SysTryReturnResult(NID_UI_CTRL, (maxExpandableLines <= MAX_EXPANDABLE_LINES), E_MAX_EXCEEDED, "maxExpandableLines exceeds the maximum limit.");
63
64         SysTryReturnResult(NID_UI_CTRL, !(style == EXPANDABLE_EDIT_AREA_STYLE_TOKEN && titleStyle == EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP),
65                                             E_UNSUPPORTED_OPTION, "The input option EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP is unsupported. The token style EXPANDABLE_EDIT_AREA_STYLE_TOKEN does not support the title style EXPANDABLE_EDIT_AREA_TITLE_STYLE_TOP");
66
67         SysTryReturnResult(NID_UI_CTRL,
68                                            (rect.width >= MINIMUM_SIZE_VALUE && rect.width <= MAXIMUM_SIZE_VALUE && rect.height >= MINIMUM_SIZE_VALUE && rect.height <= MAXIMUM_SIZE_VALUE), E_INVALID_ARG,
69                                            "Invalid argument is used. The specified size(%d, %d) is outside range of min size(%d, %d) and max size(%d, %d) of ExpandableEditArea."
70                                            , rect.width, rect.height, MINIMUM_SIZE_VALUE, MINIMUM_SIZE_VALUE, MAXIMUM_SIZE_VALUE, MAXIMUM_SIZE_VALUE);
71
72         pImpl = _ExpandableEditAreaImpl::CreateExpandableEditAreaImplN(this, rect, style, titleStyle);
73         r = GetLastResult();
74         SysTryCatch(NID_UI_CTRL, pImpl != null, , r, "[%s] Propagating.", GetErrorMessage(r));
75
76         _pControlImpl = pImpl;
77
78         r = SetBounds(rect);
79         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
80
81         r = pImpl->Construct(rect, style, titleStyle, maxExpandableLines);
82         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
83
84         return r;
85
86 CATCH:
87         Control::Dispose();
88         return r;
89 }
90
91 result
92 ExpandableEditArea::AppendCharacter(const Character& character)
93 {
94         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
95         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
96
97         return pImpl->AppendCharacter(character);
98 }
99
100 result
101 ExpandableEditArea::AppendText(const String& text)
102 {
103         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
104         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
105
106         return pImpl->AppendText(text);
107 }
108
109 result
110 ExpandableEditArea::AppendText(const String& text, const Bitmap& textImage)
111 {
112         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
113         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
114
115         return pImpl->AppendText(text, textImage);
116 }
117
118 result
119 ExpandableEditArea::DeleteCharacterAt(int index)
120 {
121         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
122         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
123
124         return pImpl->DeleteCharacterAt(index);
125 }
126
127 result
128 ExpandableEditArea::InsertCharacterAt(int index, const Character& character)
129 {
130         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
131         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
132
133         return pImpl->InsertCharacterAt(index, character);
134 }
135
136 result
137 ExpandableEditArea::InsertTextAt(int index, const String& text)
138 {
139         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
140         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
141
142         return pImpl->InsertTextAt(index, text);
143 }
144
145 result
146 ExpandableEditArea::InsertTextAt(int position, const String& text, const Bitmap& textImage)
147 {
148         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
149         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
150
151         return pImpl->InsertTextAt(position, text, textImage);
152 }
153
154 String
155 ExpandableEditArea::GetText(int start, int end) const
156 {
157         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
158         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
159
160         return pImpl->GetText(start, end);
161 }
162
163 String
164 ExpandableEditArea::GetText(void) const
165 {
166         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
167         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
168
169         return pImpl->GetText();
170 }
171
172 int
173 ExpandableEditArea::GetTextLength(void) const
174 {
175         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
176         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
177
178         return pImpl->GetTextLength();
179 }
180
181 result
182 ExpandableEditArea::SetText(const String& text)
183 {
184         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
185         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
186
187         return pImpl->SetText(text);
188 }
189
190 result
191 ExpandableEditArea::Clear(void)
192 {
193         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
194         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
195
196         return pImpl->Clear();
197 }
198
199 result
200 ExpandableEditArea::SetTitleText(const String& title)
201 {
202         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
203         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
204
205         return pImpl->SetTitleText(title);
206 }
207
208 String
209 ExpandableEditArea::GetTitleText(void) const
210 {
211         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
212         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
213
214         return pImpl->GetTitleText();
215 }
216
217 String
218 ExpandableEditArea::GetGuideText(void) const
219 {
220         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
221         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
222
223         return pImpl->GetGuideText();
224 }
225
226 result
227 ExpandableEditArea::SetGuideText(const String& guideText)
228 {
229         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
230         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
231
232         return pImpl->SetGuideText(guideText);
233 }
234
235 int
236 ExpandableEditArea::GetLineSpacing (void) const
237 {
238         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
239         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
240
241         return pImpl->GetLineSpacing();
242 }
243
244 result
245 ExpandableEditArea::SetLineSpacing (int multiplier, int extra)
246 {
247         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
248         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
249
250         return pImpl->SetLineSpacing(multiplier, extra);
251 }
252
253 int
254 ExpandableEditArea::GetMaxLineCount(void) const
255 {
256         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
257         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
258
259         return pImpl->GetMaxLineCount();
260 }
261
262 int
263 ExpandableEditArea::GetTextLineCount(void) const
264 {
265         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
266         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
267
268         return pImpl->GetTextLineCount();
269 }
270
271 int
272 ExpandableEditArea::GetTextSize(void) const
273 {
274         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
275         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
276
277         return pImpl->GetTextSize();
278 }
279
280 result
281 ExpandableEditArea::SetTextSize(int size)
282 {
283         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
284         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
285
286         return pImpl->SetTextSize(size);
287 }
288
289 int
290 ExpandableEditArea::GetMargin(EditMarginType marginType) const
291 {
292         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
293         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
294
295         return pImpl->GetMargin(marginType);
296 }
297
298 result
299 ExpandableEditArea::SetMargin(EditMarginType marginType, int margin)
300 {
301         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
302         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
303
304         return pImpl->SetMargin(marginType, margin);
305 }
306
307 result
308 ExpandableEditArea::SetLowerCaseModeEnabled(bool enable)
309 {
310         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
311         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
312
313         return pImpl->SetLowerCaseModeEnabled(enable);
314 }
315
316 bool
317 ExpandableEditArea::IsLowerCaseModeEnabled(void) const
318 {
319         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
320         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
321
322         return pImpl->IsLowerCaseModeEnabled();
323 }
324
325 int
326 ExpandableEditArea::GetCursorPosition(void) const
327 {
328         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
329         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
330
331         return pImpl->GetCursorPosition();
332 }
333
334 result
335 ExpandableEditArea::SetCursorPosition(int position)
336 {
337         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
338         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
339
340         return pImpl->SetCursorPosition(position);
341 }
342
343 result
344 ExpandableEditArea::GetBlockRange(int& start, int& end) const
345 {
346         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
347         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
348
349         return pImpl->GetBlockRange(start, end);
350 }
351
352 result
353 ExpandableEditArea::ReleaseBlock(void)
354 {
355         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
356         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
357
358         return pImpl->ReleaseBlock();
359 }
360
361 result
362 ExpandableEditArea::RemoveTextBlock(void)
363 {
364         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
365         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
366
367         return pImpl->RemoveTextBlock();
368 }
369
370 result
371 ExpandableEditArea::SetBlockRange(int start, int end)
372 {
373         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
374         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
375
376         return pImpl->SetBlockRange(start, end);
377 }
378
379 KeypadAction
380 ExpandableEditArea::GetKeypadAction(void) const
381 {
382         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
383         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
384
385         return pImpl->GetKeypadAction();
386 }
387
388 KeypadStyle
389 ExpandableEditArea::GetKeypadStyle(void) const
390 {
391         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
392         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
393
394         return pImpl->GetKeypadStyle();
395 }
396
397 result
398 ExpandableEditArea::HideKeypad(void)
399 {
400         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
401         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
402
403         return pImpl->HideKeypad();
404 }
405
406 bool
407 ExpandableEditArea::IsKeypadEnabled(void) const
408 {
409         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
410         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
411
412         return pImpl->IsKeypadEnabled();
413 }
414
415 result
416 ExpandableEditArea::SetKeypadAction(KeypadAction keypadAction)
417 {
418         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
419         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
420
421         return pImpl->SetKeypadAction(keypadAction);
422 }
423
424 result
425 ExpandableEditArea::SetKeypadStyle(KeypadStyle keypadStyle)
426 {
427         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
428         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
429
430         return pImpl->SetKeypadStyle(keypadStyle);
431 }
432
433 bool
434 ExpandableEditArea::IsTextPredictionEnabled(void) const
435 {
436         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
437         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
438
439         return pImpl->IsTextPredictionEnabled();
440 }
441
442 result
443 ExpandableEditArea::SetTextPredictionEnabled(bool enable)
444 {
445         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
446         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
447
448         return pImpl->SetTextPredictionEnabled(enable);
449 }
450
451 result
452 ExpandableEditArea::SetKeypadEnabled(bool enable)
453 {
454         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
455         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
456
457         pImpl->SetKeypadEnabled(enable);
458
459         return E_SUCCESS;
460 }
461
462 result
463 ExpandableEditArea::ShowKeypad(void)
464 {
465         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
466         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
467
468         return pImpl->ShowKeypad();
469 }
470
471 result
472 ExpandableEditArea::SetTokenFilter(const ITokenFilter* pFilter)
473 {
474         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
475         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
476
477         return pImpl->SetTokenFilter(pFilter);
478 }
479
480 ITokenFilter*
481 ExpandableEditArea::GetTokenFilter(void) const
482 {
483         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
484         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
485
486         return pImpl->GetTokenFilter();
487 }
488
489 result
490 ExpandableEditArea::AppendToken(const String& token)
491 {
492         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
493         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
494
495         return pImpl->AppendToken(token);
496 }
497
498 result
499 ExpandableEditArea::InsertTokenAt(int index, const String& token)
500 {
501         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
502         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
503
504         return pImpl->InsertTokenAt(index, token);
505 }
506
507 String
508 ExpandableEditArea::GetTokenAt(int index) const
509 {
510         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
511         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
512
513         return pImpl->GetTokenAt(index);
514 }
515
516 int
517 ExpandableEditArea::GetTokenCount(void) const
518 {
519         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
520         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
521
522         return pImpl->GetTokenCount();
523 }
524
525 int
526 ExpandableEditArea::GetSelectedTokenIndex(void) const
527 {
528         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
529         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
530
531         return pImpl->GetSelectedTokenIndex();
532 }
533
534 bool
535 ExpandableEditArea::IsTokenEditModeEnabled(void) const
536 {
537         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
538         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
539
540         return pImpl->IsTokenEditModeEnabled();
541 }
542
543 result
544 ExpandableEditArea::RemoveTokenAt(int index)
545 {
546         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
547         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
548
549         return pImpl->RemoveTokenAt(index);
550 }
551
552 result
553 ExpandableEditArea::SetTokenSelected(int index, bool selected)
554 {
555         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
556         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
557
558         return pImpl->SetTokenSelected(index, selected);
559 }
560
561 result
562 ExpandableEditArea::SetTokenEditModeEnabled(bool enable)
563 {
564         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
565         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
566
567         return pImpl->SetTokenEditModeEnabled(enable);
568 }
569
570 int
571 ExpandableEditArea::GetLimitLength(void) const
572 {
573         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
574         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
575
576         return pImpl->GetLimitLength();
577 }
578
579 result
580 ExpandableEditArea::SetLimitLength(int limitLength)
581 {
582         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
583         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
584
585         return pImpl->SetLimitLength(limitLength);
586 }
587
588 Color
589 ExpandableEditArea::GetColor(EditStatus status) const
590 {
591         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
592         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
593
594         return pImpl->GetColor(status);
595 }
596
597 Color
598 ExpandableEditArea::GetTextColor(EditTextColor type) const
599 {
600         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
601         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
602
603         return pImpl->GetTextColor(type);
604 }
605
606 Color
607 ExpandableEditArea::GetGuideTextColor(void) const
608 {
609         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
610         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
611
612         return pImpl->GetGuideTextColor();
613 }
614
615 Color
616 ExpandableEditArea::GetTitleTextColor(EditStatus status) const
617 {
618         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
619         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
620
621         return pImpl->GetTitleTextColor(status);
622 }
623
624 Color
625 ExpandableEditArea::GetTokenColor(ExpandableEditAreaTokenStatus status) const
626 {
627         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
628         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
629
630         return pImpl->GetTokenColor(status);
631 }
632
633 Color
634 ExpandableEditArea::GetTokenTextColor(void) const
635 {
636         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
637         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
638
639         return pImpl->GetTokenTextColor();
640 }
641
642 Color
643 ExpandableEditArea::GetSelectedTokenTextColor(void) const
644 {
645         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
646         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
647
648         return pImpl->GetSelectedTokenTextColor();
649 }
650
651 result
652 ExpandableEditArea::SetBackgroundBitmap(EditStatus status, const Bitmap& bitmap)
653 {
654         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
655         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
656
657         return pImpl->SetBackgroundBitmap(status, bitmap);
658 }
659
660 result
661 ExpandableEditArea::SetColor(EditStatus status, const Color& color)
662 {
663         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
664         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
665
666         return pImpl->SetColor(status, color);
667 }
668
669 result
670 ExpandableEditArea::SetGuideTextColor(const Color& color)
671 {
672         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
673         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
674
675         return pImpl->SetGuideTextColor(color);
676 }
677
678 result
679 ExpandableEditArea::SetTitleTextColor(EditStatus status, const Color& color)
680 {
681         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
682         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
683
684         return pImpl->SetTitleTextColor(status, color);
685 }
686
687 result
688 ExpandableEditArea::SetTextColor(EditTextColor type, const Color& color)
689 {
690         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
691         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
692
693         return pImpl->SetTextColor(type, color);
694 }
695
696 result
697 ExpandableEditArea::SetSelectedTokenTextColor(const Color& color)
698 {
699         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
700         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
701
702         return pImpl->SetSelectedTokenTextColor(color);
703 }
704
705 result
706 ExpandableEditArea::SetTokenColor(ExpandableEditAreaTokenStatus status, const Color& color)
707 {
708         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
709         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
710
711         return pImpl->SetTokenColor(status, color);
712 }
713
714 result
715 ExpandableEditArea::SetTokenTextColor(const Color& color)
716 {
717         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
718         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
719
720         return pImpl->SetTokenTextColor(color);
721 }
722
723 result
724 ExpandableEditArea::SetAutoResizingEnabled(bool enable)
725 {
726         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
727         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
728
729         return pImpl->SetAutoResizingEnabled(enable);
730 }
731
732 bool
733 ExpandableEditArea::IsAutoResizingEnabled(void) const
734 {
735         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
736         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
737
738         return pImpl->IsAutoResizingEnabled();
739 }
740
741 result
742 ExpandableEditArea::SetCurrentLanguage(LanguageCode languageCode)
743 {
744         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
745         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
746
747         return pImpl->SetCurrentLanguage(languageCode);
748 }
749
750 result
751 ExpandableEditArea::GetCurrentLanguage(LanguageCode& language) const
752 {
753         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
754         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
755
756         return pImpl->GetCurrentLanguage(language);
757 }
758
759 void
760 ExpandableEditArea::AddExpandableEditAreaEventListener(IExpandableEditAreaEventListener& listener)
761 {
762         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
763         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
764
765         result r = pImpl->AddExpandableEditAreaEventListener(listener);
766         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
767 }
768
769 void
770 ExpandableEditArea::AddKeypadEventListener(IKeypadEventListener& listener)
771 {
772         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
773         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
774
775         result r = pImpl->AddKeypadEventListener(listener);
776         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
777 }
778
779 void
780 ExpandableEditArea::AddTextBlockEventListener(ITextBlockEventListener& listener)
781 {
782         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
783         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
784
785         result r = pImpl->AddTextBlockEventListener(listener);
786         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
787 }
788
789 void
790 ExpandableEditArea::AddTextEventListener(ITextEventListener& listener)
791 {
792         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
793         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
794
795         result r = pImpl->AddTextEventListener(listener);
796         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
797 }
798
799 void
800 ExpandableEditArea::RemoveExpandableEditAreaEventListener(IExpandableEditAreaEventListener& listener)
801 {
802         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
803         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
804
805         result r = pImpl->RemoveExpandableEditAreaEventListener(listener);
806         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
807 }
808
809 void
810 ExpandableEditArea::RemoveKeypadEventListener(IKeypadEventListener& listener)
811 {
812         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
813         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
814
815         result r = pImpl->RemoveKeypadEventListener(listener);
816         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
817 }
818
819 void
820 ExpandableEditArea::RemoveTextBlockEventListener(ITextBlockEventListener& listener)
821 {
822         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
823         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
824
825         result r = pImpl->RemoveTextBlockEventListener(listener);
826         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
827 }
828
829 void
830 ExpandableEditArea::RemoveTextEventListener(ITextEventListener& listener)
831 {
832         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
833         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
834
835         result r = pImpl->RemoveTextEventListener(listener);
836         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
837 }
838
839 void
840 ExpandableEditArea::AddLanguageEventListener(ILanguageEventListener& listener)
841 {
842         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
843         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
844
845         result r = pImpl->AddLanguageEventListener(listener);
846         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
847 }
848
849 void
850 ExpandableEditArea::RemoveLanguageEventListener(ILanguageEventListener& listener)
851 {
852         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
853         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
854
855         result r = pImpl->RemoveLanguageEventListener(listener);
856         SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
857 }
858
859 void
860 ExpandableEditArea::SetAutoShrinkModeEnabled(bool enable)
861 {
862         _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
863         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
864
865         pImpl->SetAutoShrinkModeEnabled(enable);
866 }
867
868 bool
869 ExpandableEditArea::IsAutoShrinkModeEnabled(void) const
870 {
871         const _ExpandableEditAreaImpl* pImpl = _ExpandableEditAreaImpl::GetInstance(*this);
872         SysAssertf(pImpl != null, "Not yet constructed. Construct() should be called before use.");
873
874         return pImpl->IsAutoShrinkModeEnabled();
875 }
876
877 }}} // Tizen::Ui::Controls