* @since 2.1
*
* @return An error code
+ * @param[in] rect The location and size of the %GroupContainer control as an instance of Rectangle
+ * @param[in] rowCount The number of rows
+ * @param[in] columnCount The number of columns
+ * @param[in] lineWidth Width of the grid lines to draw
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG A specified input parameter is invalid. @n
+ * The width or height of @c rect or @c rowCount or @c columnnCount is negative or the value of @c lineWidth is @c 0 or negative.
+ * @exception E_OPERATION_FAILED The operation has failed.
+ * @remarks The available space for controls is less than the width or height of the container by the total width or height of the grid lines.
+ */
+ result Construct(const Tizen::Graphics::Rectangle& rect, int rowCount, int columnCount, int lineWidth = 1);
+
+ /**
+ * Initializes this instance of %GroupContainer with the specified parameters.
+ *
+ * @since 2.1
+ *
+ * @return An error code
* @param[in] rect The location and size of the %GroupContainer control as an instance of FloatRectangle
* @param[in] rowCount The number of rows
* @param[in] columnCount The number of columns
* @exception E_INVALID_ARG The specified @c width must be greater than or equal to @c 0.
*
*/
+ result SetColumnWidth(int columnIndex, int width);
+
+ /**
+ * Sets the width of a column.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] columnIndex The column index
+ * @param[in] width The new width of the column
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c columnIndex is greater than the number of elements or less than @c 0.
+ * @exception E_INVALID_ARG The specified @c width must be greater than or equal to @c 0.0f.
+ *
+ */
result SetColumnWidth(int columnIndex, float width);
/**
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The specified @c columnIndex is greater than the number of elements or less than @c 0.
*/
- float GetColumnWidth(int columnIndex) const;
+ int GetColumnWidth(int columnIndex) const;
+
+ /**
+ * Gets the width of a column.
+ *
+ * @since 2.1
+ *
+ * @return The width of the column
+ * @param[in] columnIndex The column index
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c columnIndex is greater than the number of elements or less than @c 0.
+ */
+ float GetColumnWidthF(int columnIndex) const;
+
+ /**
+ * Sets the height of a row.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] rowIndex The row index
+ * @param[in] height The new height of the row
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c rowIndex is greater than the number of elements or less than @c 0.
+ * @exception E_INVALID_ARG The specified @c height must be greater than or equal to @c 0.
+ *
+ */
+ result SetRowHeight(int rowIndex, int height);
/**
* Sets the height of a row.
* @exception E_OUT_OF_RANGE The specified @c rowIndex is greater than the number of elements or less than @c 0.
*
*/
- float GetRowHeight(int rowIndex) const;
+ int GetRowHeight(int rowIndex) const;
+
+ /**
+ * Gets the height of a row.
+ *
+ * @since 2.1
+ *
+ * @return The height of the row
+ * @param[in] rowIndex The row index
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c rowIndex is greater than the number of elements or less than @c 0.
+ *
+ */
+ float GetRowHeightF(int rowIndex) const;
+
/**
* Merges the cells for the given row and column index.
*
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0.
* @exception E_INVALID_ARG The specified @c leftMargin or @c topMargin or @c rightMargin or @c bottomMargin must be greater than or equal to @c 0.
- * @remarks The default margin value is 2 logical pixel.
+ * @remarks The default margin value is 2.0f logical pixel.
+ */
+ result SetMargin(int rowIndex, int columnIndex, int leftMargin, int rightMargin, int topMargin, int bottomMargin);
+
+ /**
+ * Sets the margin of a cell
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] rowIndex The row index of the cell
+ * @param[in] columnIndex The column index of the cell
+ * @param[in] leftMargin The left margin
+ * @param[in] rightMargin The right margin
+ * @param[in] topMargin The top margin
+ * @param[in] bottomMargin The bottom margin
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0.
+ * @exception E_INVALID_ARG The specified @c leftMargin or @c topMargin or @c rightMargin or @c bottomMargin must be greater than or equal to @c 0.0f.
+ * @remarks The default margin value is 2.0f logical pixel.
*/
result SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin);
+
/**
* Splits the merged cells
*
* @since 2.1
*
* @return An instance of the FloatRectangle that represents the position of top-left corner,
- * the width, and the height of the cell, @n else Rectangle(0.0f, 0.0f, -1.0f, -1.0f) if an error occurs
+ * the width, and the height of the cell, @n else Rectangle(0, 0, -1, -1) if an error occurs
+ * @param[in] rowIndex The row index of the cell
+ * @param[in] columnIndex The column index of the cell
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0.
+ */
+ Tizen::Graphics::Rectangle GetBoundsAt(int rowIndex, int columnIndex) const;
+
+ /**
+ * Gets the bounds of specified cell
+ *
+ * @since 2.1
+ *
+ * @return An instance of the FloatRectangle that represents the position of top-left corner,
+ * the width, and the height of the cell, @n else Rectangle(0.0f, 0.0f, -1.0f, -1.0f) if an error occurs
* @param[in] rowIndex The row index of the cell
* @param[in] columnIndex The column index of the cell
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The specified @c rowIndex or @c columnIndex is greater than the number of elements or less than @c 0.
*/
- Tizen::Graphics::FloatRectangle GetBoundsAt(int rowIndex, int columnIndex) const;
+ Tizen::Graphics::FloatRectangle GetBoundsAtF(int rowIndex, int columnIndex) const;
/**
* Enables/disables stretchable or shrinkable property of a column
}
result
-GroupContainer::Construct(const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth)
+GroupContainer::Construct(const Rectangle& rect, int rowCount, int columnCount, int lineWidth)
{
result r = E_SUCCESS;
_GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
}
result
+GroupContainer::Construct(const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth)
+{
+ result r = E_SUCCESS;
+ _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
+ SysAssertf(pGroupContainerImpl == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+ pGroupContainerImpl = _GroupContainerImpl::CreateGroupContainerImplFN(this, rect, rowCount, columnCount, lineWidth);
+
+ r = GetLastResult();
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pGroupContainerImpl->Initialize();
+ r = GetLastResult();
+ _pControlImpl = pGroupContainerImpl;
+
+ return r;
+}
+
+result
GroupContainer::AddControlAt(Control& control, int rowIndex, int columnIndex)
{
_GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
}
result
+GroupContainer::SetColumnWidth(int columnIndex, int width)
+{
+ _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
+ SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return pGroupContainerImpl->SetColumnWidth(columnIndex, width);
+}
+
+result
GroupContainer::SetColumnWidth(int columnIndex, float width)
{
_GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
return pGroupContainerImpl->SetColumnWidth(columnIndex, width);
}
-float
+int
GroupContainer::GetColumnWidth(int columnIndex) const
{
_GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this));
return pGroupContainerImpl->GetColumnWidth(columnIndex);
}
+float
+GroupContainer::GetColumnWidthF(int columnIndex) const
+{
+ _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this));
+ SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return pGroupContainerImpl->GetColumnWidthF(columnIndex);
+}
+
+result
+GroupContainer::SetRowHeight(int rowIndex, int height)
+{
+ _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
+ SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return pGroupContainerImpl->SetRowHeight(rowIndex, height);
+}
+
result
GroupContainer::SetRowHeight(int rowIndex, float height)
{
return pGroupContainerImpl->SetRowHeight(rowIndex, height);
}
-float
+int
GroupContainer::GetRowHeight(int rowIndex) const
{
_GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this));
return pGroupContainerImpl->GetRowHeight(rowIndex);
}
+float
+GroupContainer::GetRowHeightF(int rowIndex) const
+{
+ _GroupContainerImpl* pGroupContainerImpl = const_cast<_GroupContainerImpl*>(_GroupContainerImpl::GetInstance(*this));
+ SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return pGroupContainerImpl->GetRowHeightF(rowIndex);
+}
+
result
GroupContainer::Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount)
{
}
result
+GroupContainer::SetMargin(int rowIndex, int columnIndex, int leftMargin, int topMargin, int rightMargin, int bottomMargin)
+{
+ _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
+ SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return pGroupContainerImpl->SetMargin(rowIndex, columnIndex, leftMargin, topMargin, rightMargin, bottomMargin);
+}
+
+result
GroupContainer::SetMargin(int rowIndex, int columnIndex, float leftMargin, float topMargin, float rightMargin, float bottomMargin)
{
_GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
return pGroupContainerImpl->Split(rowIndex, columnIndex);
}
-FloatRectangle
+Rectangle
GroupContainer::GetBoundsAt(int rowIndex, int columnIndex) const
{
const _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
return pGroupContainerImpl->GetBoundsAt(rowIndex, columnIndex);
}
+FloatRectangle
+GroupContainer::GetBoundsAtF(int rowIndex, int columnIndex) const
+{
+ const _GroupContainerImpl* pGroupContainerImpl = _GroupContainerImpl::GetInstance(*this);
+ SysAssertf(pGroupContainerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return pGroupContainerImpl->GetBoundsAtF(rowIndex, columnIndex);
+}
+
result
GroupContainer::SetColumnStretchable(int columnIndex, bool stretchable)
{
}
_GroupContainerImpl*
-_GroupContainerImpl::CreateGroupContainerImplN(GroupContainer* pControl, const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth)
+_GroupContainerImpl::CreateGroupContainerImplN(GroupContainer* pControl, const Rectangle& rect, int rowCount, int columnCount, int lineWidth)
+{
+ ClearLastResult();
+
+ _GroupContainerImpl* pImpl = null;
+ _GroupContainer* pCore = null;
+
+ FloatRectangle floatBounds = _CoordinateSystemUtils::ConvertToFloat(rect);
+ float floatLineWidth = _CoordinateSystemUtils::ConvertToFloat(lineWidth);
+
+ pCore = _GroupContainer::CreateGroupContainerN(floatBounds, rowCount, columnCount, floatLineWidth);
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pImpl = new (std::nothrow) _GroupContainerImpl(pControl, pCore);
+ r = CheckConstruction(pCore, pImpl);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return pImpl;
+}
+
+_GroupContainerImpl*
+_GroupContainerImpl::CreateGroupContainerImplFN(GroupContainer* pControl, const FloatRectangle& rect, int rowCount, int columnCount, float lineWidth)
{
ClearLastResult();
}
result
+_GroupContainerImpl::SetColumnWidth(int columnIndex, int width)
+{
+ float floatWidth = _CoordinateSystemUtils::ConvertToFloat(width);
+ return GetCore().SetColumnWidth(columnIndex, floatWidth);
+}
+
+result
_GroupContainerImpl::SetColumnWidth(int columnIndex, float width)
{
return GetCore().SetColumnWidth(columnIndex, width);
}
-float
+int
_GroupContainerImpl::GetColumnWidth(int columnIndex)
{
+ int width = _CoordinateSystemUtils::ConvertToInteger(GetCore().GetColumnWidth(columnIndex));
+ return width;
+}
+
+float
+_GroupContainerImpl::GetColumnWidthF(int columnIndex)
+{
return GetCore().GetColumnWidth(columnIndex);
}
result
+_GroupContainerImpl::SetRowHeight(int rowIndex, int height)
+{
+ float floatHeight = _CoordinateSystemUtils::ConvertToFloat(height);
+ return GetCore().SetRowHeight(rowIndex, floatHeight);
+}
+
+result
_GroupContainerImpl::SetRowHeight(int rowIndex, float height)
{
return GetCore().SetRowHeight(rowIndex, height);
}
-float
+int
_GroupContainerImpl::GetRowHeight(int rowIndex)
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetCore().GetRowHeight(rowIndex));
+}
+
+float
+_GroupContainerImpl::GetRowHeightF(int rowIndex)
+{
return GetCore().GetRowHeight(rowIndex);
}
}
result
+_GroupContainerImpl::SetMargin(int rowIndex, int columnIndex, int leftMargin, int rightMargin, int topMargin, int bottomMargin)
+{
+ float floatLeftMargin = _CoordinateSystemUtils::ConvertToFloat(leftMargin);
+ float floatRightMargin = _CoordinateSystemUtils::ConvertToFloat(rightMargin);
+ float floatTopMargin = _CoordinateSystemUtils::ConvertToFloat(topMargin);
+ float floatBottomMargin = _CoordinateSystemUtils::ConvertToFloat(bottomMargin);
+
+ return GetCore().SetMargin(rowIndex, columnIndex, floatLeftMargin, floatRightMargin, floatTopMargin, floatBottomMargin);
+}
+
+result
_GroupContainerImpl::SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin)
{
return GetCore().SetMargin(rowIndex, columnIndex, leftMargin, rightMargin, topMargin, bottomMargin);
return GetCore().Split(rowIndex, columnIndex);
}
-FloatRectangle
+Rectangle
_GroupContainerImpl::GetBoundsAt(int rowIndex, int columnIndex) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetCore().GetBoundsAt(rowIndex, columnIndex));
+}
+
+FloatRectangle
+_GroupContainerImpl::GetBoundsAtF(int rowIndex, int columnIndex) const
+{
return GetCore().GetBoundsAt(rowIndex, columnIndex);
}
public:
virtual ~_GroupContainerImpl(void);
- static _GroupContainerImpl* CreateGroupContainerImplN(GroupContainer* pControl, const Tizen::Graphics::FloatRectangle& rect, int rowCount, int columnCount, float lineWidth);
+ static _GroupContainerImpl* CreateGroupContainerImplN(GroupContainer* pControl, const Tizen::Graphics::Rectangle& rect, int rowCount, int columnCount, int lineWidth);
+ static _GroupContainerImpl* CreateGroupContainerImplFN(GroupContainer* pControl, const Tizen::Graphics::FloatRectangle& rect, int rowCount, int columnCount, float lineWidth);
void Initialize(void);
//Accessor
result AddControlAt(Control& control, int rowIndex, int columnIndex);
Tizen::Ui::Control* GetControlAt(int rowIndex, int columnIndex);
result RemoveControlAt(int rowIndex, int columnIndex);
+ result SetColumnWidth(int columnIndex, int width);
result SetColumnWidth(int columnIndex, float width);
- float GetColumnWidth(int columnIndex);
+ int GetColumnWidth(int columnIndex);
+ float GetColumnWidthF(int columnIndex);
+ result SetRowHeight(int rowIndex, int rowHeight);
result SetRowHeight(int rowIndex, float rowHeight);
- float GetRowHeight(int rowIndex);
+ int GetRowHeight(int rowIndex);
+ float GetRowHeightF(int rowIndex);
result Merge(int rowStartIndex, int columnStartIndex, int rowCount, int columnCount);
result SetChildResizingEnabled(int rowIndex, int columnIndex, bool enable);
+ result SetMargin(int rowIndex, int columnIndex, int leftMargin, int rightMargin, int topMargin, int bottomMargin);
result SetMargin(int rowIndex, int columnIndex, float leftMargin, float rightMargin, float topMargin, float bottomMargin);
result Split(int rowIndex, int columnIndex);
- Tizen::Graphics::FloatRectangle GetBoundsAt(int rowIndex, int columnIndex) const;
+ Tizen::Graphics::Rectangle GetBoundsAt(int rowIndex, int columnIndex) const;
+ Tizen::Graphics::FloatRectangle GetBoundsAtF(int rowIndex, int columnIndex) const;
result SetColumnStretchable(int columnIndex, bool stretchable);
bool IsColumnStretchable(int columnIndex);
result SetRowStretchable(int rowIndex, bool stretchable);