X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fobject%2Fproperty-map.h;h=43029b1b9cb587caca22753be29acb26b659f90a;hb=a62dc57b01b08ebcfd0aed24afc8f156fbe7c619;hp=902947d37c0b80bd3f68c33caa575fb4074590cf;hpb=5197b928f899e8402d532066adff4df56cbd64b1;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/object/property-map.h b/dali/public-api/object/property-map.h index 902947d..43029b1 100644 --- a/dali/public-api/object/property-map.h +++ b/dali/public-api/object/property-map.h @@ -36,7 +36,7 @@ namespace Dali typedef std::pair StringValuePair; /** - * @brief A Map of property values. + * @brief A Map of property values, the key type could be String or Property::Index. * @SINCE_1_0.0 */ class DALI_IMPORT_API Property::Map @@ -82,7 +82,7 @@ public: bool Empty() const; /** - * @brief Inserts the key-value pair in the Map. + * @brief Inserts the key-value pair in the Map, with the key type as string. * * Does not check for duplicates * @SINCE_1_0.0 @@ -92,7 +92,7 @@ public: void Insert( const char* key, const Value& value ); /** - * @brief Inserts the key-value pair in the Map. + * @brief Inserts the key-value pair in the Map, with the key type as string. * * Does not check for duplicates * @SINCE_1_0.0 @@ -102,9 +102,22 @@ public: void Insert( const std::string& key, const Value& value ); /** - * @brief Retrieve the value at the specified position. + * @brief Inserts the key-value pair in the Map, with the key type as index. + * + * Does not check for duplicates + * @SINCE_1_1.39 + * @param key to insert + * @param value to insert + */ + void Insert( Property::Index key, const Value& value ); + + /** + * DEPRECATED_1_1.39. Retrieve the value with key instead of position, Use Find( key ) instead. + * + * @brief Retrieve the value of the string-value pair at the specified position. * * @SINCE_1_0.0 + * @param[in] position The specified position * @return A reference to the value at the specified position. * * @note Will assert if position >= Count() @@ -112,24 +125,30 @@ public: Value& GetValue( SizeType position ) const; /** + * DEPRECATED_1_1.39 Position based retrieval is no longer supported after extending the key type to both Index and String. + * * @brief Retrieve the key at the specified position. * * @SINCE_1_0.0 + * @param[in] position The specified position * @return A const reference to the key at the specified position. * * @note Will assert if position >= Count() */ - const std::string& GetKey( SizeType position ) const; + const std::string& GetKey( SizeType position ) const DALI_DEPRECATED_API; /** + * DEPRECATED_1_1.39 Position based retrieval is no longer supported after extending the key type to both Index and String. + * * @brief Retrieve the key & the value at the specified position. * * @SINCE_1_0.0 + * @param[in] position The specified position * @return A reference to the pair of key and value at the specified position. * - * @note Will assert if position >= Count() + * @note Will assert if position >= Count() or key at position is an index key. */ - StringValuePair& GetPair( SizeType position ) const; + StringValuePair& GetPair( SizeType position ) const DALI_DEPRECATED_API; /** * @brief Finds the value for the specified key if it exists. @@ -152,6 +171,29 @@ public: Value* Find( const std::string& key ) const; /** + * @brief Finds the value for the specified key if it exists. + * + * @SINCE_1_1.39 + * @param[in] key The key to find. + * + * @return A const pointer to the value if it exists, NULL otherwise + */ + Value* Find( Property::Index key ) const; + + /** + * @brief Finds the value for the specified keys if either exist. + * + * Will search for the index key first. + * + * @SINCE_1_1.45 + * @param[in] indexKey The index key to find. + * @param[in] stringKey The string key to find. + * + * @return A const pointer to the value if it exists, NULL otherwise + */ + Value* Find( Property::Index indexKey, const std::string& stringKey ) const; + + /** * @brief Finds the value for the specified key if it exists and its type is type * * @SINCE_1_0.0 @@ -163,6 +205,17 @@ public: Value* Find( const std::string& key, Property::Type type ) const; /** + * @brief Finds the value for the specified key if it exists and its type is type + * + * @SINCE_1_1.39 + * @param[in] key The key to find. + * @param[in] type The type to check. + * + * @return A const pointer to the value if it exists, NULL otherwise + */ + Value* Find( Property::Index key, Property::Type type ) const; + + /** * @brief Clears the map. * @SINCE_1_0.0 */ @@ -179,7 +232,7 @@ public: void Merge( const Map& from ); /** - * @brief Const operator to access element with the specified key. + * @brief Const operator to access element with the specified string key. * * @SINCE_1_0.0 * @param[in] key The key whose value to access. @@ -191,7 +244,7 @@ public: const Value& operator[]( const std::string& key ) const; /** - * @brief Operator to access the element with the specified key. + * @brief Operator to access the element with the specified string key. * * @SINCE_1_0.0 * @param[in] key The key whose value to access. @@ -203,6 +256,30 @@ public: Value& operator[]( const std::string& key ); /** + * @brief Const operator to access element with the specified index key. + * + * @SINCE_1_1.39 + * @param[in] key The key whose value to access. + * + * @return The value for the element with the specified key, if key doesn't exist, then Property::NONE is returned. + * + * @note Will assert if invalid-key is given. + */ + const Value& operator[]( Property::Index key ) const; + + /** + * @brief Operator to access the element with the specified index key. + * + * @SINCE_1_1.39 + * @param[in] key The key whose value to access. + * + * @return A reference to the value for the element with the specified key. + * + * @note If an element with the key does not exist, then it is created. + */ + Value& operator[]( Property::Index key ); + + /** * @brief Assignment Operator * * @SINCE_1_0.0