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.
18 * @file FUiCtrlRadioGroup.cpp
19 * @brief This file contains implementation of RadioGroup class
22 #include <FUiCtrlRadioGroup.h>
23 #include <FBaseSysLog.h>
24 #include "FUiCtrl_RadioGroupImpl.h"
26 using namespace Tizen::Base;
27 using namespace Tizen::Graphics;
29 namespace Tizen { namespace Ui { namespace Controls
32 RadioGroup::RadioGroup(void)
37 RadioGroup::~RadioGroup(void)
43 RadioGroup::Construct(void)
46 _RadioGroupImpl* pRadioGroupImpl = _RadioGroupImpl::GetInstance(*this);
48 SysAssertf(pRadioGroupImpl == null,
49 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
51 pRadioGroupImpl = _RadioGroupImpl::CreateRadioGroupImplN(this);
53 SysTryReturn(NID_UI_CTRL, pRadioGroupImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
55 _pControlImpl = pRadioGroupImpl;
61 RadioGroup::Add(const CheckButton& checkButton)
63 _RadioGroupImpl* pRadioGroupImpl = _RadioGroupImpl::GetInstance(*this);
64 SysTryReturn(NID_UI_CTRL, pRadioGroupImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.");
66 result r = pRadioGroupImpl->Add(checkButton);
67 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
73 RadioGroup::Remove(const CheckButton& checkButton)
75 _RadioGroupImpl* pRadioGroupImpl = _RadioGroupImpl::GetInstance(*this);
76 SysTryReturn(NID_UI_CTRL, pRadioGroupImpl, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] This instance isn't constructed.\n");
78 result r = pRadioGroupImpl->Remove(checkButton);
79 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
85 RadioGroup::GetItemCount(void) const
87 const _RadioGroupImpl* pRadioGroupImpl = _RadioGroupImpl::GetInstance(*this);
88 SysAssertf(pRadioGroupImpl != null,
89 "Not yet constructed. Construct() should be called before use.");
91 return pRadioGroupImpl->GetItemCount();
95 RadioGroup::SetSelectedItem(const CheckButton& checkButton)
97 _RadioGroupImpl* pRadioGroupImpl = _RadioGroupImpl::GetInstance(*this);
98 SysAssertf(pRadioGroupImpl != null,
99 "Not yet constructed. Construct() should be called before use.");
101 pRadioGroupImpl->SetSelectedItem(checkButton);
107 RadioGroup::GetSelectedItem(void) const
109 const _RadioGroupImpl* pRadioGroupImpl = _RadioGroupImpl::GetInstance(*this);
110 SysAssertf(pRadioGroupImpl != null,
111 "Not yet constructed. Construct() should be called before use.");
113 return pRadioGroupImpl->GetSelectedItem();
117 RadioGroup::Draw(void)
119 return E_UNSUPPORTED_OPERATION;
123 RadioGroup::Show(void)
125 return E_UNSUPPORTED_OPERATION;
129 RadioGroup::SetFocus(void)
131 return E_UNSUPPORTED_OPERATION;
134 }}} // Tizen::Ui::Controls