2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
17 #include <FBaseString.h>
18 #include <FGrpRectangle.h>
19 #include <FUiAccessibilityElement.h>
20 #include <FBaseSysLog.h>
21 #include "FUi_AccessibilityElementImpl.h"
23 using namespace Tizen::Base;
24 using namespace Tizen::Graphics;
26 namespace Tizen { namespace Ui {
27 AccessibilityElement::AccessibilityElement(void)
28 :__pAccessibilityElementImpl(null)
31 AccessibilityElement::~AccessibilityElement(void)
33 delete __pAccessibilityElementImpl;
34 __pAccessibilityElementImpl = null;
37 AccessibilityElement::Construct(const Rectangle& bounds, const String& name)
40 SysAssertf(__pAccessibilityElementImpl == null,
41 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
42 __pAccessibilityElementImpl = new (std::nothrow) _AccessibilityElementImpl(*this);
43 SysTryReturn(NID_UI, __pAccessibilityElementImpl, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed");
44 return __pAccessibilityElementImpl->Construct(name, bounds);
48 AccessibilityElement::SetBounds(const Rectangle& bounds)
50 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
52 return __pAccessibilityElementImpl->SetBounds(bounds);
55 AccessibilityElement::SetLabel(const String& label)
57 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
59 return __pAccessibilityElementImpl->SetLabel(label);
62 AccessibilityElement::SetHint(const String& hint)
64 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
66 return __pAccessibilityElementImpl->SetHint(hint);
69 AccessibilityElement::SetTrait(const String& trait)
71 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
72 return __pAccessibilityElementImpl->SetTrait(trait);
75 AccessibilityElement::SetValue(const Tizen::Base::String& value)
77 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
78 return __pAccessibilityElementImpl->SetValue(value);
81 AccessibilityElement::GetName(void) const
83 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
84 return __pAccessibilityElementImpl->GetName();
87 AccessibilityElement::GetBounds(void) const
89 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
90 return __pAccessibilityElementImpl->GetBounds();
93 AccessibilityElement::GetLabel(void) const
95 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
96 return __pAccessibilityElementImpl->GetLabel();
99 AccessibilityElement::GetHint(void) const
101 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
102 return __pAccessibilityElementImpl->GetHint();
105 AccessibilityElement::GetTrait(void) const
107 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
108 return __pAccessibilityElementImpl->GetTraitString();
111 AccessibilityElement::GetValue(void) const
113 SysAssertf(__pAccessibilityElementImpl != null, "Not yet constructed. Construct() should be called before use.");
114 return __pAccessibilityElementImpl->GetValue();