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 FUi_UiBuilderControlLayout.cpp
19 * @brief This is the implementation file for _UiBuilderControlLayout class.
23 #include <FBaseSysLog.h>
24 #include <FBaseInteger.h>
25 #include "FUi_UiBuilder.h"
26 #include "FUi_UiBuilderControlLayout.h"
28 using namespace Tizen::Base;
29 using namespace Tizen::Graphics;
30 using namespace Tizen::Ui;
32 namespace Tizen { namespace Ui
34 _UiBuilderControlLayout::_UiBuilderControlLayout(void)
35 : _styleInformation(L"")
39 _UiBuilderControlLayout::~_UiBuilderControlLayout(void)
44 _UiBuilderControlLayout::SetStyle(const Tizen::Base::String& style)
46 _styleInformation = style;
50 _UiBuilderControlLayout::SetRect(const Tizen::Base::String& x, const Tizen::Base::String& y, Tizen::Base::String& width, Tizen::Base::String& height)
52 int intX = 0, intY = 0, intWidth = 0, intHeight = 0;
54 if (x.IsEmpty() == false)
56 Base::Integer::Parse(x, intX);
58 if (y.IsEmpty() == false)
60 Base::Integer::Parse(y, intY);
62 if (width.IsEmpty() == false)
64 Base::Integer::Parse(width, intWidth);
66 if (height.IsEmpty() == false)
68 Base::Integer::Parse(height, intHeight);
73 _rect.width = intWidth;
74 _rect.height = intHeight;
78 _UiBuilderControlLayout::SetRect(const int x, const int y, const int width, const int height)
83 _rect.height = height;
87 _UiBuilderControlLayout::GetStyle(void) const
89 return _styleInformation;
93 _UiBuilderControlLayout::GetRect(void) const
95 return const_cast<Tizen::Graphics::Rectangle&>(_rect);
99 _UiBuilderControlLayout::SetLayoutElement(int index, const Tizen::Base::String& name, const Tizen::Base::String& value)
101 if (index >= UIBUILDER_CONTROL_ELEMENT_NUMBER)
106 _layoutElement[index].SetName(name);
107 _layoutElement[index].SetValue(value);
112 _UiBuilderControlLayout::GetLayoutElement(const Tizen::Base::String& layoutElementName, Tizen::Base::String& outValue) const
115 while (layoutElementName.IsEmpty() == false && index < UIBUILDER_CONTROL_ELEMENT_NUMBER)
117 if (layoutElementName.Equals(_layoutElement[index].GetName(), false))
119 if (_layoutElement[index].GetValue().IsEmpty() == false)
121 outValue = _layoutElement[index].GetValue();