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 FUiCustomControlBase.cpp
20 * @brief This is the implementation for the CustomControlBase class.
23 #include <FUiCustomControlBase.h>
24 #include <FUiLayout.h>
25 #include <FBaseSysLog.h>
26 #include "FUi_CustomControlBaseImpl.h"
27 #include "FUi_ErrorMessages.h"
29 using namespace Tizen::Graphics;
31 namespace Tizen { namespace Ui {
33 CustomControlBase::CustomControlBase()
37 CustomControlBase::~CustomControlBase()
42 CustomControlBase::Construct(const Rectangle& rect, bool resizable, bool movable)
45 SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
47 _CustomControlBaseImpl* pImpl = _CustomControlBaseImpl::CreateCustomControlBaseImplN(this, rect, null, null, resizable, movable);
49 SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
51 _pControlImpl = pImpl;
57 CustomControlBase::Construct(const Layout& layout, const Rectangle& rect, bool resizable, bool movable)
59 return Construct(layout, layout, rect, resizable, movable);
63 CustomControlBase::Construct(const Layout& portraitLayout, const Layout& landscapeLayout,
64 const Rectangle& rect, bool resizable, bool movable)
67 SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
69 _CustomControlBaseImpl* pImpl =
70 _CustomControlBaseImpl::CreateCustomControlBaseImplN(this, rect, &portraitLayout, &landscapeLayout, resizable, movable);
73 SysTryReturn(NID_UI, pImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
76 _pControlImpl = pImpl;
82 CustomControlBase::PrepareBoundsChange(const Rectangle& oldRect, const Rectangle& newRect)
88 CustomControlBase::EvaluateSize(int& width, int& height)