// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
+#include <dali-toolkit/devel-api/controls/scrollable/item-view/default-item-layout-property.h>
namespace Dali
{
{
Vector3 mItemSize; ///< The size of an item in the layout
ControlOrientation::Type mOrientation; ///< the orientation of the layout.
+ Property::Map mProperties;
+ bool mHasLayoutChanged;
};
ItemLayout::ItemLayout()
return currentLayoutPosition;
}
-int ItemLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+int ItemLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled)
{
switch( direction )
{
- case Control::Left:
- case Control::Up:
+ case Control::KeyboardFocus::LEFT:
+ case Control::KeyboardFocus::UP:
{
itemID--;
if( itemID < 0 )
}
break;
}
- case Control::Right:
- case Control::Down:
+ case Control::KeyboardFocus::RIGHT:
+ case Control::KeyboardFocus::DOWN:
{
itemID++;
if( itemID >= maxItems )
}
break;
}
+ default:
+ {
+ break;
+ }
}
return itemID;
}
return GetScrollSpeedFactor();
}
+void ItemLayout::SetLayoutProperties(const Property::Map& properties)
+{
+ for( unsigned int idx = 0, mapCount = properties.Count(); idx < mapCount; ++idx )
+ {
+ KeyValuePair propertyPair( properties.GetKeyValue( idx ) );
+
+ if(propertyPair.first == DefaultItemLayoutProperty::ITEM_SIZE)
+ {
+ SetItemSize(propertyPair.second.Get<Vector3>());
+ }
+ else if(propertyPair.first == DefaultItemLayoutProperty::ORIENTATION)
+ {
+ //Up, Left, Down, Right
+ int orientationType = propertyPair.second.Get<int>();
+ if(orientationType <= ControlOrientation::Right && orientationType >= ControlOrientation::Up)
+ {
+ SetOrientation(ControlOrientation::Type(orientationType));
+ }
+ }
+ }
+ mImpl->mHasLayoutChanged = true;
+ mImpl->mProperties = properties;
+}
+
+Property::Map ItemLayout::GetLayoutProperties()
+{
+ return mImpl->mProperties;
+}
+
+bool ItemLayout::HasLayoutChanged()
+{
+ return mImpl->mHasLayoutChanged;
+}
+
+void ItemLayout::ResetLayoutChangedFlag()
+{
+ mImpl->mHasLayoutChanged = false;
+}
+
} // namespace Toolkit
} // namespace Dali