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 FUiCustomControlBase.cpp
19 * @brief This is the implementation for the CustomControlBase class.
22 #include <FUiCustomControlBase.h>
23 #include <FUiLayout.h>
24 #include <FBaseSysLog.h>
25 #include "FUi_CustomControlBaseImpl.h"
26 #include "FUi_ErrorMessages.h"
28 using namespace Tizen::Graphics;
30 namespace Tizen { namespace Ui {
32 CustomControlBase::CustomControlBase()
36 CustomControlBase::~CustomControlBase()
41 CustomControlBase::Construct(const Rectangle& rect, bool resizable, bool movable)
44 SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
46 _CustomControlBaseImpl* pImpl = _CustomControlBaseImpl::CreateCustomControlBaseImplN(this, rect, null, null, resizable, movable);
48 SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
50 _pControlImpl = pImpl;
56 CustomControlBase::Construct(const Layout& layout, const Rectangle& rect, bool resizable, bool movable)
58 return Construct(layout, layout, rect, resizable, movable);
62 CustomControlBase::Construct(const Layout& portraitLayout, const Layout& landscapeLayout,
63 const Rectangle& rect, bool resizable, bool movable)
66 SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
68 _CustomControlBaseImpl* pImpl =
69 _CustomControlBaseImpl::CreateCustomControlBaseImplN(this, rect, &portraitLayout, &landscapeLayout, resizable, movable);
72 SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
75 _pControlImpl = pImpl;
81 CustomControlBase::PrepareBoundsChange(const Rectangle& oldRect, const Rectangle& newRect)
87 CustomControlBase::EvaluateSize(int& width, int& height)