-#ifndef __DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H__
-#define __DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H
+#define DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/weak-handle.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include "array-2d.h"
namespace Dali
private: // From Control
/**
- * @copydoc Control::OnControlChildAdd(Actor& child)
+ * @copydoc Control::OnChildAdd(Actor& child)
*/
- virtual void OnControlChildAdd( Actor& child );
+ virtual void OnChildAdd( Actor& child );
/**
- * @copydoc Control::OnControlChildRemove(Actor& child)
+ * @copydoc Control::OnChildRemove(Actor& child)
*/
- virtual void OnControlChildRemove( Actor& child );
+ virtual void OnChildRemove( Actor& child );
/**
* @copydoc Control::OnRelayout
*/
virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
+ /**
+ * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
+ */
+ virtual void OnSizeSet( const Vector3& size );
+
private: // Implementation
/**
* Struct to hold data for rows and columns
*
* If sizePolicy is FIXED then size is the absolute size to use.
- * If sizePolicy is FIT or FILL then size is the calculated value of size.
+ * If sizePolicy is FIT, RELATIVE or FILL then size is the calculated value of size.
*/
struct RowColumnData
{
RowColumnData()
: size( 0.0f ),
fillRatio( 0.0f ),
- position(0.0f),
+ position( 0.0f ),
sizePolicy( Toolkit::TableView::FILL )
{
}
RowColumnData( float newSize, float newFillRatio, Toolkit::TableView::LayoutPolicy newSizePolicy )
: size( newSize ),
fillRatio( newFillRatio ),
- position(0.0f),
+ position( 0.0f ),
sizePolicy( newSizePolicy )
{
}
bool RemoveAllInstances( const Actor& child );
/**
- * @brief Compute relative sizes for an array
+ * @brief Calculate the ratio of FILL rows/columns
*
* @param[in] data The RowColumn data to compute the relative sizes for
*/
- void ComputeRelativeSizes( RowColumnArray& data );
+ void CalculateFillSizes( RowColumnArray& data );
/**
* @brief Calculate the total fixed sizes for a row or column
float CalculateTotalFixedSize( const RowColumnArray& data );
/**
- * @brief Calculate the fixed sizes for a row or column
+ * @brief Calculate the sizes of FIT rows/columns
*
* @param[in] data The row or column data to process
* @param[in] dimension The dimension being calculated: row == Dimension::HEIGHT, column == Dimension::WIDTH
*/
- void CalculateFixedSizes( RowColumnArray& data, Dimension::Type dimension );
-
- /**
- * @brief Calculate the value of the relative sizes
- *
- * @param[in] data The row or column data to process
- * @param[in] size The size of the table view in that dimension
- */
- void CalculateRelativeSizes( RowColumnArray& data, float size );
+ void CalculateFitSizes( RowColumnArray& data, Dimension::Type dimension );
/**
* @brief Search for a FIT cell in the array
bool FindFit( const RowColumnArray& data );
/**
- * @brief Calculate row and column data when it is dirty
- */
- void CalculateRowColumnData();
-
- /**
* @brief Return the cell padding for a given dimension
*
* @param[in] dimension The dimension to return the padding for
Size mFixedTotals; ///< Accumulated totals for fixed width and height
Size mPadding; ///< Padding to apply to each cell
+
+ WeakHandle<Actor> mPreviousFocusedActor; ///< Perviously focused actor
bool mLayoutingChild; ///< Can't be a bitfield due to Relayouting lock
- bool mRowColumnDirty : 1; ///< Flag to indicate the row column data is dirty
+ bool mRowDirty : 1; ///< Flag to indicate the row data is dirty
+ bool mColumnDirty : 1; ///< Flag to indicate the column data is dirty
};
} // namespace Internal
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H__
+#endif // DALI_TOOLKIT_INTERNAL_TABLE_VIEW_H