+ /**
+ * @brief Sets up the view properties appropriately.
+ * @param[in] type The Image type
+ * @param[in] index The index
+ * @return The set up property value
+ */
+ Property::Value SetupViewProperties( ImageType type, int index )
+ {
+ Property::Map map;
+
+ AddUrl( map, type, index );
+ AddCache( map, type, index );
+ return Property::Value(map);
+ }
+
+ /**
+ * @brief Adds the URL to the given map appropriately.
+ * @param[in/out] map The map to add the URL details to
+ * @param[in] type The Image type
+ * @param[in] index The index
+ */
+ void AddUrl( Property::Map& map, ImageType type, int index )
+ {
+ if( type == ImageType::ANIMATED_IMAGE )
+ {
+ map.Add( Toolkit::ImageVisual::Property::URL, Property::Value( ANIMATED_IMAGE_URLS[ index ] ) );
+ }
+ else
+ {
+ Property::Array frameUrls;
+ for( int i = 1; i <= ANIMATED_ARRAY_NUMBER_OF_FRAMES[ index ]; ++i )
+ {
+ char* buffer;
+ int len = asprintf( &buffer, ANIMATED_ARRAY_URL_FORMATS[ index ], i );
+ if( len > 0 )
+ {
+ std::string frameUrl( buffer );
+ free( buffer );
+ frameUrls.Add( Property::Value( frameUrl ) );
+ }
+ }
+ map.Add( Toolkit::ImageVisual::Property::URL, Property::Value( frameUrls ) );
+ }
+ }
+
+ /**
+ * @brief Adds the cache properties, if required to the map.
+ * @param[in/out] map The map to add the URL details to
+ * @param[in] type The Image type
+ * @param[in] index The index
+ */
+ void AddCache( Property::Map& map, ImageType type, int index )
+ {
+ if( type == ImageType::IMAGE_ARRAY )
+ {
+ map
+ .Add( Toolkit::ImageVisual::Property::BATCH_SIZE, 4 )
+ .Add( Toolkit::ImageVisual::Property::CACHE_SIZE, 10 )
+ .Add( Toolkit::ImageVisual::Property::FRAME_DELAY, 150 );
+ }
+ }
+