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=04c4d01969c2a9fb48fb58e304a5a97b03e7b814;hpb=6c66c6ac8f3ba5f396cfa617d5a6310df53a4f4d;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 04c4d01..ccc23ed --- a/dali-toolkit/devel-api/layouting/measure-spec.h +++ b/dali-toolkit/devel-api/layouting/measure-spec.h @@ -17,12 +17,15 @@ * limitations under the License. */ +// EXTERNAL INCLUDES +#include +#include #include + +// INTERNAL INCLUDES #include #include -#include - namespace Dali { namespace Toolkit @@ -36,7 +39,6 @@ namespace Toolkit class DALI_TOOLKIT_API MeasureSpec { public: - using IntType = LayoutLength::IntType; enum class Mode { @@ -48,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 ) { @@ -82,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 @@ -92,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; } @@ -121,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; } @@ -132,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 )