X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Flayouting%2Fmeasure-spec.h;h=ccc23ed7ae851ff97b9472ac71f066e1a1a5414f;hb=34bb584d815970cb12b0678cf68915338800ebb4;hp=f766247e2302888be0241c67500f5db053bcd68b;hpb=16634ab902b66b0ba2f3f39af8ff6ed25b5f7115;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/layouting/measure-spec.h b/dali-toolkit/devel-api/layouting/measure-spec.h old mode 100644 new mode 100755 index f766247..ccc23ed --- a/dali-toolkit/devel-api/layouting/measure-spec.h +++ b/dali-toolkit/devel-api/layouting/measure-spec.h @@ -17,10 +17,14 @@ * limitations under the License. */ +// EXTERNAL INCLUDES +#include +#include #include -#include -#include +// INTERNAL INCLUDES +#include +#include namespace Dali { @@ -32,10 +36,9 @@ namespace Toolkit * how to be measured. For instance, it may measure a child with an exact width and an unspecified * height in order to determine height for width. */ -class DALI_IMPORT_API MeasureSpec +class DALI_TOOLKIT_API MeasureSpec { public: - using IntType = LayoutLength::IntType; enum class Mode { @@ -47,12 +50,12 @@ public: }; MeasureSpec( LayoutLength measureSpec, MeasureSpec::Mode mode ) - : mSize( measureSpec.mValue ), + : mSize( measureSpec ), mMode( mode ) { } - MeasureSpec( IntType measureSpec ) + MeasureSpec( LayoutLength measureSpec ) : mSize( measureSpec ), mMode( Mode::UNSPECIFIED ) { @@ -62,8 +65,11 @@ public: MeasureSpec& operator=( const MeasureSpec& rhs ) { - this->mSize = rhs.mSize; - this->mMode = rhs.mMode; + if( this != &rhs ) + { + this->mSize = rhs.mSize; + this->mMode = rhs.mMode; + } return *this; } @@ -78,6 +84,16 @@ public: } /** + * @brief Set the mode of the measure spec. + * + * @param mode The mode to set + */ + void SetMode( MeasureSpec::Mode mode ) + { + mMode = mode; + } + + /** * @brief Get the mode of the measure spec. * * @return The mode of the measure spec @@ -88,11 +104,21 @@ public: } /** + * @brief Set the size of the measure spec + * + * @param size the size to set + */ + void SetSize( LayoutLength size ) + { + mSize = size; + } + + /** * @brief Get the size of the measure spec * * @return the size of the measure spec */ - IntType GetSize() const + LayoutLength GetSize() const { return mSize; } @@ -117,7 +143,7 @@ public: return MeasureSpec( size, MeasureSpec::Mode::UNSPECIFIED ); } - if( delta < 0 && measureSpec.mSize < static_cast(abs(delta)) ) + if( delta < 0 && measureSpec.mSize < abs(delta) ) { size = 0; } @@ -128,9 +154,11 @@ public: return MeasureSpec( size, mode ); } -public: - IntType mSize; ///< The specified size +private: + + LayoutLength mSize; ///< The specified size Mode mMode; ///< The measure mode + }; inline std::ostream& operator<< (std::ostream& o, const MeasureSpec& measureSpec )