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 FUiCtrl_RadioGroupPresenter.cpp
19 * @brief This is the implementation file for the _RadioGroupPresenter class.
22 #include <FBaseErrorDefine.h>
23 #include <FBaseSysLog.h>
24 #include "FUiAnim_VisualElement.h"
25 #include "FUiCtrl_RadioGroupPresenter.h"
26 #include "FUiCtrl_RadioGroupModel.h"
27 #include "FUiCtrl_RadioGroup.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Graphics;
32 namespace Tizen { namespace Ui { namespace Controls
35 _RadioGroupPresenter::_RadioGroupPresenter(void)
37 , __pRadioGroupModel(null)
43 _RadioGroupPresenter::~_RadioGroupPresenter(void)
45 if (__pRadioGroupModel)
47 delete __pRadioGroupModel;
48 __pRadioGroupModel = null;
53 _RadioGroupPresenter::Construct(const _RadioGroup& radioGroup)
57 __pRadioGroup = const_cast <_RadioGroup*>(&radioGroup);
59 __pRoot = __pRadioGroup->GetVisualElement();
63 __pRoot->SetSurfaceOpaque(false);
70 _RadioGroupPresenter::Install(void)
74 _RadioGroupModel* pModel = new (std::nothrow) _RadioGroupModel();
75 SysTryReturn(NID_UI_CTRL, pModel, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
77 r = SetModel(*pModel);
78 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
80 r = pModel->Construct();
81 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
91 _RadioGroupPresenter::SetModel(const _RadioGroupModel& radioGroupModel)
93 __pRadioGroupModel = const_cast <_RadioGroupModel*>(&radioGroupModel);
98 }}} // Tizen::Ui::Controls