Add Property::EXTENTS type
[platform/core/uifw/dali-core.git] / dali / public-api / common / extents.h
1 #ifndef DALI_EXTENTS_H
2 #define DALI_EXTENTS_H
3
4 /*
5  * Copyright (c) 2017 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 <cstdint>
23 #include <ostream>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/common/dali-common.h>
27
28 namespace Dali
29 {
30 /**
31  * @addtogroup dali_core_common
32  * @{
33  */
34
35 /**
36  * @brief Structure describing the a collection of uint16_t.
37  * @SINCE_1_2.62
38  */
39 struct DALI_EXPORT_API Extents
40 {
41   /**
42    * @brief Default constructor which provides an initialized Dali::Extents( 0u, 0u, 0u, 0u ).
43    * @SINCE_1_2.62
44    */
45   Extents();
46
47   /**
48    * @brief Copy constructor.
49    * @SINCE_1_2.62
50    * @param[in] copy A reference to the copied Extents
51    */
52   Extents( const Extents& copy ) = default;
53
54   /**
55    * @brief Constructor.
56    *
57    * @SINCE_1_2.62
58    * @param[in] start     Start extent
59    * @param[in] end       End extent
60    * @param[in] top       Top extent
61    * @param[in] bottom    Bottom extent
62    */
63   Extents( uint16_t start, uint16_t end, uint16_t top, uint16_t bottom );
64
65   /**
66    * @brief Copy Assignment operator.
67    * @SINCE_1_2.62
68    * @param[in] copy A reference to the copied Extents
69    * @return Itself
70    */
71   Extents& operator=( const Extents& copy ) = default;
72
73   /**
74    * @brief Assignment operator.
75    *
76    * @SINCE_1_2.62
77    * @param[in] array Array of uint16_t
78    * @return Itself
79    */
80   Extents& operator=( const uint16_t* array );
81
82   /**
83    * @brief Equality operator.
84    *
85    * @SINCE_1_2.62
86    * @param[in] rhs The Extents to test against
87    * @return True if the extents are equal
88    */
89   bool operator==( const Extents &rhs ) const;
90
91   /**
92    * @brief Inequality operator.
93    *
94    * @SINCE_1_2.62
95    * @param[in] rhs The Extents to test against
96    * @return True if the extents are not equal
97    */
98   bool operator!=( const Extents &rhs ) const;
99
100 public:
101   uint16_t start;   ///< The start extent.  @SINCE_1_2.62
102   uint16_t end;     ///< The end extent.    @SINCE_1_2.62
103   uint16_t top;     ///< The top extent.    @SINCE_1_2.62
104   uint16_t bottom;  ///< The bottom extent. @SINCE_1_2.62
105
106 };
107
108 /**
109  * @brief Converts the value of the extents into a string and insert in to an output stream.
110  *
111  * @SINCE_1_2.62
112  * @param[in] stream The output stream operator
113  * @param[in] extents The Extents to output
114  * @return The output stream operator
115  */
116 DALI_EXPORT_API std::ostream& operator<<( std::ostream& stream, const Extents& extents );
117
118 /**
119  * @}
120  */
121 } // namespace Dali
122
123 #endif // DALI_EXTENTS_H