2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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.
19 * @file FUiCtrlEditField.cpp
20 * @brief This file contains implementation of EditField class
23 #include <FUiCtrlEditField.h>
24 #include <FBaseSysLog.h>
25 #include "FUiCtrl_EditFieldImpl.h"
27 using namespace Tizen::Base;
28 using namespace Tizen::Base::Utility;
29 using namespace Tizen::Graphics;
30 using namespace Tizen::Locales;
31 using namespace Tizen::Security;
32 using namespace Tizen::Ui;
34 namespace Tizen { namespace Ui { namespace Controls
37 EditField::EditField(void)
41 EditField::~EditField(void)
46 EditField::Construct(const Rectangle& rect, EditFieldStyle style, InputStyle inputStyle, bool showTitle,
48 GroupStyle groupStyle)
52 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
53 SysAssertf(pEditFieldImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
55 EditFieldTitleStyle titleStyle = EDIT_FIELD_TITLE_STYLE_NONE;
56 bool enableClear = false;
58 if (showTitle == true)
60 titleStyle = EDIT_FIELD_TITLE_STYLE_TOP;
63 pEditFieldImpl = _EditFieldImpl::CreateEditFieldImplN(this, rect, style, titleStyle);
64 if (pEditFieldImpl == null)
70 _pControlImpl = pEditFieldImpl;
72 r = pEditFieldImpl->Initialize(style, inputStyle, titleStyle, enableClear, limitLength, groupStyle);
78 SetBounds(rect.x, rect.y, rect.width, rect.height);
83 delete pEditFieldImpl;
90 EditField::Construct(const FloatRectangle& rect, EditFieldStyle style, InputStyle inputStyle, bool showTitle,
92 GroupStyle groupStyle)
96 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
97 SysAssertf(pEditFieldImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
99 EditFieldTitleStyle titleStyle = EDIT_FIELD_TITLE_STYLE_NONE;
100 bool enableClear = false;
102 if (showTitle == true)
104 titleStyle = EDIT_FIELD_TITLE_STYLE_TOP;
107 pEditFieldImpl = _EditFieldImpl::CreateEditFieldImplN(this, rect, style, titleStyle);
108 if (pEditFieldImpl == null)
114 _pControlImpl = pEditFieldImpl;
116 r = pEditFieldImpl->Initialize(style, inputStyle, titleStyle, enableClear, limitLength, groupStyle);
122 SetBounds(rect.x, rect.y, rect.width, rect.height);
127 delete pEditFieldImpl;
128 _pControlImpl = null;
134 EditField::Construct(const Rectangle& rect, EditFieldStyle style, InputStyle inputStyle,
135 EditFieldTitleStyle titleStyle, bool enableClear, int limitLength,
136 GroupStyle groupStyle)
138 result r = E_SUCCESS;
140 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
141 SysAssertf(pEditFieldImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
143 pEditFieldImpl = _EditFieldImpl::CreateEditFieldImplN(this, rect, style, titleStyle);
144 if (pEditFieldImpl == null)
150 _pControlImpl = pEditFieldImpl;
152 r = pEditFieldImpl->Initialize(style, inputStyle, titleStyle, enableClear, limitLength, groupStyle);
158 r = SetBounds(rect.x, rect.y, rect.width, rect.height);
167 delete pEditFieldImpl;
168 _pControlImpl = null;
174 EditField::Construct(const FloatRectangle& rect, EditFieldStyle style, InputStyle inputStyle,
175 EditFieldTitleStyle titleStyle, bool enableClear, int limitLength,
176 GroupStyle groupStyle)
178 result r = E_SUCCESS;
180 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
181 SysAssertf(pEditFieldImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
183 pEditFieldImpl = _EditFieldImpl::CreateEditFieldImplN(this, rect, style, titleStyle);
184 if (pEditFieldImpl == null)
190 _pControlImpl = pEditFieldImpl;
192 r = pEditFieldImpl->Initialize(style, inputStyle, titleStyle, enableClear, limitLength, groupStyle);
198 r = SetBounds(rect.x, rect.y, rect.width, rect.height);
207 delete pEditFieldImpl;
208 _pControlImpl = null;
214 EditField::GetTextAlignment(void) const
216 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
217 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
219 return pEditFieldImpl->GetTextAlignment();
223 EditField::SetTextAlignment(HorizontalAlignment alignment)
225 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
226 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
228 return pEditFieldImpl->SetTextAlignment(alignment);
232 EditField::IsViewModeEnabled(void) const
234 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
235 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
237 return pEditFieldImpl->IsViewModeEnabled();
241 EditField::SetViewModeEnabled(bool enable)
243 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
244 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
246 return pEditFieldImpl->SetViewModeEnabled(enable);
250 EditField::SetAutoLinkMask(unsigned long autoLinks)
252 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
253 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
255 return pEditFieldImpl->SetAutoLinkMask(autoLinks);
259 EditField::GetAutoLinkMask(void) const
261 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
262 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
264 return pEditFieldImpl->GetAutoLinkMask();
268 EditField::GetMargin(EditMarginType marginType) const
270 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
271 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
273 return pEditFieldImpl->GetMargin(marginType);
277 EditField::GetMarginF(EditMarginType marginType) const
279 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
280 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
282 return pEditFieldImpl->GetMarginF(marginType);
286 EditField::SetMargin(EditMarginType marginType, int margin)
288 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
289 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
291 return pEditFieldImpl->SetMargin(marginType, margin);
295 EditField::SetMargin(EditMarginType marginType, float margin)
297 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
298 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
300 return pEditFieldImpl->SetMargin(marginType, margin);
304 EditField::SetKeypadActionEnabled(bool enable)
306 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
307 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
309 return pEditFieldImpl->SetKeypadActionEnabled(enable);
313 EditField::IsKeypadActionEnabled(void) const
315 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
316 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
318 return pEditFieldImpl->IsKeypadActionEnabled();
322 EditField::GetKeypadAction(void) const
324 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
325 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
327 return pEditFieldImpl->GetKeypadAction();
331 EditField::SetKeypadAction(KeypadAction keypadAction)
333 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
334 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
336 return pEditFieldImpl->SetKeypadAction(keypadAction);
340 EditField::SetOverlayKeypadCommandButtonVisible(bool visible)
342 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
343 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
345 return pEditFieldImpl->SetOverlayKeypadCommandButtonVisible(visible);
349 EditField::IsOverlayCommandButtonVisible(void) const
351 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
352 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
354 return pEditFieldImpl->IsOverlayCommandButtonVisible();
358 EditField::HideKeypad(void)
360 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
361 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
363 return pEditFieldImpl->HideKeypad();
367 EditField::GetEllipsisPosition(void) const
369 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
370 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
372 return pEditFieldImpl->GetEllipsisPosition();
376 EditField::SetEllipsisPosition(EllipsisPosition position)
378 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
379 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
381 return pEditFieldImpl->SetEllipsisPosition(position);
385 EditField::GetTextSize(void) const
387 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
388 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
390 return pEditFieldImpl->GetTextSize();
394 EditField::GetTextSizeF(void) const
396 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
397 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
399 return pEditFieldImpl->GetTextSizeF();
403 EditField::SetTextSize(int size)
405 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
406 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
408 return pEditFieldImpl->SetTextSize(size);
412 EditField::SetTextSize(float size)
414 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
415 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
417 return pEditFieldImpl->SetTextSize(size);
421 EditField::GetColor(EditStatus status) const
423 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
424 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
426 return pEditFieldImpl->GetColor(status);
430 EditField::GetTextColor(EditTextColor type) const
432 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
433 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
435 return pEditFieldImpl->GetTextColor(type);
439 EditField::SetBackgroundBitmap(EditStatus status, const Bitmap& bitmap)
441 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
442 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
444 return pEditFieldImpl->SetBackgroundBitmap(status, bitmap);
448 EditField::SetColor(EditStatus status, const Color& color)
450 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
451 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
453 return pEditFieldImpl->SetColor(status, color);
457 EditField::SetTextColor(EditTextColor type, const Color& color)
459 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
460 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
462 return pEditFieldImpl->SetTextColor(type, color);
466 EditField::GetText(int start, int end) const
468 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
469 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
471 return pEditFieldImpl->GetText(start, end);
475 EditField::AddUiLinkEventListener(IUiLinkEventListener& listener)
477 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
478 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
480 result r = pEditFieldImpl->AddUiLinkEventListener(listener);
481 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
485 EditField::RemoveUiLinkEventListener(IUiLinkEventListener& listener)
487 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
488 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
490 result r = pEditFieldImpl->RemoveUiLinkEventListener(listener);
491 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
495 EditField::AddKeypadEventListener(IKeypadEventListener& listener)
497 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
498 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
500 result r = pEditFieldImpl->AddKeypadEventListener(listener);
501 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
505 EditField::RemoveKeypadEventListener(IKeypadEventListener& listener)
507 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
508 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
510 result r = pEditFieldImpl->RemoveKeypadEventListener(listener);
511 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
515 EditField::AddTextBlockEventListener(ITextBlockEventListener& listener)
517 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
518 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
520 result r = pEditFieldImpl->AddTextBlockEventListener(listener);
521 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
525 EditField::RemoveTextBlockEventListener(ITextBlockEventListener& listener)
527 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
528 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
530 result r = pEditFieldImpl->RemoveTextBlockEventListener(listener);
531 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
535 EditField::AddTextEventListener(ITextEventListener& listener)
537 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
538 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
540 pEditFieldImpl->AddTextEventListener(listener);
544 EditField::RemoveTextEventListener(ITextEventListener& listener)
546 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
547 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
549 pEditFieldImpl->RemoveTextEventListener(listener);
553 EditField::AddScrollPanelEventListener(IScrollPanelEventListener& listener)
555 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
556 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
558 result r = pEditFieldImpl->AddScrollPanelEventListener(listener);
559 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
563 EditField::RemoveScrollPanelEventListener(IScrollPanelEventListener& listener)
565 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
566 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
568 result r = pEditFieldImpl->RemoveScrollPanelEventListener(listener);
569 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
573 EditField::AddActionEventListener(IActionEventListener& listener)
575 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
576 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
578 result r = pEditFieldImpl->AddActionEventListener(listener);
579 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
583 EditField::RemoveActionEventListener(IActionEventListener& listener)
585 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
586 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
588 result r = pEditFieldImpl->RemoveActionEventListener(listener);
589 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
593 EditField::AddLanguageEventListener(ILanguageEventListener& listener)
595 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
597 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
599 pEditFieldImpl->AddLanguageEventListener(listener);
603 EditField::RemoveLanguageEventListener(ILanguageEventListener& listener)
605 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
606 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
608 pEditFieldImpl->RemoveLanguageEventListener(listener);
612 EditField::GetRemainingLength(void) const
614 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
615 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
617 return pEditFieldImpl->GetRemainingLength();
621 EditField::SetLowerCaseModeEnabled(bool enable)
623 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
624 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
626 pEditFieldImpl->SetLowerCaseModeEnabled(enable);
630 EditField::IsLowerCaseModeEnabled(void) const
632 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
633 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
635 return pEditFieldImpl->IsLowerCaseModeEnabled();
639 EditField::SetInputModeCategory(unsigned long categories, bool enable)
641 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
642 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
644 return pEditFieldImpl->SetInputModeCategory(categories, enable);
648 EditField::SetCurrentInputModeCategory(EditInputModeCategory inputModeCategory)
650 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
651 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
653 return pEditFieldImpl->SetCurrentInputModeCategory(inputModeCategory);
657 EditField::GetInputModeCategory(void) const
659 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
660 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
662 return pEditFieldImpl->GetInputModeCategory();
665 EditInputModeCategory
666 EditField::GetCurrentInputModeCategory(void) const
668 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
669 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
671 return pEditFieldImpl->GetCurrentInputModeCategory();
675 EditField::SetCursorPosition(int position)
677 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
678 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
680 return pEditFieldImpl->SetCursorPosition(position);
684 EditField::GetCursorPosition(void) const
686 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
687 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
689 return pEditFieldImpl->GetCursorPosition();
693 EditField::GetText(void) const
695 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
696 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
698 return pEditFieldImpl->GetText();
702 EditField::GetTextLength(void) const
704 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
705 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
707 return pEditFieldImpl->GetTextLength();
711 EditField::SetText(const String& text)
713 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
714 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
716 return pEditFieldImpl->SetText(text);
720 EditField::InsertTextAtCursorPosition(const String& text)
722 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
723 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
725 return pEditFieldImpl->InsertTextAtCursorPosition(text);
729 EditField::AppendText(const String& text)
731 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
732 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
734 return pEditFieldImpl->AppendText(text);
738 EditField::AppendCharacter(const Character& character)
740 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
741 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
743 return pEditFieldImpl->AppendCharacter(character);
747 EditField::Clear(void)
749 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
750 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
752 return pEditFieldImpl->Clear();
756 EditField::DeleteCharacterAtCursorPosition(void)
758 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
759 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
761 return pEditFieldImpl->DeleteCharacterAtCursorPosition();
765 EditField::GetCurrentTextRange(int& start, int& end) const
767 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
768 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
770 return pEditFieldImpl->GetCurrentTextRange(start, end);
774 EditField::SetGuideText(const String& guideText)
776 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
777 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
779 return pEditFieldImpl->SetGuideText(guideText);
783 EditField::GetGuideText(void) const
785 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
786 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
788 return pEditFieldImpl->GetGuideText();
792 EditField::GetGuideTextColor(void) const
794 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
795 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
797 return pEditFieldImpl->GetGuideTextColor();
801 EditField::SetGuideTextColor(const Color& color)
803 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
804 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
806 return pEditFieldImpl->SetGuideTextColor(color);
810 EditField::SetKeypadEnabled(bool enable)
812 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
813 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
815 pEditFieldImpl->SetKeypadEnabled(enable);
821 EditField::IsKeypadEnabled(void) const
823 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
824 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
826 return pEditFieldImpl->IsKeypadEnabled();
830 EditField::IsTextPredictionEnabled(void) const
832 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
833 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
835 return pEditFieldImpl->IsTextPredictionEnabled();
839 EditField::SetTextPredictionEnabled(bool enable)
841 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
842 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
844 return pEditFieldImpl->SetTextPredictionEnabled(enable);
848 EditField::ShowKeypad(void)
850 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
851 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
853 return pEditFieldImpl->ShowKeypad();
857 EditField::GetBlockRange(int& start, int& end) const
859 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
860 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
862 pEditFieldImpl->GetBlockRange(start, end);
866 EditField::BeginBlock(void)
868 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
869 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
871 return pEditFieldImpl->BeginBlock();
875 EditField::ReleaseBlock(void)
877 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
878 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
880 return pEditFieldImpl->ReleaseBlock();
884 EditField::IsBlocked(void) const
886 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
887 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
889 return pEditFieldImpl->IsBlocked();
893 EditField::Copy(void)
895 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
896 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
898 return pEditFieldImpl->Copy();
904 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
905 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
907 return pEditFieldImpl->Cut();
911 EditField::Paste(void)
913 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
914 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
916 return pEditFieldImpl->Paste();
920 EditField::Remove(void)
922 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
923 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
925 return pEditFieldImpl->Remove();
929 EditField::IsClipped(void) const
931 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
932 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
934 return pEditFieldImpl->IsClipped();
938 EditField::SetTitleText(const String& title)
940 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
941 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
943 return pEditFieldImpl->SetTitleText(title);
947 EditField::GetTitleText(void) const
949 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
950 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
952 return pEditFieldImpl->GetTitleText();
956 EditField::SetTitleTextColor(EditStatus status, const Color& color)
958 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
959 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
961 return pEditFieldImpl->SetTitleTextColor(status, color);
965 EditField::GetTitleTextColor(EditStatus status) const
967 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
968 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
970 return pEditFieldImpl->GetTitleTextColor(status);
974 EditField::SetOverlayKeypadCommandButton(CommandButtonPosition position, const String& text, int actionId)
976 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
977 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
979 return pEditFieldImpl->SetOverlayKeypadCommandButton(position, text, actionId);
983 EditField::GetOverlayKeypadCommandButtonText(CommandButtonPosition position) const
985 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
986 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
988 return pEditFieldImpl->GetOverlayKeypadCommandButtonText(position);
992 EditField::GetOverlayKeypadCommandButtonActionId(CommandButtonPosition position) const
994 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
995 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
997 return pEditFieldImpl->GetOverlayKeypadCommandButtonActionId(position);
1001 EditField::SetCurrentLanguage(LanguageCode languageCode)
1003 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
1004 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
1006 return pEditFieldImpl->SetCurrentLanguage(languageCode);
1010 EditField::GetCurrentLanguage(LanguageCode& language) const
1012 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
1013 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
1015 return pEditFieldImpl->GetCurrentLanguage(language);
1019 EditField::SetEditTextFilter(IEditTextFilter* pFilter)
1021 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
1022 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
1024 pEditFieldImpl->SetEditTextFilter(pFilter);
1030 EditField::SendOpaqueCommand (const String& command)
1032 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
1033 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
1035 pEditFieldImpl->SendOpaqueCommand(command);
1041 EditField::SetPasswordVisible(bool visible)
1043 _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
1044 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
1046 return pEditFieldImpl->SetPasswordVisible(visible);
1050 EditField::IsPasswordVisible(void) const
1052 const _EditFieldImpl* pEditFieldImpl = _EditFieldImpl::GetInstance(*this);
1053 SysAssertf(pEditFieldImpl != null, "Not yet constructed. Construct() should be called before use.");
1055 return pEditFieldImpl->IsPasswordVisible();
1058 }}} // Tizen::Ui::Controls