[4.0] Fix typo error in some descriptions
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-key.h
1 #ifndef __DALI_PROPERTY_KEY_H__
2 #define __DALI_PROPERTY_KEY_H__
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23 #include <sstream>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/common/dali-common.h>
27 #include <dali/public-api/object/property.h>
28
29 namespace Dali
30 {
31 /**
32  * @addtogroup dali_core_object
33  * @{
34  */
35
36 /**
37  * @brief A key type which can be either a std::string or a Property::Index
38  * @SINCE_1_2.7
39  */
40 struct DALI_IMPORT_API Property::Key
41 {
42   /**
43    * @brief The type of key
44    * @SINCE_1_2.7
45    */
46   enum Type
47   {
48     INDEX, ///< The key is a Property::Index
49     STRING ///< The key is a string
50   } type; ///< The type of the key
51
52   Property::Index indexKey; ///< The index key.
53   std::string stringKey; ///< The string key.
54
55   /**
56    * @brief Constructor
57    * @SINCE_1_2.7
58    *
59    * @param[in] key The string key
60    */
61   explicit Key( const std::string& key );
62
63   /**
64    * @brief Constructor
65    * @SINCE_1_2.7
66    *
67    * @param[in] key The index key
68    */
69   explicit Key( Property::Index key );
70
71   /**
72    * @brief The equality operator
73    * @SINCE_1_2.7
74    *
75    * @param[in] rhs A string key to compare against.
76    * @return true if the key compares, or false if it isn't equal or of the wrong type
77    */
78   bool operator== (const std::string& rhs);
79
80   /**
81    * @brief The equality operator
82    * @SINCE_1_2.7
83    *
84    * @param[in] rhs An index key to compare against.
85    * @return true if the key compares, or false if it isn't equal or of the wrong type
86    */
87   bool operator== (Property::Index rhs);
88
89   /**
90    * @brief The equality operator
91    * @SINCE_1_2.7
92    *
93    * @param[in] rhs A key  to compare against.
94    * @return true if the keys are of the same type and have the same value
95    */
96   bool operator== (const Key& rhs);
97
98   /**
99    * @brief The inequality operator
100    * @SINCE_1_2.7
101    *
102    * @param[in] rhs A string key to compare against.
103    * @return true if the key is not equal or not a string key
104    */
105   bool operator!= (const std::string& rhs);
106
107   /**
108    * @brief The inequality operator
109    * @SINCE_1_2.7
110    *
111    * @param[in] rhs An index key to compare against.
112    * @return true if the key is not equal, or not an index key
113    */
114   bool operator!= (Property::Index rhs);
115
116   /**
117    * @brief The inequality operator
118    * @SINCE_1_2.7
119    *
120    * @param[in] rhs A key to compare against.
121    * @return true if the keys are not of the same type or are not equal
122    */
123   bool operator!= (const Key& rhs);
124 };
125
126 /**
127  * @brief Convert the key into a string and append to an output stream.
128  *
129  * @SINCE_1_2.7
130  * @param [in] stream The output stream operator.
131  * @param [in] key the key to convert
132  * @return The output stream operator.
133  */
134 DALI_IMPORT_API std::ostream& operator<<( std::ostream& stream, const Property::Key& key );
135
136
137 /**
138  * @}
139  */
140 } // namespace Dali
141
142 #endif // __DALI_PROPERTY_KEY_H__