X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Ftable-view%2Ftable-view.h;h=104a050bfde406bd17c6dd6046cf16a94e942ea9;hp=5f9bd5d49cd281870ce0faaed9e9b15f98e4fe10;hb=3b1fb566901d21b8303d9be3308e3920f5182e6d;hpb=e2eda444afbe82e9591fe198eef339227f90a616 diff --git a/dali-toolkit/public-api/controls/table-view/table-view.h b/dali-toolkit/public-api/controls/table-view/table-view.h index 5f9bd5d..104a050 100644 --- a/dali-toolkit/public-api/controls/table-view/table-view.h +++ b/dali-toolkit/public-api/controls/table-view/table-view.h @@ -1,27 +1,30 @@ #ifndef __DALI_TOOLKIT_TABLE_VIEW_H__ #define __DALI_TOOLKIT_TABLE_VIEW_H__ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// EXTERNAL INCLUDES +#include // INTERNAL INCLUDES -#include #include -namespace Dali DALI_IMPORT_API +namespace Dali { namespace Toolkit @@ -38,11 +41,70 @@ class TableView; * z position and depth are left intact so that 3D model actors can also be laid out * in a grid without loosing their depth scaling. */ -class TableView : public Control +class DALI_IMPORT_API TableView : public Control { public: /** + * @brief The start and end property ranges for this control. + */ + enum PropertyRange + { + PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices + }; + + /** + * @brief An enumeration of properties belonging to the TableView class. + * + * LayoutRows: set the height of the rows. + * It has the format as follows in script: + * @code + * "layout-rows": + { + "0": { "policy": "fixed", "value": 40 }, //@see SetFixedHight + "2": { "policy": "relative", "value": 0.33 } //@see SetRelativeHeight + } + * @endcode + * + * LayoutColumns: set the height of the rows. + * It has the format as follows in script: + * @code + * "layout-columns": + { + "0": { "policy": "fixed", "value": 40 }, //@see SetFixedWidth + "2": { "policy": "relative", "value": 0.33 } //@see SetRelativeWidth + } + * @endcode + */ + struct Property + { + enum + { + ROWS = PROPERTY_START_INDEX, ///< name "rows", type unsigned int + COLUMNS, ///< name "columns", type unsigned int + CELL_PADDING, ///< name "cell-padding", type Vector2 + LAYOUT_ROWS, ///< name "layout-rows", type Map + LAYOUT_COLUMNS, ///< name "layout-columns", type Map + }; + }; + + // Custom properties for where to put the actor, these properties should be registered to the child which would be added to the table + static const std::string CELL_INDICES_PROPERTY_NAME; ///< Property, name "cell-indices", type Vector2 + static const std::string ROW_SPAN_PROPERTY_NAME; ///< Property, name "row-span", type float (Currently builder is unable to differentiate integer and float from Json string) + static const std::string COLUMN_SPAN_PROPERTY_NAME; ///< Property, name "column-span", type float (Currently builder is unable to differentiate integer and float from Json string) + + /** + * @brief Describes how the size of a row / column been set + */ + enum LayoutPolicy + { + Fixed, ///< Fixed with the given value. + Relative, ///< Calculated as percentage of the remainder after subtracting Padding and Fixed height/width + Fill ///< Get the remainder of the 100% (after subtracting Padding, Fixed and Relative height/ width) divided evenly between 'fill' rows/columns + }; + + /** * Structure to specify layout position for child actor */ struct CellPosition @@ -80,10 +142,11 @@ public: TableView& operator=( const TableView& handle ); /** - * Virtual destructor. - * Dali::Object derived classes typically do not contain member data. + * @brief Destructor + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. */ - virtual ~TableView(); + ~TableView(); /** * Create the TableView control. @@ -278,19 +341,6 @@ public: float GetRelativeWidth( unsigned int columnIndex ) const; /** - * Sets the layout animation duration for add, remove and relayout - * @param duration for the layout animations - * @note The default duration is 0.0f. - */ - void SetLayoutAnimationDuration( float duration ); - - /** - * Gets the layout animation duration for add, remove and relayout - * @return duration for the layout animations - */ - float GetLayoutAnimationDuration(); - - /** * @return the amount of rows in the table */ unsigned int GetRows(); @@ -306,13 +356,13 @@ public: // Not intended for application developers * Creates a handle using the Toolkit::Internal implementation. * @param[in] implementation The Control implementation. */ - TableView(Internal::TableView& implementation); + DALI_INTERNAL TableView(Internal::TableView& implementation); /** * Allows the creation of this Control from an Internal::CustomActor pointer. * @param[in] internal A pointer to the internal CustomActor. */ - TableView( Dali::Internal::CustomActor* internal ); + explicit DALI_INTERNAL TableView( Dali::Internal::CustomActor* internal ); }; } // namespace Toolkit